diff options
author | Brad Linden <46733234+brad-linden@users.noreply.github.com> | 2024-05-06 15:44:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-06 15:44:19 -0700 |
commit | 84827a7cb8d4b7a58309f98c7d4df4cfeb173935 (patch) | |
tree | b91494298eab93bbd8dd9b00722b7a30714a1b9c /indra/newview/llvieweraudio.cpp | |
parent | 76101843c0d390c25a783f212eb1ea75e508ada4 (diff) | |
parent | 8b747cee182cd8e95063fa152d9b5d7383cb1c74 (diff) |
Merge pull request #1413 from secondlife/gltf-dev-maint-a-merge
Merge Maint A to development
Diffstat (limited to 'indra/newview/llvieweraudio.cpp')
-rw-r--r-- | indra/newview/llvieweraudio.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 6a0edbecb1..66184abd37 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -353,9 +353,9 @@ void init_audio() // load up our initial set of sounds we'll want so they're in memory and ready to be played - BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); + bool mute_audio = gSavedSettings.getBOOL("MuteAudio"); - if (!mute_audio && FALSE == gSavedSettings.getBOOL("NoPreload")) + if (!mute_audio && false == gSavedSettings.getBOOL("NoPreload")) { gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndAlert"))); gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndBadKeystroke"))); @@ -396,10 +396,10 @@ void init_audio() void audio_update_volume(bool force_update) { F32 master_volume = gSavedSettings.getF32("AudioLevelMaster"); - BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); + bool mute_audio = gSavedSettings.getBOOL("MuteAudio"); LLProgressView* progress = gViewerWindow->getProgressView(); - BOOL progress_view_visible = FALSE; + bool progress_view_visible = false; if (progress) { @@ -408,7 +408,7 @@ void audio_update_volume(bool force_update) if (!gViewerWindow->getActive() && gSavedSettings.getBOOL("MuteWhenMinimized")) { - mute_audio = TRUE; + mute_audio = true; } F32 mute_volume = mute_audio ? 0.0f : 1.0f; @@ -455,7 +455,7 @@ void audio_update_volume(bool force_update) } F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); - BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); + bool music_muted = gSavedSettings.getBOOL("MuteMusic"); F32 fade_volume = LLViewerAudio::getInstance()->getFadeVolume(); music_volume = mute_volume * master_volume * music_volume * fade_volume; @@ -464,7 +464,7 @@ void audio_update_volume(bool force_update) // Streaming Media F32 media_volume = gSavedSettings.getF32("AudioLevelMedia"); - BOOL media_muted = gSavedSettings.getBOOL("MuteMedia"); + bool media_muted = gSavedSettings.getBOOL("MuteMedia"); media_volume = mute_volume * master_volume * media_volume; LLViewerMedia::getInstance()->setVolume( media_muted ? 0.0f : media_volume ); @@ -473,7 +473,7 @@ void audio_update_volume(bool force_update) { F32 voice_volume = gSavedSettings.getF32("AudioLevelVoice"); voice_volume = mute_volume * master_volume * voice_volume; - BOOL voice_mute = gSavedSettings.getBOOL("MuteVoice"); + bool voice_mute = gSavedSettings.getBOOL("MuteVoice"); LLVoiceClient *voice_inst = LLVoiceClient::getInstance(); voice_inst->setVoiceVolume(voice_mute ? 0.f : voice_volume); voice_inst->setMicGain(voice_mute ? 0.f : gSavedSettings.getF32("AudioLevelMic")); @@ -545,8 +545,13 @@ void audio_update_wind(bool force_update) // don't use the setter setMaxWindGain() because we don't // want to screw up the fade-in on startup by setting actual source gain // outside the fade-in. - F32 master_volume = gSavedSettings.getBOOL("MuteAudio") ? 0.f : gSavedSettings.getF32("AudioLevelMaster"); - F32 ambient_volume = gSavedSettings.getBOOL("MuteAmbient") ? 0.f : gSavedSettings.getF32("AudioLevelAmbient"); + static LLCachedControl<bool> mute_audio(gSavedSettings, "MuteAudio"); + static LLCachedControl<bool> mute_ambient(gSavedSettings, "MuteAmbient"); + static LLCachedControl<F32> level_master(gSavedSettings, "AudioLevelMaster"); + static LLCachedControl<F32> level_ambient(gSavedSettings, "AudioLevelAmbient"); + + F32 master_volume = mute_audio() ? 0.f : level_master(); + F32 ambient_volume = mute_ambient() ? 0.f : level_ambient(); F32 max_wind_volume = master_volume * ambient_volume; const F32 WIND_SOUND_TRANSITION_TIME = 2.f; |