mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(sound): add SESound::SetMasterVolume
This commit is contained in:
parent
7838a0fe85
commit
1c7165d73e
@ -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;
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user