[Scummvm-git-logs] scummvm master -> a78efc244c66331360cb2dac0cef168a8841f7d5

antoniou79 a.antoniou79 at gmail.com
Sun Jun 7 10:03:33 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a78efc244c BLADERUNNER: Respect the No Music ScummVM setting


Commit: a78efc244c66331360cb2dac0cef168a8841f7d5
    https://github.com/scummvm/scummvm/commit/a78efc244c66331360cb2dac0cef168a8841f7d5
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2020-06-07T13:03:23+03:00

Commit Message:
BLADERUNNER: Respect the No Music ScummVM setting

This refers to the Audio tab's "Music Device" set to "No Music" setting

Default ("Auto") and any other setting will result to music. Only the explicit No Music is respected now (it wasn't before).
As I note in the comments, these two first dropdowns in the Audio tab are largely irrelevant for Blade Runner
and ideally they should not appear for it (and similar engines). Maybe they could just be replaced
with a checkbox for toggling Music as enabled/disabled (which is the logic that this fix essentially follows)

Changed paths:
    engines/bladerunner/bladerunner.cpp
    engines/bladerunner/bladerunner.h


diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 31713943fa..3682737e50 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -92,6 +92,7 @@
 #include "engines/advancedDetector.h"
 
 #include "graphics/pixelformat.h"
+#include "audio/mididrv.h"
 
 namespace BladeRunner {
 
@@ -596,6 +597,19 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
 
 	_ambientSounds = new AmbientSounds(this);
 
+	// Query the selected music device (defaults to MT_AUTO device).
+	Common::String selDevStr = ConfMan.hasKey("music_driver") ? ConfMan.get("music_driver") : Common::String("auto");
+	MidiDriver::DeviceHandle dev = MidiDriver::getDeviceHandle(selDevStr.empty() ? Common::String("auto") : selDevStr);
+	//
+	// We just respect the "No Music" choice (or an invalid choice)
+	//
+	// We're lenient with all the invalid/ irrelevant choices in the Audio Driver dropdown
+	// TODO Ideally these controls (OptionsDialog::addAudioControls()) ie. "Music Device" and "Adlib Emulator"
+	//      should not appear in games like Blade Runner, since they are largely irrelevant
+	//      and may cause confusion when combined/ conflicting with the global settings
+	//      which are by default applied, if the user does not explicitly override them.
+	_noMusicDriver = (MidiDriver::getMusicType(dev) == MT_NULL || MidiDriver::getMusicType(dev) == MT_INVALID);
+
 	// BLADE.INI was read here, but it was replaced by ScummVM configuration
 	//
 	syncSoundSettings();
@@ -1979,10 +1993,17 @@ void BladeRunnerEngine::syncSoundSettings() {
 	_mixer->setVolumeForSoundType(_mixer->kSpeechSoundType, ConfMan.getInt("speech_volume"));
 	// debug("syncSoundSettings: Volumes synced as Music: %d, Sfx: %d, Speech: %d", ConfMan.getInt("music_volume"), ConfMan.getInt("sfx_volume"), ConfMan.getInt("speech_volume"));
 
+	if (_noMusicDriver) {
+		// This affects *only* the music muting.
+		_mixer->muteSoundType(_mixer->kMusicSoundType, true);
+	}
+
 	bool allSoundIsMuted = false;
 	if (ConfMan.hasKey("mute")) {
 		allSoundIsMuted = ConfMan.getBool("mute");
-		_mixer->muteSoundType(_mixer->kMusicSoundType, allSoundIsMuted);
+		if (!_noMusicDriver) {
+			_mixer->muteSoundType(_mixer->kMusicSoundType, allSoundIsMuted);
+		}
 		_mixer->muteSoundType(_mixer->kSFXSoundType, allSoundIsMuted);
 		_mixer->muteSoundType(_mixer->kSpeechSoundType, allSoundIsMuted);
 	}
@@ -1993,6 +2014,7 @@ void BladeRunnerEngine::syncSoundSettings() {
 		// but we need to mute the speech
 		_mixer->muteSoundType(_mixer->kSpeechSoundType, ConfMan.getBool("speech_mute"));
 	}
+
 	// write-back to ini file for persistence
 	ConfMan.flushToDisk(); // TODO Or maybe call this only when game is shut down?
 }
diff --git a/engines/bladerunner/bladerunner.h b/engines/bladerunner/bladerunner.h
index b5958069f3..d70b8e1a6b 100644
--- a/engines/bladerunner/bladerunner.h
+++ b/engines/bladerunner/bladerunner.h
@@ -126,6 +126,7 @@ public:
 	Common::String   _languageCode;
 	Common::Language _language;
 	bool             _russianCP1251;
+	bool             _noMusicDriver; // If "Music Device" is set to "No Music" from Audio tab
 
 	ActorDialogueQueue *_actorDialogueQueue;
 	ScreenEffects      *_screenEffects;




More information about the Scummvm-git-logs mailing list