[Scummvm-git-logs] scummvm master -> 1f635b961e9f73a2f3056d48231bcbc145be3a50

sev- noreply at scummvm.org
Thu Jun 1 19:58:32 UTC 2023


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

Summary:
72d890b751 DIRECTOR: Report inactive channel volume as 0
1f635b961e DIRECTOR: Properly return sound volume


Commit: 72d890b751699894334107bba330fe5c957d931b
    https://github.com/scummvm/scummvm/commit/72d890b751699894334107bba330fe5c957d931b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-06-01T21:58:21+02:00

Commit Message:
DIRECTOR: Report inactive channel volume as 0

Changed paths:
    engines/director/sound.cpp


diff --git a/engines/director/sound.cpp b/engines/director/sound.cpp
index ae0d033bc93..9db300d2cf3 100644
--- a/engines/director/sound.cpp
+++ b/engines/director/sound.cpp
@@ -106,6 +106,9 @@ uint8 DirectorSound::getChannelVolume(uint8 soundChannel) {
 	if (!assertChannel(soundChannel))
 		return 0;
 
+	if (!_mixer->isSoundHandleActive(_channels[soundChannel]->handle))
+		return 0;
+
 	return _enable ? _channels[soundChannel]->volume : 0;
 }
 


Commit: 1f635b961e9f73a2f3056d48231bcbc145be3a50
    https://github.com/scummvm/scummvm/commit/1f635b961e9f73a2f3056d48231bcbc145be3a50
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-06-01T21:58:22+02:00

Commit Message:
DIRECTOR: Properly return sound volume

Changed paths:
    engines/director/lingo/lingo-the.cpp
    engines/director/sound.h


diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 28a7fba0145..1e2a1d5be18 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -804,12 +804,7 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
 		{
 			switch (field) {
 			case kTheVolume:
-				{
-					SoundChannel *chan = _vm->getCurrentWindow()->getSoundManager()->getChannel(id.asInt());
-					if (chan) {
-						d = (int)chan->volume;
-					}
-				}
+				d = _vm->getCurrentWindow()->getSoundManager()->getChannelVolume(id.asInt());
 				break;
 			default:
 				warning("Lingo::getTheEntity(): Unprocessed getting field \"%s\" of entity %s", field2str(field), entity2str(entity));
diff --git a/engines/director/sound.h b/engines/director/sound.h
index af41b0357f2..5d1ec9b014d 100644
--- a/engines/director/sound.h
+++ b/engines/director/sound.h
@@ -205,6 +205,7 @@ public:
 	bool fadeChannel(uint8 soundChannel);
 
 	bool isChannelActive(uint8 soundChannel);
+	uint8 getChannelVolume(uint8 soundChannel);
 	void stopSound(uint8 soundChannel);
 	void stopSound();
 
@@ -213,7 +214,6 @@ private:
 	bool isLastPlayedSound(uint8 soundChannel, const SoundID &soundId);
 	bool shouldStopOnZero(uint8 soundChannel);
 
-	uint8 getChannelVolume(uint8 soundChannel);
 	void setSoundLevelInternal(uint8 soundChannel, uint8 soundLevel);
 	bool assertChannel(int soundChannel);
 	void cancelFade(uint8 soundChannel);




More information about the Scummvm-git-logs mailing list