diff options
author | dhewg | 2011-03-19 14:51:28 +0100 |
---|---|---|
committer | dhewg | 2011-03-19 15:34:57 +0100 |
commit | e5056cab91843ec0de9b2c9d1b6d91ed49189da9 (patch) | |
tree | 4f2b08082dc9bf604dfcdde45cf5c463e7ce1a39 | |
parent | f8271e0d07db5af850934595cb2c708f7d61bfaf (diff) | |
download | scummvm-rg350-e5056cab91843ec0de9b2c9d1b6d91ed49189da9.tar.gz scummvm-rg350-e5056cab91843ec0de9b2c9d1b6d91ed49189da9.tar.bz2 scummvm-rg350-e5056cab91843ec0de9b2c9d1b6d91ed49189da9.zip |
CINE: Init volume levels on startup
Add syncSoundSettings() to set the volume for kPlainSoundType and
respect the global mute setting
-rw-r--r-- | engines/cine/cine.cpp | 25 | ||||
-rw-r--r-- | engines/cine/cine.h | 2 |
2 files changed, 19 insertions, 8 deletions
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index d80ab70660..54d113d69c 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -50,20 +50,15 @@ Sound *g_sound = 0; CineEngine *g_cine = 0; CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { + // Setup mixer + syncSoundSettings(); + DebugMan.addDebugChannel(kCineDebugScript, "Script", "Script debug level"); DebugMan.addDebugChannel(kCineDebugPart, "Part", "Part debug level"); DebugMan.addDebugChannel(kCineDebugSound, "Sound", "Sound debug level"); DebugMan.addDebugChannel(kCineDebugCollision, "Collision", "Collision debug level"); _console = new CineConsole(this); - // Setup mixer - _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); - _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); - // Use music volume for plain sound types (At least the AdLib player uses a plain sound type - // so previously the music and sfx volume controls didn't affect it at all). - // FIXME: Make AdLib player differentiate between playing sound effects and music and remove this. - _mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, ConfMan.getInt("music_volume")); - g_cine = this; g_eventRec.registerRandomSource(_rnd, "cine"); @@ -78,6 +73,20 @@ CineEngine::~CineEngine() { delete _console; } +void CineEngine::syncSoundSettings() { + Engine::syncSoundSettings(); + + bool mute = false; + if (ConfMan.hasKey("mute")) + mute = ConfMan.getBool("mute"); + + // Use music volume for plain sound types (At least the AdLib player uses a plain sound type + // so previously the music and sfx volume controls didn't affect it at all). + // FIXME: Make AdLib player differentiate between playing sound effects and music and remove this. + _mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, + mute ? 0 : ConfMan.getInt("music_volume")); +} + Common::Error CineEngine::run() { // Initialize backend initGraphics(320, 200, false); diff --git a/engines/cine/cine.h b/engines/cine/cine.h index 5f49a2907f..7de0bdc86f 100644 --- a/engines/cine/cine.h +++ b/engines/cine/cine.h @@ -117,6 +117,8 @@ public: CineEngine(OSystem *syst, const CINEGameDescription *gameDesc); virtual ~CineEngine(); + virtual void syncSoundSettings(); + int getGameType() const; uint32 getFeatures() const; Common::Language getLanguage() const; |