mirror of
https://github.com/whoahq/whoa.git
synced 2026-11-05 22:29:53 +03:00
feat(sound): add SESound::SetMasterVolume
This commit is contained in:
2 files changed
+15
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user