diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/mixer.cpp | 9 | ||||
-rw-r--r-- | sound/mixer.h | 7 |
2 files changed, 12 insertions, 4 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp index 1e7b0c9c80..6e8f514c1f 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -171,7 +171,8 @@ void SoundMixer::insertChannel(PlayingSoundHandle *handle, Channel *chan) { handle->setIndex(index); } -void SoundMixer::playRaw(PlayingSoundHandle *handle, void *sound, uint32 size, uint rate, byte flags, int id, byte volume, int8 balance, uint32 loopStart, uint32 loopEnd) { +void SoundMixer::playRaw(PlayingSoundHandle *handle, void *sound, uint32 size, uint rate, byte flags, + int id, byte volume, int8 balance, uint32 loopStart, uint32 loopEnd) { Common::StackLock lock(_mutex); // Prevent duplicate sounds @@ -204,7 +205,8 @@ void SoundMixer::playRaw(PlayingSoundHandle *handle, void *sound, uint32 size, u insertChannel(handle, chan); } -void SoundMixer::playInputStream(PlayingSoundHandle *handle, AudioStream *input, bool isMusic, byte volume, int8 balance, int id, bool autofreeStream, bool permanent) { +void SoundMixer::playInputStream(PlayingSoundHandle *handle, AudioStream *input, bool isMusic, + int id, byte volume, int8 balance, bool autofreeStream, bool permanent) { Common::StackLock lock(_mutex); if (input == 0) { @@ -409,6 +411,9 @@ void SoundMixer::setVolume(int volume) { volume = 256; else if (volume < 0) volume = 0; + + // TODO: Maybe we should do logarithmic (not linear) volume + // scaling? See also Player_V2::setMasterVolume _globalVolume = volume; } diff --git a/sound/mixer.h b/sound/mixer.h index b071c7b293..2f9d5713a3 100644 --- a/sound/mixer.h +++ b/sound/mixer.h @@ -126,12 +126,15 @@ public: * passed on to playInputStream. */ void playRaw(PlayingSoundHandle *handle, void *sound, uint32 size, uint rate, byte flags, - int id = -1, byte volume = 255, int8 balance = 0, uint32 loopStart = 0, uint32 loopEnd = 0); + int id = -1, byte volume = 255, int8 balance = 0, + uint32 loopStart = 0, uint32 loopEnd = 0); /** * Start playing the given audio input stream. */ - void playInputStream(PlayingSoundHandle *handle, AudioStream *input, bool isMusic, byte volume = 255, int8 balance = 0, int id = -1, bool autofreeStream = true, bool permanent = false); + void playInputStream(PlayingSoundHandle *handle, AudioStream *input, bool isMusic, + int id = -1, byte volume = 255, int8 balance = 0, + bool autofreeStream = true, bool permanent = false); |