diff --git a/MiniEngine.cpp b/MiniEngine.cpp index 2a2cf6a..86c6ec1 100644 --- a/MiniEngine.cpp +++ b/MiniEngine.cpp @@ -2231,6 +2231,18 @@ namespace MiniEngine return _music.get(); } + //static + int MusicPlayer::GetDecoderNum() + { + return Mix_GetNumMusicDecoders(); + } + + //static + std::string MusicPlayer::GetDecoderName(int index) + { + return std::string(Mix_GetMusicDecoder(index)); + } + Music MusicPlayer::loadMusic(std::string Filename) throw(ErrorViewer) { Mix_Music* temp = Mix_LoadMUS(Filename.c_str()); @@ -2321,6 +2333,18 @@ namespace MiniEngine return _sound.get(); } + //static + int SoundPlayer::GetDecoderNum() + { + return Mix_GetNumChunkDecoders(); + } + + //static + std::string SoundPlayer::GetDecoderName(int index) + { + return std::string(Mix_GetChunkDecoder(index)); + } + SoundPlayer::SoundPlayer(int Channels) { Mix_AllocateChannels(Channels); diff --git a/MiniEngine.h b/MiniEngine.h index 3ab9fe6..ad1083d 100644 --- a/MiniEngine.h +++ b/MiniEngine.h @@ -673,6 +673,9 @@ namespace MiniEngine class MusicPlayer : public AudioPlayer { public: + static int GetDecoderNum(); + static std::string GetDecoderName(int index); + Music loadMusic(std::string Filename) throw (ErrorViewer); int play(Music music, int loops); @@ -709,6 +712,9 @@ namespace MiniEngine class SoundPlayer : public AudioPlayer { public: + static int GetDecoderNum(); + static std::string GetDecoderName(int index); + SoundPlayer(int Channels = 16); Sound loadSound(std::string Filename) throw (ErrorViewer); ChannelID playSound(Sound sound, int loops) throw (ErrorViewer);