diff options
author | Arnaud Boutonné | 2010-12-22 22:25:52 +0000 |
---|---|---|
committer | Arnaud Boutonné | 2010-12-22 22:25:52 +0000 |
commit | 6d30449d5aeaf21c810e31ee15776cf9a4522251 (patch) | |
tree | 3186b6ae326578caefe49871b47678f05b0be152 /engines/hugo | |
parent | 8e26ae0f92ded60f6241c68349812770b8d3c3fe (diff) | |
download | scummvm-rg350-6d30449d5aeaf21c810e31ee15776cf9a4522251.tar.gz scummvm-rg350-6d30449d5aeaf21c810e31ee15776cf9a4522251.tar.bz2 scummvm-rg350-6d30449d5aeaf21c810e31ee15776cf9a4522251.zip |
HUGO: Implement syncSoundSettings()
svn-id: r55018
Diffstat (limited to 'engines/hugo')
-rw-r--r-- | engines/hugo/hugo.cpp | 8 | ||||
-rw-r--r-- | engines/hugo/hugo.h | 1 | ||||
-rw-r--r-- | engines/hugo/sound.cpp | 18 | ||||
-rw-r--r-- | engines/hugo/sound.h | 1 |
4 files changed, 26 insertions, 2 deletions
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp index 993c90e4ea..02eca3ff68 100644 --- a/engines/hugo/hugo.cpp +++ b/engines/hugo/hugo.cpp @@ -1276,4 +1276,12 @@ bool HugoEngine::canSaveGameStateCurrently() { int8 HugoEngine::getTPS() { return ((_config.turboFl) ? TURBO_TPS : _normalTPS); } + +void HugoEngine::syncSoundSettings() { + Engine::syncSoundSettings(); + + _sound->syncVolume(); +} + + } // End of namespace Hugo diff --git a/engines/hugo/hugo.h b/engines/hugo/hugo.h index 7492e2ae03..a6162b1dfe 100644 --- a/engines/hugo/hugo.h +++ b/engines/hugo/hugo.h @@ -215,6 +215,7 @@ public: void setNewScreen(int screen); void shutdown(); void storeBoundary(int x1, int x2, int y); + void syncSoundSettings(); int getMouseX() const { return _mouseX; diff --git a/engines/hugo/sound.cpp b/engines/hugo/sound.cpp index 6ebbe930a4..1894a636d8 100644 --- a/engines/hugo/sound.cpp +++ b/engines/hugo/sound.cpp @@ -305,6 +305,9 @@ void SoundHandler::playSound(int16 sound, stereo_t channel, byte priority) { /* Sound disabled */ if (!_config.soundFl || !_vm->_mixer->isReady()) return; + + syncVolume(); + // // // See if last wave still playing - if so, check priority // if (waveOutUnprepareHeader(hwav, lphdr, sizeof(WAVEHDR)) == WAVERR_STILLPLAYING) @@ -319,8 +322,7 @@ void SoundHandler::playSound(int16 sound, stereo_t channel, byte priority) { return; Audio::AudioStream *stream = Audio::makeRawStream(sound_p, size, 11025, Audio::FLAG_UNSIGNED); - _vm->_mixer->playStream(Audio::Mixer::kSpeechSoundType, &_soundHandle, stream); - + _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle, stream); } /** @@ -330,4 +332,16 @@ void SoundHandler::initSound() { _midiPlayer->open(); } +void SoundHandler::syncVolume() { + int soundVolume; + + if (ConfMan.getBool("sfx_mute") || ConfMan.getBool("mute")) + soundVolume = -1; + else + soundVolume = MIN(255, ConfMan.getInt("sfx_volume")); + + _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolume); + _midiPlayer->syncVolume(); +} + } // End of namespace Hugo diff --git a/engines/hugo/sound.h b/engines/hugo/sound.h index 0a0b99a859..4a7f6ac21f 100644 --- a/engines/hugo/sound.h +++ b/engines/hugo/sound.h @@ -97,6 +97,7 @@ public: void playMusic(int16 tune); void playSound(int16 sound, stereo_t channel, byte priority); void initSound(); + void syncVolume(); private: HugoEngine *_vm; |