mirror of
https://github.com/Kiritow/MiniEngine.git
synced 2024-03-22 13:11:22 +08:00
Add decoder query functions in class MusicPlayer and SoundPlayer
This commit is contained in:
parent
bf0f6b8b6d
commit
01c31a4f71
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user