feat(sound): add SESound::SetChannelGroupVolume

This commit is contained in:
fallenoak 2025-11-29 11:59:11 -06:00
parent 87a8f7cdc5
commit d5cebf9a02
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 19 additions and 0 deletions

View File

@ -590,6 +590,24 @@ void SESound::ProcessReadyDiskSounds() {
} }
} }
void SESound::SetChannelGroupVolume(const char* name, float volume) {
if (!SESound::s_Initialized) {
return;
}
if (volume < 0.0f || volume > 1.0f) {
return;
}
if (!name) {
return;
}
auto channelGroup = SESound::GetChannelGroup(name, true, true);
channelGroup->m_volume = volume;
channelGroup->m_dirty = true;
}
void SESound::CompleteLoad() { void SESound::CompleteLoad() {
if (!this->m_internal) { if (!this->m_internal) {
return; return;

View File

@ -37,6 +37,7 @@ class SESound {
static void Init(int32_t maxChannels, int32_t (*a2), int32_t enableReverb, int32_t enableSoftwareHRTF, int32_t* numChannels, int32_t* outputDriverIndex, const char* outputDriverName, void (*a8), int32_t a9); static void Init(int32_t maxChannels, int32_t (*a2), int32_t enableReverb, int32_t enableSoftwareHRTF, int32_t* numChannels, int32_t* outputDriverIndex, const char* outputDriverName, void (*a8), int32_t a9);
static int32_t IsInitialized(); static int32_t IsInitialized();
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 SetChannelGroupVolume(const char* name, float volume);
// Public member functions // Public member functions
void CompleteLoad(); void CompleteLoad();