diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/engine.cpp | 2 | ||||
-rw-r--r-- | engines/engine.h | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/engines/engine.cpp b/engines/engine.cpp index 5ce0f99921..0e5e58bc72 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -430,7 +430,6 @@ int Engine::runDialog(GUI::Dialog &dialog) { } void Engine::syncSoundSettings() { - // Sync the engine with the config manager int soundVolumeMusic = ConfMan.getInt("music_volume"); int soundVolumeSFX = ConfMan.getInt("sfx_volume"); @@ -440,6 +439,7 @@ void Engine::syncSoundSettings() { if (ConfMan.hasKey("mute")) mute = ConfMan.getBool("mute"); + _mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, (mute ? 0 : Audio::Mixer::kMaxMixerVolume)); _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, (mute ? 0 : soundVolumeMusic)); _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, (mute ? 0 : soundVolumeSFX)); _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, (mute ? 0 : soundVolumeSpeech)); diff --git a/engines/engine.h b/engines/engine.h index 508e9887ef..168a1dc2a0 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -163,6 +163,15 @@ public: * Notify the engine that the sound settings in the config manager may have * changed and that it hence should adjust any internal volume etc. values * accordingly. + * The default implementation sets the volume levels of all mixer sound + * types according to the config entries of the active domain. + * When overwriting, call the default implementation first, then adjust the + * volumes further (if required). + * + * @note When setting volume levels, respect the "mute" config entry. + * @note The volume for the plain sound type is reset to the maximum + * volume. If the engine can associate its own value for this + * type, it needs to overwrite this member and set it accordingly. * @todo find a better name for this */ virtual void syncSoundSettings(); |