void audio_update_volume(bool force_update) { static LLCachedControl<F32> AudioLevelMaster(gSavedSettings,"AudioLevelMaster"); F32 master_volume = AudioLevelMaster; static LLCachedControl<bool> MuteAudio(gSavedSettings,"MuteAudio"); BOOL mute_audio = MuteAudio; static LLCachedControl<bool> MuteWhenMinimized(gSavedSettings,"MuteWhenMinimized"); if (!gViewerWindow->getActive() && MuteWhenMinimized) { mute_audio = TRUE; } F32 mute_volume = mute_audio ? 0.0f : 1.0f; // Sound Effects if (gAudiop) { gAudiop->setMasterGain ( master_volume ); static LLCachedControl<F32> AudioLevelDoppler(gSavedSettings,"AudioLevelDoppler"); gAudiop->setDopplerFactor((F32)AudioLevelDoppler); static LLCachedControl<F32> AudioLevelRolloff(gSavedSettings,"AudioLevelRolloff"); gAudiop->setRolloffFactor((F32)AudioLevelRolloff); #ifdef kAUDIO_ENABLE_WIND gAudiop->enableWind(!mute_audio); #endif gAudiop->setMuted(mute_audio); if (force_update) { audio_update_wind(true); } // handle secondary gains static LLCachedControl<bool> MuteSounds(gSavedSettings,"MuteSounds"); static LLCachedControl<F32> AudioLevelSFX(gSavedSettings,"AudioLevelSFX"); gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_SFX, MuteSounds ? 0.f : AudioLevelSFX); static LLCachedControl<bool> MuteUI(gSavedSettings,"MuteUI"); static LLCachedControl<F32> AudioLevelUI(gSavedSettings,"AudioLevelUI"); gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_UI, MuteUI ? 0.f : AudioLevelUI); static LLCachedControl<bool> MuteAmbient(gSavedSettings,"MuteAmbient"); static LLCachedControl<F32> AudioLevelAmbient(gSavedSettings,"AudioLevelAmbient"); gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_AMBIENT, MuteAmbient ? 0.f : AudioLevelAmbient); } // Streaming Music if (gAudiop) { static LLCachedControl<bool> MuteMusic(gSavedSettings,"MuteMusic"); static LLCachedControl<F32> AudioLevelMusic(gSavedSettings,"AudioLevelMusic"); F32 music_volume = AudioLevelMusic; BOOL music_muted = MuteMusic; music_volume = mute_volume * master_volume * music_volume; gAudiop->setInternetStreamGain ( music_muted ? 0.f : music_volume ); } // Streaming Media static LLCachedControl<bool> MuteMedia(gSavedSettings,"MuteMedia"); static LLCachedControl<F32> AudioLevelMedia(gSavedSettings,"AudioLevelMedia"); F32 media_volume = AudioLevelMedia; BOOL media_muted = MuteMedia; media_volume = mute_volume * master_volume * media_volume; LLViewerMedia::setVolume( media_muted ? 0.0f : media_volume ); // Voice if (LLVoiceClient::getInstance()) { static LLCachedControl<bool> MuteVoice(gSavedSettings,"MuteVoice"); static LLCachedControl<F32> AudioLevelVoice(gSavedSettings,"AudioLevelVoice"); F32 voice_volume = AudioLevelVoice; voice_volume = mute_volume * master_volume * voice_volume; BOOL voice_mute = MuteVoice; LLVoiceClient::getInstance()->setVoiceVolume(voice_mute ? 0.f : voice_volume); static LLCachedControl<bool> MuteWhenMinimized(gSavedSettings,"MuteWhenMinimized"); static LLCachedControl<F32> AudioLevelMic(gSavedSettings,"AudioLevelMic"); LLVoiceClient::getInstance()->setMicGain(voice_mute ? 0.f : AudioLevelMic); if (!gViewerWindow->getActive() && MuteWhenMinimized) { LLVoiceClient::getInstance()->setMuteMic(true); } else { LLVoiceClient::getInstance()->setMuteMic(false); } } }
void audio_update_volume(bool force_update) { static const LLCachedControl<F32> master_volume("AudioLevelMaster",1.0); static const LLCachedControl<F32> audio_level_sfx("AudioLevelSFX",1.0); static const LLCachedControl<F32> audio_level_ui("AudioLevelUI",1.0); static const LLCachedControl<F32> audio_level_ambient("AudioLevelAmbient",1.0); static const LLCachedControl<F32> audio_level_music("AudioLevelMusic",1.0); static const LLCachedControl<F32> audio_level_media("AudioLevelMedia",1.0); static const LLCachedControl<F32> audio_level_voice("AudioLevelVoice",1.0); static const LLCachedControl<F32> audio_level_mic("AudioLevelMic",1.0); static const LLCachedControl<bool> _mute_audio("MuteAudio",false); static const LLCachedControl<bool> mute_sounds("MuteSounds",false); static const LLCachedControl<bool> mute_ui("MuteUI",false); static const LLCachedControl<bool> mute_ambient("MuteAmbient",false); static const LLCachedControl<bool> mute_music("MuteMusic",false); static const LLCachedControl<bool> mute_media("MuteMedia",false); static const LLCachedControl<bool> mute_voice("MuteVoice",false); static const LLCachedControl<bool> mute_when_minimized("MuteWhenMinimized",true); static const LLCachedControl<F32> audio_level_doppler("AudioLevelDoppler",1.0); static const LLCachedControl<F32> audio_level_rolloff("AudioLevelRolloff",1.0); BOOL mute_audio = _mute_audio; if (!gViewerWindow->getActive() && mute_when_minimized) { mute_audio = TRUE; } F32 mute_volume = mute_audio ? 0.0f : 1.0f; // Sound Effects if (gAudiop) { gAudiop->setMasterGain ( master_volume ); gAudiop->setDopplerFactor(audio_level_doppler); gAudiop->setRolloffFactor(audio_level_rolloff); gAudiop->setMuted(mute_audio); if (force_update) { audio_update_wind(true); } // handle secondary gains gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_SFX, mute_sounds ? 0.f : audio_level_sfx); gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_UI, mute_ui ? 0.f : audio_level_ui); gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_AMBIENT, mute_ambient ? 0.f : audio_level_ambient); } // Streaming Music if (gAudiop) { F32 music_volume = mute_volume * master_volume * (audio_level_music*audio_level_music); gAudiop->setInternetStreamGain ( mute_music ? 0.f : music_volume ); } // Streaming Media F32 media_volume = mute_volume * master_volume * (audio_level_media*audio_level_media); LLViewerMedia::setVolume( mute_media ? 0.0f : media_volume ); // Voice if (gVoiceClient) { F32 voice_volume = mute_volume * master_volume * audio_level_voice; gVoiceClient->setVoiceVolume(mute_voice ? 0.f : voice_volume); gVoiceClient->setMicGain(mute_voice ? 0.f : audio_level_mic); if (!gViewerWindow->getActive() && mute_when_minimized) { gVoiceClient->setMuteMic(true); } else { gVoiceClient->setMuteMic(false); } } }
void audio_update_volume(bool force_update) { F32 master_volume = gSavedSettings.getF32("AudioLevelMaster"); BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) { mute_audio = TRUE; } F32 mute_volume = mute_audio ? 0.0f : 1.0f; // Sound Effects if (gAudiop) { gAudiop->setMasterGain ( master_volume ); gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler")); gAudiop->setDistanceFactor(gSavedSettings.getF32("AudioLevelDistance")); gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); #ifdef kAUDIO_ENABLE_WIND gAudiop->enableWind(!mute_audio); #endif gAudiop->setMuted(mute_audio); if (force_update) { audio_update_wind(true); } } // Streaming Music if (gAudiop) { F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); music_volume = mute_volume * master_volume * (music_volume*music_volume); gAudiop->setInternetStreamGain ( music_muted ? 0.f : music_volume ); } // Streaming Media F32 media_volume = gSavedSettings.getF32("AudioLevelMedia"); BOOL media_muted = gSavedSettings.getBOOL("MuteMedia"); media_volume = mute_volume * master_volume * (media_volume*media_volume); LLViewerMedia::setVolume( media_muted ? 0.0f : media_volume ); // Voice if (gVoiceClient) { F32 voice_volume = gSavedSettings.getF32("AudioLevelVoice"); voice_volume = mute_volume * master_volume * voice_volume; BOOL voice_mute = gSavedSettings.getBOOL("MuteVoice"); gVoiceClient->setVoiceVolume(voice_mute ? 0.f : voice_volume); gVoiceClient->setMicGain(voice_mute ? 0.f : gSavedSettings.getF32("AudioLevelMic")); if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) { gVoiceClient->setMuteMic(true); } else { gVoiceClient->setMuteMic(false); } } }
void audio_update_volume(bool force_update) { F32 master_volume = gSavedSettings.getF32("AudioLevelMaster"); BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) { mute_audio = TRUE; } F32 mute_volume = mute_audio ? 0.0f : 1.0f; // Sound Effects if (gAudiop) { gAudiop->setMasterGain ( master_volume ); gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler")); gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); gAudiop->setMuted(mute_audio); BOOL mute_ambiant = gSavedSettings.getBOOL("MuteAmbient"); #ifdef kAUDIO_ENABLE_WIND gAudiop->enableWind(!mute_audio && !mute_ambiant && !gSavedSettings.getBOOL("DisableWindAudio") && master_volume * gSavedSettings.getF32("AudioLevelAmbient") > 0.05f); #endif if (force_update) { audio_update_wind(true); } // handle secondary gains gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_SFX, gSavedSettings.getBOOL("MuteSounds") ? 0.f : gSavedSettings.getF32("AudioLevelSFX")); gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_UI, gSavedSettings.getBOOL("MuteUI") ? 0.f : gSavedSettings.getF32("AudioLevelUI")); gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_AMBIENT, mute_ambiant ? 0.f : gSavedSettings.getF32("AudioLevelAmbient")); gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_GESTURE, gSavedSettings.getBOOL("MuteGestures") ? 0.f : gSavedSettings.getF32("AudioLevelGestures")); } // Streaming Music if (gAudiop) { F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); music_volume = mute_volume * master_volume * (music_volume*music_volume); gAudiop->setInternetStreamGain ( music_muted ? 0.f : music_volume ); } // Streaming Media F32 media_volume = gSavedSettings.getF32("AudioLevelMedia"); BOOL media_muted = gSavedSettings.getBOOL("MuteMedia"); media_volume = mute_volume * master_volume * (media_volume*media_volume); LLViewerMedia::setVolume( media_muted ? 0.0f : media_volume ); // Voice // Disable voice options in the gui. Leaving here in case InWorldz decides to get voice -- MC /*if (gVoiceClient) { F32 voice_volume = gSavedSettings.getF32("AudioLevelVoice"); voice_volume = mute_volume * master_volume * voice_volume; BOOL voice_mute = gSavedSettings.getBOOL("MuteVoice"); gVoiceClient->setVoiceVolume(voice_mute ? 0.f : voice_volume); gVoiceClient->setMicGain(voice_mute ? 0.f : gSavedSettings.getF32("AudioLevelMic")); if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) { gVoiceClient->setMuteMic(true); } else { gVoiceClient->setMuteMic(false); } }*/ }
void audio_update_volume(bool force_update) { F32 master_volume = gSavedSettings.getF32("AudioLevelMaster"); BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); LLProgressView* progress = gViewerWindow->getProgressView(); BOOL progress_view_visible = FALSE; if (progress) { progress_view_visible = progress->getVisible(); } if (!gViewerWindow->getActive() && gSavedSettings.getBOOL("MuteWhenMinimized")) { mute_audio = TRUE; } F32 mute_volume = mute_audio ? 0.0f : 1.0f; // Sound Effects if (gAudiop) { gAudiop->setMasterGain ( master_volume ); gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler")); gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); gAudiop->setMuted(mute_audio || progress_view_visible); if (force_update) { audio_update_wind(true); } // handle secondary gains // <FS:Ansariel> Use faster LLCachedControls for frequently visited locations //gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_SFX, // gSavedSettings.getBOOL("MuteSounds") ? 0.f : gSavedSettings.getF32("AudioLevelSFX")); //gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_UI, // gSavedSettings.getBOOL("MuteUI") ? 0.f : gSavedSettings.getF32("AudioLevelUI")); //gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_AMBIENT, // gSavedSettings.getBOOL("MuteAmbient") ? 0.f : gSavedSettings.getF32("AudioLevelAmbient")); static LLCachedControl<bool> muteSounds(gSavedSettings, "MuteSounds"); static LLCachedControl<bool> muteUI(gSavedSettings, "MuteUI"); static LLCachedControl<bool> muteAmbient(gSavedSettings, "MuteAmbient"); static LLCachedControl<F32> audioLevelSFX(gSavedSettings, "AudioLevelSFX"); static LLCachedControl<F32> audioLevelUI(gSavedSettings, "AudioLevelUI"); static LLCachedControl<F32> audioLevelAmbient(gSavedSettings, "AudioLevelAmbient"); gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_SFX, muteSounds ? 0.f : (F32)audioLevelSFX); gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_UI, muteUI ? 0.f : (F32)audioLevelUI); gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_AMBIENT, muteAmbient ? 0.f : (F32)audioLevelAmbient); // <FS:Ansariel> } // Streaming Music if (gAudiop) { if (!progress_view_visible && LLViewerAudio::getInstance()->getForcedTeleportFade()) { LLViewerAudio::getInstance()->setWasPlaying(!gAudiop->getInternetStreamURL().empty()); LLViewerAudio::getInstance()->setForcedTeleportFade(false); } // <FS:Ansariel> Use faster LLCachedControls for frequently visited locations //F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); //BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); static LLCachedControl<F32> audioLevelMusic(gSavedSettings, "AudioLevelMusic"); static LLCachedControl<bool> muteMusic(gSavedSettings, "MuteMusic"); F32 music_volume = (F32)audioLevelMusic; BOOL music_muted = (BOOL)muteMusic; // </FS:Ansariel> F32 fade_volume = LLViewerAudio::getInstance()->getFadeVolume(); music_volume = mute_volume * master_volume * music_volume * fade_volume; gAudiop->setInternetStreamGain (music_muted ? 0.f : music_volume); } // Streaming Media // <FS:Ansariel> Use faster LLCachedControls for frequently visited locations //F32 media_volume = gSavedSettings.getF32("AudioLevelMedia"); //BOOL media_muted = gSavedSettings.getBOOL("MuteMedia"); static LLCachedControl<F32> audioLevelMedia(gSavedSettings, "AudioLevelMedia"); static LLCachedControl<bool> muteMedia(gSavedSettings, "MuteMedia"); F32 media_volume = (F32)audioLevelMedia; BOOL media_muted = (BOOL)muteMedia; // </FS:Ansariel> media_volume = mute_volume * master_volume * media_volume; LLViewerMedia::setVolume( media_muted ? 0.0f : media_volume ); // Voice if (LLVoiceClient::getInstance()) { // <FS:Ansariel> Use faster LLCachedControls for frequently visited locations //F32 voice_volume = gSavedSettings.getF32("AudioLevelVoice"); static LLCachedControl<F32> audioLevelVoice(gSavedSettings, "AudioLevelVoice"); F32 voice_volume = (F32)audioLevelVoice; // </FS:Ansariel> voice_volume = mute_volume * master_volume * voice_volume; // <FS:Ansariel> Use faster LLCachedControls for frequently visited locations //BOOL voice_mute = gSavedSettings.getBOOL("MuteVoice"); static LLCachedControl<bool> muteVoice(gSavedSettings, "MuteVoice"); BOOL voice_mute = (BOOL)muteVoice; // </FS:Ansariel> LLVoiceClient::getInstance()->setVoiceVolume(voice_mute ? 0.f : voice_volume); // <FS:Ansariel> Use faster LLCachedControls for frequently visited locations //LLVoiceClient::getInstance()->setMicGain(voice_mute ? 0.f : gSavedSettings.getF32("AudioLevelMic")); static LLCachedControl<F32> audioLevelMic(gSavedSettings, "AudioLevelMic"); LLVoiceClient::getInstance()->setMicGain(voice_mute ? 0.f : (F32)audioLevelMic); // </FS:Ansariel> // <FS:Ansariel> Use faster LLCachedControls for frequently visited locations //if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) static LLCachedControl<bool> muteWhenMinimized(gSavedSettings, "MuteWhenMinimized"); if (!gViewerWindow->getActive() && muteWhenMinimized) // </FS:Ansariel> { LLVoiceClient::getInstance()->setMuteMic(true); } else { LLVoiceClient::getInstance()->setMuteMic(false); } } }
void audio_update_volume(bool force_update) { F32 master_volume = gSavedSettings.getF32("AudioLevelMaster"); BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); LLProgressView* progress = gViewerWindow->getProgressView(); BOOL progress_view_visible = FALSE; if (progress) { progress_view_visible = progress->getVisible(); } if (!gViewerWindow->getActive() && gSavedSettings.getBOOL("MuteWhenMinimized")) { mute_audio = TRUE; } F32 mute_volume = mute_audio ? 0.0f : 1.0f; // Sound Effects if (gAudiop) { gAudiop->setMasterGain ( master_volume ); gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler")); gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); gAudiop->setMuted(mute_audio || progress_view_visible); if (force_update) { audio_update_wind(true); } // handle secondary gains gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_SFX, gSavedSettings.getBOOL("MuteSounds") ? 0.f : gSavedSettings.getF32("AudioLevelSFX")); gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_UI, gSavedSettings.getBOOL("MuteUI") ? 0.f : gSavedSettings.getF32("AudioLevelUI")); gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_AMBIENT, gSavedSettings.getBOOL("MuteAmbient") ? 0.f : gSavedSettings.getF32("AudioLevelAmbient")); } // Streaming Music if (gAudiop) { if (progress_view_visible && !LLViewerAudio::getInstance()->getForcedTeleportFade()) { LLViewerAudio::getInstance()->setForcedTeleportFade(true); LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); LLViewerAudio::getInstance()->setNextStreamURI(LLStringUtil::null); } if (!progress_view_visible && LLViewerAudio::getInstance()->getForcedTeleportFade() == true) { LLViewerAudio::getInstance()->setForcedTeleportFade(false); } F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); F32 fade_volume = LLViewerAudio::getInstance()->getFadeVolume(); music_volume = mute_volume * master_volume * music_volume * fade_volume; gAudiop->setInternetStreamGain (music_muted ? 0.f : music_volume); } // Streaming Media F32 media_volume = gSavedSettings.getF32("AudioLevelMedia"); BOOL media_muted = gSavedSettings.getBOOL("MuteMedia"); media_volume = mute_volume * master_volume * media_volume; LLViewerMedia::setVolume( media_muted ? 0.0f : media_volume ); // Voice if (LLVoiceClient::getInstance()) { F32 voice_volume = gSavedSettings.getF32("AudioLevelVoice"); voice_volume = mute_volume * master_volume * voice_volume; BOOL voice_mute = gSavedSettings.getBOOL("MuteVoice"); LLVoiceClient::getInstance()->setVoiceVolume(voice_mute ? 0.f : voice_volume); LLVoiceClient::getInstance()->setMicGain(voice_mute ? 0.f : gSavedSettings.getF32("AudioLevelMic")); if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) { LLVoiceClient::getInstance()->setMuteMic(true); } else { LLVoiceClient::getInstance()->setMuteMic(false); } } }