[Scummvm-git-logs] scummvm master -> 0cfab98091caabdef772c9bbbd3291ec2976bb3b

bluegr noreply at scummvm.org
Sat Feb 7 14:50:36 UTC 2026


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

Summary:
0cfab98091 SHERLOCK: Fix volume controls for MIDI music


Commit: 0cfab98091caabdef772c9bbbd3291ec2976bb3b
    https://github.com/scummvm/scummvm/commit/0cfab98091caabdef772c9bbbd3291ec2976bb3b
Author: Miguel Herrero (spam.maps at icloud.com)
Date: 2026-02-07T16:50:33+02:00

Commit Message:
SHERLOCK: Fix volume controls for MIDI music

Map kPlainSoundType to the music volume so that the Music slider
controls MIDI playback. Emulated MIDI synths (OPL, MT-32,
FluidSynth) register their audio output with the mixer as
kPlainSoundType (hardcoded in audio/chip.cpp and audio/softsynth/),
which was previously only set by the SFX volume control.

- Music::setMusicVolume(): Also set kPlainSoundType so the in-game
  Music slider in Rose Tattoo affects MIDI music.
- Music::syncMusicSettings(): Re-apply kPlainSoundType with the
  music volume after Engine::defaultSyncSoundSettings() resets it
  to max. This covers the ScummVM global options dialog.
- Sound::setVolume(): Remove kPlainSoundType so the SFX/voices
  slider no longer affects MIDI music.

Fixes bug #7012.

Co-authored-by: Cursor <cursoragent at cursor.com>

Changed paths:
    engines/sherlock/music.cpp
    engines/sherlock/sound.cpp


diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp
index 0c1eebeaa62..70f3f4ae50c 100644
--- a/engines/sherlock/music.cpp
+++ b/engines/sherlock/music.cpp
@@ -397,6 +397,14 @@ bool Music::loadSong(const Common::String &songName) {
 
 void Music::syncMusicSettings() {
 	_musicOn = !ConfMan.getBool("mute") && !ConfMan.getBool("music_mute");
+
+	// MIDI synth output is registered with the mixer as kPlainSoundType
+	// (hardcoded in audio/chip.cpp and audio/softsynth/). Map the music
+	// volume to kPlainSoundType so that the Music slider controls MIDI
+	// playback. Engine::defaultSyncSoundSettings() resets kPlainSoundType
+	// to max, so this override must run after it.
+	_musicVolume = ConfMan.getInt("music_volume");
+	_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, _musicVolume);
 }
 
 bool Music::playMusic(const Common::String &name) {
@@ -589,6 +597,7 @@ void Music::setMusicVolume(int volume) {
 	_musicVolume = volume;
 	_musicOn = volume > 0;
 	_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, volume);
+	_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, volume);
 }
 
 void Music::getSongNames(Common::StringArray &songs) {
diff --git a/engines/sherlock/sound.cpp b/engines/sherlock/sound.cpp
index 5789944654e..2d58baba5a4 100644
--- a/engines/sherlock/sound.cpp
+++ b/engines/sherlock/sound.cpp
@@ -242,7 +242,6 @@ void Sound::setVolume(int volume) {
 	_soundVolume = volume;
 	_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, volume);
 	_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, volume);
-	_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, volume);
 }
 
 void Sound::playSpeech(const Common::Path &name) {




More information about the Scummvm-git-logs mailing list