feat(sound): add SESound::SetMasterVolume

This commit is contained in:
fallenoak 2025-11-29 19:36:04 -06:00
parent 7838a0fe85
commit 1c7165d73e
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 15 additions and 0 deletions

View File

@ -715,6 +715,20 @@ void SESound::SetChannelGroupVolume(const char* name, float volume) {
channelGroup->m_dirty = true; 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() { void SESound::CompleteLoad() {
if (!this->m_internal) { if (!this->m_internal) {
return; return;

View File

@ -39,6 +39,7 @@ class SESound {
static void Log_Write(int32_t line, const char* file, FMOD_RESULT result, const char* fmt, ...); 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 MuteChannelGroup(const char* name, bool mute);
static void SetChannelGroupVolume(const char* name, float volume); static void SetChannelGroupVolume(const char* name, float volume);
static void SetMasterVolume(float volume);
// Public member functions // Public member functions
void CompleteLoad(); void CompleteLoad();