[Scummvm-git-logs] scummvm master -> 9acd4999db08f0d0e6cefca04d7ad187504d29a8
whoozle
noreply at scummvm.org
Sun Mar 8 18:12:41 UTC 2026
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
a708dc0c68 PHOENIXVR: remove setCurrentMusic, pass sound type to mixer instead
9acd4999db PHOENIXVR: implement syncSoundSettings
Commit: a708dc0c68493c70e546bdecbf466dc31cb9686e
https://github.com/scummvm/scummvm/commit/a708dc0c68493c70e546bdecbf466dc31cb9686e
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2026-03-08T18:07:25Z
Commit Message:
PHOENIXVR: remove setCurrentMusic, pass sound type to mixer instead
Changed paths:
engines/phoenixvr/commands.h
engines/phoenixvr/phoenixvr.cpp
engines/phoenixvr/phoenixvr.h
diff --git a/engines/phoenixvr/commands.h b/engines/phoenixvr/commands.h
index 40187dbd775..d3bdc3f8b70 100644
--- a/engines/phoenixvr/commands.h
+++ b/engines/phoenixvr/commands.h
@@ -843,21 +843,17 @@ struct PlaySound : public Script::Command {
Common::String sound;
int volume;
int loops;
+ Audio::Mixer::SoundType type;
- PlaySound(Common::String s, int v, int l) : sound(Common::move(s)), volume(v), loops(l) {}
+ PlaySound(Common::String s, int v, int l, Audio::Mixer::SoundType t = Audio::Mixer::kSFXSoundType) : sound(Common::move(s)), volume(v), loops(l), type(t) {}
void exec(Script::ExecutionContext &ctx) const override {
- g_engine->playSound(sound, volume, loops);
+ g_engine->playSound(sound, type, volume, loops);
}
};
struct PlayMusique : public PlaySound {
- PlayMusique(Common::String s, int v) : PlaySound(Common::move(s), v, -1) {}
-
- void exec(Script::ExecutionContext &ctx) const override {
- g_engine->setCurrentMusic(sound, volume);
- PlaySound::exec(ctx);
- }
+ PlayMusique(Common::String s, int v) : PlaySound(Common::move(s), v, -1, Audio::Mixer::kMusicSoundType) {}
};
struct StopSound : public Script::Command {
@@ -879,7 +875,7 @@ struct PlaySound3D : public Script::Command {
PlaySound3D(Common::String s, int v, float a, int l) : sound(Common::move(s)), volume(v), angle(a), loops(l) {}
void exec(Script::ExecutionContext &ctx) const override {
- g_engine->playSound(sound, volume, loops, true, angle);
+ g_engine->playSound(sound, Audio::Mixer::kSFXSoundType, volume, loops, true, angle);
}
};
diff --git a/engines/phoenixvr/phoenixvr.cpp b/engines/phoenixvr/phoenixvr.cpp
index 57f3e25bdc5..36558efe107 100644
--- a/engines/phoenixvr/phoenixvr.cpp
+++ b/engines/phoenixvr/phoenixvr.cpp
@@ -305,8 +305,9 @@ int PhoenixVREngine::getVariable(const Common::String &name) const {
return _variables.getVal(name);
}
-void PhoenixVREngine::playSound(const Common::String &sound, uint8 volume, int loops, bool spatial, float angle) {
- debug("play sound %s %d %d 3d: %d, angle: %g", sound.c_str(), volume, loops, spatial, angle);
+void PhoenixVREngine::playSound(const Common::String &sound, Audio::Mixer::SoundType type, uint8 volume, int loops, bool spatial, float angle) {
+ const bool music = type == Audio::Mixer::kMusicSoundType;
+ debug("play sound %s %d %d, music: %d, 3d: %d, angle: %g", sound.c_str(), volume, loops, music, spatial, angle);
Audio::SoundHandle h;
Common::ScopedPtr<Common::SeekableReadStream> stream(open(sound));
if (!stream) {
@@ -314,8 +315,13 @@ void PhoenixVREngine::playSound(const Common::String &sound, uint8 volume, int l
return;
}
- _mixer->playStream(Audio::Mixer::kPlainSoundType, &h, Audio::makeWAVStream(stream.release(), DisposeAfterUse::YES), -1, volume);
- if (loops < 0)
+ if (music) {
+ _currentMusic = sound;
+ _currentMusicVolume = volume;
+ }
+
+ _mixer->playStream(type, &h, Audio::makeWAVStream(stream.release(), DisposeAfterUse::YES), -1, volume);
+ if (loops < 0 || music)
_mixer->loopChannel(h);
_sounds[sound] = Sound{h, spatial, angle, volume, loops};
}
@@ -1090,7 +1096,7 @@ bool PhoenixVREngine::enterScript() {
_currentMusicVolume = ms.readUint32LE();
debug("current music %s, volume: %u", _currentMusic.c_str(), _currentMusicVolume);
if (!_currentMusic.empty() && _currentMusicVolume > 0)
- playSound(_currentMusic, _currentMusicVolume, -1);
+ playSound(_currentMusic, Audio::Mixer::kMusicSoundType, _currentMusicVolume, -1);
// sound samples
for (uint i = 0; i != 8; ++i) {
@@ -1099,7 +1105,7 @@ bool PhoenixVREngine::enterScript() {
auto flags = ms.readUint32LE();
debug("sound: %s vol: %u flags: %u", name.c_str(), vol, flags);
if (!name.empty())
- playSound(name, vol, -1);
+ playSound(name, Audio::Mixer::kSFXSoundType, vol, -1);
}
// sound samples 3D
@@ -1110,7 +1116,7 @@ bool PhoenixVREngine::enterScript() {
auto flags = ms.readUint32LE();
debug("3d sound: %s vol: %u flags: %u angle: %u", name.c_str(), vol, flags, angle);
if (!name.empty())
- playSound(name, vol, -1, true, static_cast<float>(angle) * kPi);
+ playSound(name, Audio::Mixer::kSFXSoundType, vol, -1, true, static_cast<float>(angle) * kPi);
}
_loadedState.clear();
return true;
diff --git a/engines/phoenixvr/phoenixvr.h b/engines/phoenixvr/phoenixvr.h
index 35377f49555..9fb3b388c3d 100644
--- a/engines/phoenixvr/phoenixvr.h
+++ b/engines/phoenixvr/phoenixvr.h
@@ -115,13 +115,9 @@ public:
void setCursor(const Common::String &path, const Common::String &warp, int idx);
void hideCursor(const Common::String &warp, int idx);
- void playSound(const Common::String &sound, uint8 volume, int loops, bool spatial = false, float angle = 0);
+ void playSound(const Common::String &sound, Audio::Mixer::SoundType type, uint8 volume, int loops, bool spatial = false, float angle = 0);
void stopSound(const Common::String &sound);
void playMovie(const Common::String &movie);
- void setCurrentMusic(const Common::String &name, int volume) {
- _currentMusic = name;
- _currentMusicVolume = volume;
- }
void declareVariable(const Common::String &name);
void setVariable(const Common::String &name, int value);
Commit: 9acd4999db08f0d0e6cefca04d7ad187504d29a8
https://github.com/scummvm/scummvm/commit/9acd4999db08f0d0e6cefca04d7ad187504d29a8
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2026-03-08T18:12:16Z
Commit Message:
PHOENIXVR: implement syncSoundSettings
Changed paths:
engines/phoenixvr/phoenixvr.cpp
engines/phoenixvr/phoenixvr.h
diff --git a/engines/phoenixvr/phoenixvr.cpp b/engines/phoenixvr/phoenixvr.cpp
index 36558efe107..4b9664f7950 100644
--- a/engines/phoenixvr/phoenixvr.cpp
+++ b/engines/phoenixvr/phoenixvr.cpp
@@ -1220,4 +1220,16 @@ void PhoenixVREngine::drawSlot(int idx, int face, int x, int y) {
delete src;
}
+void PhoenixVREngine::syncSoundSettings() {
+ int musicVolume = ConfMan.getInt("music_volume");
+ int sfxVolume = ConfMan.getInt("sfx_volume");
+ debug("syncSoundSettings, music: %d, sfx: %d", musicVolume, sfxVolume);
+ bool muted = false;
+ if (ConfMan.hasKey("mute")) {
+ muted = ConfMan.getBool("mute");
+ }
+ _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, muted ? 0 : musicVolume);
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, muted ? 0 : sfxVolume);
+}
+
} // End of namespace PhoenixVR
diff --git a/engines/phoenixvr/phoenixvr.h b/engines/phoenixvr/phoenixvr.h
index 9fb3b388c3d..77a0d9d648e 100644
--- a/engines/phoenixvr/phoenixvr.h
+++ b/engines/phoenixvr/phoenixvr.h
@@ -107,6 +107,8 @@ public:
return false;
}
+ void syncSoundSettings() override;
+
// Script API
void setNextScript(const Common::String &path);
void goToWarp(const Common::String &warp, bool savePrev = false);
More information about the Scummvm-git-logs
mailing list