From f1f86c933d96dbc4c60c5788aab6271702c53a28 Mon Sep 17 00:00:00 2001 From: kiritow <1362050620@qq.com> Date: Tue, 6 Jun 2017 16:00:51 +0800 Subject: [PATCH] Add Sound Effect API to class SoundPlayer (Experimental) --- MiniEngine.cpp | 20 ++++++++++++++++++++ MiniEngine.h | 6 ++++++ 2 files changed, 26 insertions(+) diff --git a/MiniEngine.cpp b/MiniEngine.cpp index 86c6ec1..edf9b46 100644 --- a/MiniEngine.cpp +++ b/MiniEngine.cpp @@ -2408,6 +2408,26 @@ namespace MiniEngine 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; int AudioPlayer::_sysAudioCounter = 0; diff --git a/MiniEngine.h b/MiniEngine.h index ad1083d..7f62511 100644 --- a/MiniEngine.h +++ b/MiniEngine.h @@ -723,6 +723,12 @@ namespace MiniEngine void pause(ChannelID id); void resume(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