Add Sound Effect API to class SoundPlayer (Experimental)

This commit is contained in:
Kirigaya Kazuto 2017-06-06 16:00:51 +08:00
parent 01c31a4f71
commit f1f86c933d
2 changed files with 26 additions and 0 deletions

View File

@ -2408,6 +2408,26 @@ namespace MiniEngine
return Mix_HaltChannel(id); return Mix_HaltChannel(id);
} }
int SoundPlayer::setPanning(ChannelID id, uint8_t left, uint8_t right)
{
return Mix_SetPanning(id,left,right);
}
int SoundPlayer::setPosition(ChannelID id, int16_t angle, uint8_t distance)
{
return Mix_SetPosition(id,angle,distance);
}
int SoundPlayer::setDistance(ChannelID id, uint8_t distance)
{
return Mix_SetDistance(id,distance);
}
int SoundPlayer::setReverseStereo(ChannelID id, int flip)
{
return Mix_SetReverseStereo(id,flip);
}
AudioPlayer::_Audio* AudioPlayer::_sysAudio = nullptr; AudioPlayer::_Audio* AudioPlayer::_sysAudio = nullptr;
int AudioPlayer::_sysAudioCounter = 0; int AudioPlayer::_sysAudioCounter = 0;

View File

@ -723,6 +723,12 @@ namespace MiniEngine
void pause(ChannelID id); void pause(ChannelID id);
void resume(ChannelID id); void resume(ChannelID id);
int stop(ChannelID id); int stop(ChannelID id);
/// Experimental
int setPanning(ChannelID id,uint8_t left,uint8_t right);
int setPosition(ChannelID id,int16_t angle,uint8_t distance);
int setDistance(ChannelID id,uint8_t distance);
int setReverseStereo(ChannelID id,int flip);
}; };
class StringEngine class StringEngine