Add direct effect add/remove control to SoundPlayer

This commit is contained in:
Kirigaya Kazuto 2017-06-14 20:50:12 +08:00
parent dd2ccfa55c
commit a96b48b0c0
2 changed files with 21 additions and 0 deletions

View File

@ -2831,6 +2831,22 @@ namespace MiniEngine
return Mix_SetReverseStereo(id,flip);
}
int SoundPlayer::addEffect(ChannelID id,Mix_EffectFunc_t f, Mix_EffectDone_t d, void* arg)
{
return Mix_RegisterEffect(id,f,d,arg);
}
int SoundPlayer::removeEffect(ChannelID id,Mix_EffectFunc_t f)
{
return Mix_UnregisterEffect(id,f);
}
int SoundPlayer::removeAllEffect(ChannelID id)
{
return Mix_UnregisterAllEffects(id);
}
AudioPlayer::_Audio* AudioPlayer::_sysAudio = nullptr;
int AudioPlayer::_sysAudioCounter = 0;

View File

@ -834,6 +834,11 @@ namespace MiniEngine
int setPosition(ChannelID id,int16_t angle,uint8_t distance);
int setDistance(ChannelID id,uint8_t distance);
int setReverseStereo(ChannelID id,int flip);
/// Experimental: Direct Add/Remove Effect
int addEffect(ChannelID id,Mix_EffectFunc_t f, Mix_EffectDone_t d, void *arg);
int removeEffect(ChannelID id,Mix_EffectFunc_t f);
int removeAllEffect(ChannelID id);
};
class StringEngine