Trying to cleanup the volume control mess inside the SCUMM engine: renamed MusicEngine::setMasterVolume to setMusicVolume; fixed iMuse to use the correct method for setMusicVolume (previously modified the iMuse internal volume control); hooked up the volume control of various other music engines; added ScummEngine::setupVolume method which can be called whenever volume settings change, and which gurantees that those are handled uniformly

svn-id: r15944
This commit is contained in:
Max Horn 2004-11-28 21:24:02 +00:00
parent 6c84bbf2bd
commit 1ae87c0fbb
19 changed files with 65 additions and 67 deletions

View file

@ -462,31 +462,8 @@ void ConfigDialog::close() {
}
GUI_OptionsDialog::close();
// Sync the engine with the config manager
int soundVolumeMaster = ConfMan.getInt("master_volume");
int soundVolumeMusic = ConfMan.getInt("music_volume");
int soundVolumeSfx = ConfMan.getInt("sfx_volume");
int soundVolumeSpeech = ConfMan.getInt("speech_volume");
if (_vm->_imuseDigital) {
_vm->_mixer->setVolume(soundVolumeMaster);
_vm->_imuseDigital->setGroupMusicVolume(soundVolumeMusic / 2);
_vm->_imuseDigital->setGroupSfxVolume(soundVolumeSfx / 2);
_vm->_imuseDigital->setGroupVoiceVolume(soundVolumeSpeech / 2);
return;
}
if (_vm->_imuse) {
_vm->_imuse->set_music_volume(soundVolumeMusic);
}
if (_vm->_musicEngine) {
_vm->_musicEngine->setMasterVolume(soundVolumeMaster);
}
_vm->_mixer->setVolume(soundVolumeSfx * soundVolumeMaster / 255);
_vm->_mixer->setMusicVolume(soundVolumeMusic);
_vm->setupVolumes();
}