From 3eab42ebd832545d4ba51a39168110859b869370 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Fri, 21 Jun 2024 13:22:12 -0700 Subject: Disable voice morphing and throw up a warning if it's previously enabled. --- indra/newview/llvoiceclient.cpp | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoiceclient.cpp') diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index fb3377e9c0..779f4e3176 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -137,8 +137,9 @@ LLVoiceClient::LLVoiceClient(LLPumpIO *pump) mSpatialVoiceModule(NULL), mNonSpatialVoiceModule(NULL), m_servicePump(NULL), - mVoiceEffectEnabled(LLCachedControl(gSavedSettings, "VoiceMorphingEnabled", true)), + mVoiceEffectEnabled(LLCachedControl(gSavedSettings, "VoiceMorphingEnabled", false)), mVoiceEffectDefault(LLCachedControl(gSavedPerAccountSettings, "VoiceEffectDefault", "00000000-0000-0000-0000-000000000000")), + mVoiceEffectSupportNotified(false), mPTTDirty(true), mPTT(true), mUsePTT(true), @@ -569,11 +570,37 @@ void LLVoiceClient::setMicGain(F32 gain) //------------------------------------------ // enable/disable voice features +// static +bool LLVoiceClient::onVoiceEffectsNotSupported(const LLSD ¬ification, const LLSD &response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + switch (option) + { + case 0: // "Okay" + gSavedSettings.setBOOL("VoiceMorphingEnabled", FALSE); + break; + + case 1: // "Cancel" + break; + + default: + llassert(0); + break; + } + return false; +} + bool LLVoiceClient::voiceEnabled() { static LLCachedControl enable_voice_chat(gSavedSettings, "EnableVoiceChat"); static LLCachedControl cmd_line_disable_voice(gSavedSettings, "CmdLineDisableVoice"); - return enable_voice_chat && !cmd_line_disable_voice && !gNonInteractive; + bool enabled = enable_voice_chat && !cmd_line_disable_voice && !gNonInteractive; + if (enabled && !mVoiceEffectSupportNotified && getVoiceEffectEnabled() && !getVoiceEffectDefault().isNull()) + { + LLNotificationsUtil::add("VoiceEffectsNotSupported", LLSD(), LLSD(), &LLVoiceClient::onVoiceEffectsNotSupported); + mVoiceEffectSupportNotified = true; + } + return enabled; } void LLVoiceClient::setVoiceEnabled(bool enabled) @@ -812,7 +839,7 @@ std::string LLVoiceClient::sipURIFromID(const LLUUID &id) LLVoiceEffectInterface* LLVoiceClient::getVoiceEffectInterface() const { - return getVoiceEffectEnabled() ? dynamic_cast(mSpatialVoiceModule) : NULL; + return NULL; } /////////////////// -- cgit v1.2.3