feat(sound): add SESound::GetChannelGroupVolume

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

View File

@ -225,6 +225,24 @@ SEChannelGroup* SESound::GetChannelGroup(const char* name, bool create, bool cre
return nullptr; return nullptr;
} }
float SESound::GetChannelGroupVolume(const char* name) {
if (!SESound::s_Initialized) {
return 0.0f;
}
if (!name) {
return 0.0f;
}
auto channelGroup = SESound::GetChannelGroup(name, false, false);
if (!channelGroup) {
return 0.0f;
}
return channelGroup->m_volume * channelGroup->m_muteVolume;
}
int32_t SESound::Heartbeat(const void* data, void* param) { int32_t SESound::Heartbeat(const void* data, void* param) {
if (!SESound::s_Initialized) { if (!SESound::s_Initialized) {
SESound::s_pGameSystem->update(); SESound::s_pGameSystem->update();

View File

@ -32,6 +32,7 @@ class SESound {
// Public static functions // Public static functions
static FMOD::SoundGroup* CreateSoundGroup(const char* name, int32_t maxAudible); static FMOD::SoundGroup* CreateSoundGroup(const char* name, int32_t maxAudible);
static SEChannelGroup* GetChannelGroup(const char* name, bool create, bool createInMaster); static SEChannelGroup* GetChannelGroup(const char* name, bool create, bool createInMaster);
static float GetChannelGroupVolume(const char* name);
static int32_t Heartbeat(const void* data, void* param); static int32_t Heartbeat(const void* data, void* param);
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();