diff options
author | Florian Kagerer | 2010-08-03 14:58:01 +0000 |
---|---|---|
committer | Florian Kagerer | 2010-08-03 14:58:01 +0000 |
commit | 5962b0bbe27b8d32dbbad1e8c3d36906dc391dd2 (patch) | |
tree | be38767ea9fa764f5eda0cfb9a678146a2bb26e3 /engines | |
parent | 221934ea9374bb1248784d4e88a78c36b881f3fb (diff) | |
download | scummvm-rg350-5962b0bbe27b8d32dbbad1e8c3d36906dc391dd2.tar.gz scummvm-rg350-5962b0bbe27b8d32dbbad1e8c3d36906dc391dd2.tar.bz2 scummvm-rg350-5962b0bbe27b8d32dbbad1e8c3d36906dc391dd2.zip |
KYRA/TOWNS: implement music/sfx volume control via GUI/GMM
svn-id: r51695
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/sound_intern.h | 2 | ||||
-rw-r--r-- | engines/kyra/sound_towns.cpp | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/engines/kyra/sound_intern.h b/engines/kyra/sound_intern.h index 186162a700..f8738bc791 100644 --- a/engines/kyra/sound_intern.h +++ b/engines/kyra/sound_intern.h @@ -122,6 +122,8 @@ public: void beginFadeOut(); + void updateVolumeSettings(); + private: bool loadInstruments(); void playEuphonyTrack(uint32 offset, int loop); diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 1209c6b69a..5f877f7d8a 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -203,6 +203,19 @@ void SoundTowns::playSoundEffect(uint8 track) { _driver->playSoundEffect(_sfxChannel, note, 127, sfxPlaybackBuffer); } +void SoundTowns::updateVolumeSettings() { + if (!_driver) + return; + + bool mute = false; + _driver->setSoundEffectVolume(ConfMan.getInt("sfx_volume")); + if (ConfMan.hasKey("mute")) + mute = ConfMan.getBool("mute"); + + _driver->setMusicVolume((mute ? 0 : ConfMan.getInt("music_volume"))); + _driver->setSoundEffectVolume((mute ? 0 : ConfMan.getInt("sfx_volume"))); +} + void SoundTowns::stopAllSoundEffects() { _driver->chanVolume(0x46, 0); _driver->chanVolume(0x47, 0); @@ -298,7 +311,7 @@ bool SoundTowns::loadInstruments() { src = src + READ_LE_UINT16(&src[12]) + 32; } - _driver->reserveSfxChannels(2); + _driver->reserveSoundEffectChannels(2); delete[] twm; |