[Scummvm-git-logs] scummvm master -> 012921309c309ef7f9759fb76cd4a355954ee0f0

mduggan noreply at scummvm.org
Fri Nov 14 10:02:24 UTC 2025


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:
012921309c ACCESS: Sync volume after main menu opened


Commit: 012921309c309ef7f9759fb76cd4a355954ee0f0
    https://github.com/scummvm/scummvm/commit/012921309c309ef7f9759fb76cd4a355954ee0f0
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2025-11-14T21:01:37+11:00

Commit Message:
ACCESS: Sync volume after main menu opened

Changed paths:
    engines/access/access.cpp
    engines/access/access.h
    engines/access/sound.cpp
    engines/access/sound.h


diff --git a/engines/access/access.cpp b/engines/access/access.cpp
index ec84c73fbe0..7f38e465ec8 100644
--- a/engines/access/access.cpp
+++ b/engines/access/access.cpp
@@ -191,6 +191,8 @@ void AccessEngine::initialize() {
 	_midi = new MusicManager(this);
 	_video = new VideoPlayer(this);
 
+	syncSoundSettings();
+
 	setDebugger(Debugger::init(this));
 	_buffer1.create(g_system->getWidth() + TILE_WIDTH, g_system->getHeight());
 	_buffer2.create(g_system->getWidth(), g_system->getHeight());
@@ -462,6 +464,12 @@ void AccessEngine::freeChar() {
 	_player->freeSprites();
 }
 
+void AccessEngine::syncSoundSettings() {
+	Engine::syncSoundSettings();
+	_midi->syncVolume();
+	_sound->syncVolume();
+}
+
 Common::Error AccessEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
 	Common::OutSaveFile *out = g_system->getSavefileManager()->openForSaving(
 		getSaveStateName(slot));
diff --git a/engines/access/access.h b/engines/access/access.h
index da8c234c358..b9e8aa47a5d 100644
--- a/engines/access/access.h
+++ b/engines/access/access.h
@@ -328,6 +328,8 @@ public:
 	void printText(BaseSurface *s, const Common::String &msg);
 	void speakText(BaseSurface *s, const Common::String &msg);
 
+	void syncSoundSettings() override;
+
 	/**
 	 * Load a savegame
 	 */
diff --git a/engines/access/sound.cpp b/engines/access/sound.cpp
index 7b412aa827b..b95963f6d38 100644
--- a/engines/access/sound.cpp
+++ b/engines/access/sound.cpp
@@ -187,6 +187,11 @@ bool SoundManager::isSFXPlaying() {
 	return _mixer->isSoundHandleActive(*_effectsHandle);
 }
 
+void SoundManager::syncVolume() {
+	int sfxVol = CLIP(ConfMan.getInt("sfx_volume"), 0, 255);
+	_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, sfxVol);
+}
+
 void SoundManager::loadSounds(const Common::Array<RoomInfo::SoundIdent> &sounds) {
 	debugC(1, kDebugSound, "loadSounds");
 
@@ -316,7 +321,7 @@ void MusicManager::midiPlay() {
 		_parser->setMidiDriver(this);
 		_parser->setTimerRate(_driver->getBaseTempo());
 		_parser->property(MidiParser::mpAutoLoop, _isLooping);
-		setVolume(127);
+		syncVolume();
 		_isPlaying = true;
 	} else if (magic == MKTAG('F', 'O', 'R', 'M')) {
 		_parser = MidiParser::createParser_XMIDI();
@@ -332,8 +337,7 @@ void MusicManager::midiPlay() {
 
 		// Handle music looping
 		_parser->property(MidiParser::mpAutoLoop, _isLooping);
-
-		setVolume(127);
+		syncVolume();
 		_isPlaying = true;
 	} else {
 		warning("midiPlay() Unexpected signature 0x%08x, expected 'FORM'", magic);
diff --git a/engines/access/sound.h b/engines/access/sound.h
index d41a45b7029..190fef28afb 100644
--- a/engines/access/sound.h
+++ b/engines/access/sound.h
@@ -78,6 +78,7 @@ public:
 
 	Resource *loadSound(int fileNum, int subfile);
 	void loadSounds(const Common::Array<RoomInfo::SoundIdent> &sounds);
+	void syncVolume();
 
 	void stopSound();
 	void freeSounds();




More information about the Scummvm-git-logs mailing list