diff --git a/src/sound/SESound.cpp b/src/sound/SESound.cpp index 3f0e4ad..bce4883 100644 --- a/src/sound/SESound.cpp +++ b/src/sound/SESound.cpp @@ -715,6 +715,20 @@ void SESound::SetChannelGroupVolume(const char* name, float volume) { channelGroup->m_dirty = true; } +void SESound::SetMasterVolume(float volume) { + if (!SESound::s_Initialized) { + return; + } + + if (volume < 0.0f || volume > 1.0f) { + return; + } + + auto masterChannelGroup = &SESound::s_ChannelGroups[0]; + masterChannelGroup->m_volume = volume; + masterChannelGroup->m_dirty = true; +} + void SESound::CompleteLoad() { if (!this->m_internal) { return; diff --git a/src/sound/SESound.hpp b/src/sound/SESound.hpp index 344f8ea..06b3725 100644 --- a/src/sound/SESound.hpp +++ b/src/sound/SESound.hpp @@ -39,6 +39,7 @@ class SESound { static void Log_Write(int32_t line, const char* file, FMOD_RESULT result, const char* fmt, ...); static void MuteChannelGroup(const char* name, bool mute); static void SetChannelGroupVolume(const char* name, float volume); + static void SetMasterVolume(float volume); // Public member functions void CompleteLoad();