diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6fc721a424..fd45816a79 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -24657,17 +24657,6 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 - VoiceMultiInstance - - Comment - Enables using voice in multiple simultaneous viewer instances - Persist - 1 - Type - Boolean - Value - 1 - FSSoundCacheLocation Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 8eedfbbc88..65c20c78f8 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3473,20 +3473,19 @@ bool LLAppViewer::initConfiguration() return false; } - if (mSecondInstance) - { - // This is the second instance of SL. Turn off voice support, - // but make sure the setting is *not* persisted. - LLControlVariable* disable_voice = gSavedSettings.getControl("CmdLineDisableVoice"); - // Voice in multiple instances; by Latif Khalifa - //if(disable_voice) - if(disable_voice && !gSavedSettings.getBOOL("VoiceMultiInstance")) - // - { - const BOOL DO_NOT_PERSIST = FALSE; - disable_voice->setValue(LLSD(TRUE), DO_NOT_PERSIST); - } - } + // Voice in multiple instances + //if (mSecondInstance) + //{ + // // This is the second instance of SL. Mute voice, + // // but make sure the setting is *not* persisted. + // LLControlVariable* enable_voice = gSavedSettings.getControl("EnableVoiceChat"); + // if(enable_voice) + // { + // const BOOL DO_NOT_PERSIST = FALSE; + // enable_voice->setValue(LLSD(FALSE), DO_NOT_PERSIST); + // } + //} + // gLastRunVersion = gSavedSettings.getString("LastRunVersion"); diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index 9d80382628..f6ccb78f80 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -908,6 +908,15 @@ void LLHUDNameTag::shift(const LLVector3& offset) mPositionAgent += offset; } +F32 LLHUDNameTag::getWorldHeight() const +{ + const LLViewerCamera* camera = LLViewerCamera::getInstance(); + F32 height_meters = mLastDistance * (F32)tan(camera->getView() / 2.f); + F32 height_pixels = camera->getViewHeightInPixels() / 2.f; + F32 meters_per_pixel = height_meters / height_pixels; + return mHeight * meters_per_pixel * gViewerWindow->getDisplayScale().mV[VY]; +} + //static void LLHUDNameTag::addPickable(std::set &pick_list) { diff --git a/indra/newview/llhudnametag.h b/indra/newview/llhudnametag.h index 361e4d4f4b..592ab5518f 100644 --- a/indra/newview/llhudnametag.h +++ b/indra/newview/llhudnametag.h @@ -127,11 +127,12 @@ public: /*virtual*/ void markDead(); friend class LLHUDObject; /*virtual*/ F32 getDistance() const { return mLastDistance; } - S32 getLOD() { return mLOD; } - BOOL getVisible() { return mVisible; } + S32 getLOD() const { return mLOD; } + BOOL getVisible() const { return mVisible; } BOOL getHidden() const { return mHidden; } void setHidden( BOOL hide ) { mHidden = hide; } void shift(const LLVector3& offset); + F32 getWorldHeight() const; BOOL lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, LLVector4a& intersection, BOOL debug_render = FALSE); diff --git a/indra/newview/llpanelvoicedevicesettings.cpp b/indra/newview/llpanelvoicedevicesettings.cpp index 28631e2b7b..5e1cf801b9 100644 --- a/indra/newview/llpanelvoicedevicesettings.cpp +++ b/indra/newview/llpanelvoicedevicesettings.cpp @@ -70,11 +70,14 @@ BOOL LLPanelVoiceDeviceSettings::postBuild() mCtrlInputDevices = getChild("voice_input_device"); mCtrlOutputDevices = getChild("voice_output_device"); + mRetryBtn = getChild("retry_btn"); mCtrlInputDevices->setCommitCallback( boost::bind(&LLPanelVoiceDeviceSettings::onCommitInputDevice, this)); mCtrlOutputDevices->setCommitCallback( boost::bind(&LLPanelVoiceDeviceSettings::onCommitOutputDevice, this)); + mRetryBtn->setCommitCallback( + boost::bind(&LLPanelVoiceDeviceSettings::onCommitRetry, this)); mLocalizedDeviceNames[DEFAULT_DEVICE] = getString("default_text"); mLocalizedDeviceNames["No Device"] = getString("name_no_device"); @@ -108,11 +111,25 @@ void LLPanelVoiceDeviceSettings::draw() // let user know that volume indicator is not yet available bool is_in_tuning_mode = LLVoiceClient::getInstance()->inTuningMode(); - getChildView("wait_text")->setVisible( !is_in_tuning_mode && mUseTuningMode); + bool voice_enabled = LLVoiceClient::getInstance()->voiceEnabled(); + if (voice_enabled) + { + getChildView("wait_text")->setVisible( !is_in_tuning_mode && mUseTuningMode); + getChildView("muted_text")->setVisible(FALSE); + mRetryBtn->setVisible(FALSE); + } + else + { + getChildView("wait_text")->setVisible(FALSE); + getChildView("muted_text")->setVisible(TRUE); + + static LLCachedControl voice_enabled(gSavedSettings, "EnableVoiceChat"); + mRetryBtn->setVisible(!voice_enabled || LLVoiceClient::isMutedVoiceInstance()); + } LLPanel::draw(); - if (is_in_tuning_mode) + if (is_in_tuning_mode && voice_enabled) { const S32 num_bars = 5; F32 voice_power = LLVoiceClient::getInstance()->tuningGetEnergy() / LLVoiceClient::OVERDRIVEN_POWER_LEVEL; @@ -339,3 +356,9 @@ void LLPanelVoiceDeviceSettings::onInputDevicesClicked() { LLVoiceClient::getInstance()->refreshDeviceLists(false); // fill in the pop up menus again if needed. } + +void LLPanelVoiceDeviceSettings::onCommitRetry() +{ + gSavedSettings.setBOOL("EnableVoiceChat", TRUE); + LLVoiceClient::unmuteVoiceInstance(); +} diff --git a/indra/newview/llpanelvoicedevicesettings.h b/indra/newview/llpanelvoicedevicesettings.h index 355bc02b05..6b85d4e540 100644 --- a/indra/newview/llpanelvoicedevicesettings.h +++ b/indra/newview/llpanelvoicedevicesettings.h @@ -55,12 +55,14 @@ protected: void onCommitOutputDevice(); void onOutputDevicesClicked(); void onInputDevicesClicked(); + void onCommitRetry(); F32 mMicVolume; std::string mInputDevice; std::string mOutputDevice; class LLComboBox *mCtrlInputDevices; class LLComboBox *mCtrlOutputDevices; + class LLButton *mRetryBtn; BOOL mDevicesUpdated; bool mUseTuningMode; std::map mLocalizedDeviceNames; diff --git a/indra/newview/llpanelvolumepulldown.cpp b/indra/newview/llpanelvolumepulldown.cpp index 51e74a5a20..701a7767ec 100644 --- a/indra/newview/llpanelvolumepulldown.cpp +++ b/indra/newview/llpanelvolumepulldown.cpp @@ -40,6 +40,7 @@ #include "llfloaterreg.h" #include "llfloaterpreference.h" #include "llsliderctrl.h" +#include "llvoicevivox.h" #include "llcheckboxctrl.h" #include "llviewercontrol.h" @@ -54,7 +55,7 @@ LLPanelVolumePulldown::LLPanelVolumePulldown() /*// Handled centrally now mCommitCallbackRegistrar.add("Vol.setControlFalse", boost::bind(&LLPanelVolumePulldown::setControlFalse, this, _2)); mCommitCallbackRegistrar.add("Vol.SetSounds", boost::bind(&LLPanelVolumePulldown::onClickSetSounds, this)); - mCommitCallbackRegistrar.add("Vol.updateMediaAutoPlayCheckbox", boost::bind(&LLPanelVolumePulldown::updateMediaAutoPlayCheckbox, this, _1)); + mCommitCallbackRegistrar.add("Vol.updateCheckbox", boost::bind(&LLPanelVolumePulldown::updateCheckbox, this, _1, _2)); mCommitCallbackRegistrar.add("Vol.GoAudioPrefs", boost::bind(&LLPanelVolumePulldown::onAdvancedButtonClick, this, _2)); */ @@ -107,19 +108,27 @@ void LLPanelVolumePulldown::setControlFalse(const LLSD& user_data) control->set(LLSD(FALSE)); } -void LLPanelVolumePulldown::updateMediaAutoPlayCheckbox(LLUICtrl* ctrl) +void LLPanelVolumePulldown::updateCheckbox(LLUICtrl* ctrl, const LLSD& user_data) { - std::string name = ctrl->getName(); + std::string control_name = user_data.asString(); + if (control_name == "MediaAutoPlay") + { + std::string name = ctrl->getName(); - // Disable "Allow Media to auto play" only when both - // "Streaming Music" and "Media" are unchecked. STORM-513. - if ((name == "enable_music") || (name == "enable_media")) - { - bool music_enabled = getChild("enable_music")->get(); - bool media_enabled = getChild("enable_media")->get(); + // Disable "Allow Media to auto play" only when both + // "Streaming Music" and "Media" are unchecked. STORM-513. + if ((name == "enable_music") || (name == "enable_media")) + { + bool music_enabled = getChild("enable_music")->get(); + bool media_enabled = getChild("enable_media")->get(); - getChild("media_auto_play_combo")->setEnabled(music_enabled || media_enabled); - } + getChild("media_auto_play_combo")->setEnabled(music_enabled || media_enabled); + } + } + else if (control_name == "VoiceChat") + { + LLVivoxVoiceClient::unmuteVoiceInstance(); + } } void LLPanelVolumePulldown::onClickSetSounds() diff --git a/indra/newview/llpanelvolumepulldown.h b/indra/newview/llpanelvolumepulldown.h index 90e826e76b..16d7fecc20 100644 --- a/indra/newview/llpanelvolumepulldown.h +++ b/indra/newview/llpanelvolumepulldown.h @@ -44,7 +44,7 @@ class LLPanelVolumePulldown : public LLPanelPulldown void onClickSetSounds(); // Disables "Allow Media to auto play" check box only when both // "Streaming Music" and "Media" are unchecked. Otherwise enables it. - void updateMediaAutoPlayCheckbox(LLUICtrl* ctrl); + void updateCheckbox(LLUICtrl* ctrl, const LLSD& user_data); void onAdvancedButtonClick(const LLSD& user_data); */ diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 6641c03645..65c1e5a93e 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -67,6 +67,7 @@ #include "llviewermenu.h" // for gMenuBarView #include "llviewerparcelmgr.h" #include "llviewerthrottle.h" +#include "llvoiceclient.h" #include "lluictrlfactory.h" #include "lltoolmgr.h" @@ -350,6 +351,16 @@ BOOL LLStatusBar::postBuild() LLHints::getInstance()->registerHintTarget("linden_balance", getChild("balance_bg")->getHandle()); gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2)); + gSavedSettings.getControl("EnableVoiceChat")->getSignal()->connect(boost::bind(&LLStatusBar::onVoiceChanged, this, _2)); + + if (gSavedSettings.getBOOL("EnableVoiceChat") && !LLVoiceClient::isMutedVoiceInstance()) + { + mBtnVolume->setImageUnselected(LLUI::getUIImage("Audio_Off")); + } + else + { + mBtnVolume->setImageUnselected(LLUI::getUIImage("VoiceMute_Off")); + } // FIRE-19697: Add setting to disable graphics preset menu popup on mouse over gSavedSettings.getControl("FSStatusBarMenuButtonPopupOnRollover")->getSignal()->connect(boost::bind(&LLStatusBar::onPopupRolloverChanged, this, _2)); @@ -1125,6 +1136,19 @@ void LLStatusBar::onVolumeChanged(const LLSD& newvalue) refresh(); } +void LLStatusBar::onVoiceChanged(const LLSD& newvalue) +{ + if (newvalue.asBoolean() && !LLVoiceClient::isMutedVoiceInstance()) + { + mBtnVolume->setImageUnselected(LLUI::getUIImage("Audio_Off")); + } + else + { + mBtnVolume->setImageUnselected(LLUI::getUIImage("VoiceMute_Off")); + } + refresh(); +} + void LLStatusBar::onUpdateFilterTerm() { LLWString searchValue = utf8str_to_wstring( mFilterEdit->getValue() ); diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index 81d427cfd4..fcd6977c86 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -164,13 +164,12 @@ private: void onClickBuyCurrency(); void onVolumeChanged(const LLSD& newvalue); + void onVoiceChanged(const LLSD& newvalue); void onMouseEnterPresetsCamera(); void onMouseEnterPresets(); void onMouseEnterVolume(); void onMouseEnterNearbyMedia(); - // Does not exist 15-02-2021 - //void onClickScreen(S32 x, S32 y); static void onClickStreamToggle(void* data); // Media/Stream separation static void onClickMediaToggle(void* data); diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index 007859e426..10de5f33b6 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -253,7 +253,7 @@ void LLTranslationAPIHandler::translateMessageCoro(LanguagePair_t fromTo, std::s try { - res = this->parseResponse(httpResults, parseResult, body, translation, detected_lang, err_msg); + res = parseResponse(httpResults, parseResult, body, translation, detected_lang, err_msg); } catch (std::out_of_range&) { @@ -293,8 +293,6 @@ void LLTranslationAPIHandler::translateMessageCoro(LanguagePair_t fromTo, std::s if (!failure.empty()) failure(status, err_msg); } - - } //========================================================================= @@ -353,7 +351,6 @@ private: std::string& translation, std::string& detected_lang); static std::string getAPIKey(); - }; //------------------------------------------------------------------------- @@ -391,36 +388,37 @@ bool LLGoogleTranslationHandler::checkVerificationResponse( // virtual bool LLGoogleTranslationHandler::parseResponse( - const LLSD& http_response, + const LLSD& http_response, int& status, const std::string& body, std::string& translation, std::string& detected_lang, std::string& err_msg) const { + const std::string& text = !body.empty() ? body : http_response["error_body"].asStringRef(); + Json::Value root; Json::Reader reader; - if (!reader.parse(body, root)) + if (reader.parse(text, root)) { + if (root.isObject()) + { + // Request succeeded, extract translation from the XML body. + if (parseTranslation(root, translation, detected_lang)) + return true; + + // Request failed. Extract error message from the XML body. + parseErrorResponse(root, status, err_msg); + } + } + else + { + // XML parsing failed. Extract error message from the XML parser. err_msg = reader.getFormatedErrorMessages(); - return false; } - if (!root.isObject()) // empty response? should not happen - { - return false; - } - - if (status != HTTP_OK) - { - // Request failed. Extract error message from the response. - parseErrorResponse(root, status, err_msg); - return false; - } - - // Request succeeded, extract translation from the response. - return parseTranslation(root, translation, detected_lang); + return false; } // virtual @@ -493,7 +491,7 @@ void LLGoogleTranslationHandler::verifyKey(const LLSD &key, LLTranslate::KeyVeri /*virtual*/ void LLGoogleTranslationHandler::initHttpHeader(LLCore::HttpHeaders::ptr_t headers, const std::string& user_agent) const { - headers->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_TEXT_PLAIN); + headers->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_JSON); headers->append(HTTP_OUT_HEADER_USER_AGENT, user_agent); } @@ -503,8 +501,7 @@ void LLGoogleTranslationHandler::initHttpHeader( const std::string& user_agent, const LLSD &key) const { - headers->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_TEXT_PLAIN); - headers->append(HTTP_OUT_HEADER_USER_AGENT, user_agent); + initHttpHeader(headers, user_agent); } LLSD LLGoogleTranslationHandler::sendMessageAndSuspend(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t adapter, @@ -1314,5 +1311,4 @@ LLTranslationAPIHandler& LLTranslate::getHandler(EService service) } return azure; - } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e76b1d073f..ba913d37fd 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -4192,6 +4192,25 @@ void LLVOAvatar::idleUpdateNameTagPosition(const LLVector3& root_pos_last) name_position[VZ] += fsNameTagOffset / 10.f; // + const F32 water_height = getRegion()->getWaterHeight(); + static const F32 WATER_HEIGHT_DELTA = 0.25f; + if (name_position[VZ] < water_height + WATER_HEIGHT_DELTA) + { + if (LLViewerCamera::getInstance()->getOrigin()[VZ] >= water_height) + { + name_position[VZ] = water_height; + } + else // both camera and HUD are below watermark + { + F32 name_world_height = mNameText->getWorldHeight(); + F32 max_z_position = water_height - name_world_height; + if (name_position[VZ] > max_z_position) + { + name_position[VZ] = max_z_position; + } + } + } + mNameText->setPositionAgent(name_position); } diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 0839133b47..a61f3014a5 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -571,6 +571,16 @@ void LLVoiceClient::setVoiceEnabled(bool enabled) } } +void LLVoiceClient::unmuteVoiceInstance() +{ + LLVivoxVoiceClient::unmuteVoiceInstance(); +} + +bool LLVoiceClient::isMutedVoiceInstance() +{ + return LLVivoxVoiceClient::isMutedVoiceInstance(); +} + void LLVoiceClient::updateMicMuteLogic() { // If not configured to use PTT, the mic should be open (otherwise the user will be unable to speak). diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index b4896aba8b..3ff44a4e76 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -432,6 +432,8 @@ public: void toggleUserPTTState(void); void inputUserControlState(bool down); // interpret any sort of up-down mic-open control input according to ptt-toggle prefs void setVoiceEnabled(bool enabled); + static void unmuteVoiceInstance(); + static bool isMutedVoiceInstance(); void setUsePTT(bool usePTT); void setPTTIsToggle(bool PTTIsToggle); diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 7f9ca41925..73bd5748bc 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -277,6 +277,7 @@ static void killGateway() bool LLVivoxVoiceClient::sShuttingDown = false; bool LLVivoxVoiceClient::sConnected = false; +bool LLVivoxVoiceClient::sVoiceInstanceMuted = false; LLPumpIO *LLVivoxVoiceClient::sPump = nullptr; LLVivoxVoiceClient::LLVivoxVoiceClient() : @@ -355,6 +356,7 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() : sShuttingDown = false; sConnected = false; sPump = nullptr; + sVoiceInstanceMuted = LLAppViewer::instance()->isSecondInstance(); mSpeakerVolume = scale_speaker_volume(0); @@ -595,9 +597,6 @@ void LLVivoxVoiceClient::connectorCreate() << "" << mVoiceAccountServerURI << "" << "Normal" << strConnectorHandle - // Voice in multiple instances; by Latif Khalifa - << (gSavedSettings.getBOOL("VoiceMultiInstance") ? "3000050000" : "") - // << "" << "" << logdir << "" << "Connector" @@ -1039,30 +1038,44 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon() // cause SLVoice's bind() call to fail with EADDRINUSE. We expect // that eventually the OS will time out previous ports, which is // why we cycle instead of incrementing indefinitely. - // Unfail voice connection failures - //U32 portbase = gSavedSettings.getU32("VivoxVoicePort"); - //static U32 portoffset = 0; - //static const U32 portrange = 100; - //std::string host(gSavedSettings.getString("VivoxVoiceHost")); - //U32 port = portbase + portoffset; - //portoffset = (portoffset + 1) % portrange; - //params.args.add("-i"); - //params.args.add(STRINGIZE(host << ':' << port)); - // - - std::string loglevel = gSavedSettings.getString("VivoxDebugLevel"); - if (loglevel.empty()) - { - loglevel = "0"; - } - params.args.add("-ll"); - params.args.add(loglevel); + static LLCachedControl portbase(gSavedSettings, "VivoxVoicePort"); + static LLCachedControl host(gSavedSettings, "VivoxVoiceHost"); + static LLCachedControl loglevel(gSavedSettings, "VivoxDebugLevel"); + // Strip trailing directory delimiter + //static LLCachedControl log_folder(gSavedSettings, "VivoxLogDirectory"); std::string log_folder = gSavedSettings.getString("VivoxLogDirectory"); + // + static LLCachedControl shutdown_timeout(gSavedSettings, "VivoxShutdownTimeout"); + static const U32 portrange = 100; + static U32 portoffset = 0; + U32 port = 0; - if (log_folder.empty()) + if (LLAppViewer::instance()->isSecondInstance()) { - log_folder = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); + // Ideally need to know amount of instances and + // to increment instance_offset on EADDRINUSE. + // But for now just use rand + static U32 instance_offset = portrange * ll_rand(20); + port = portbase + portoffset + portrange; + } + else + { + // leave main thread with exclusive port set + port = portbase + portoffset; + } + portoffset = (portoffset + 1) % portrange; + params.args.add("-i"); + params.args.add(STRINGIZE(host() << ':' << port)); + + params.args.add("-ll"); + if (loglevel().empty()) + { + params.args.add("0"); + } + else + { + params.args.add(loglevel); } // Strip trailing directory delimiter @@ -1072,7 +1085,17 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon() } // params.args.add("-lf"); - params.args.add(log_folder); + // Strip trailing directory delimiter + //if (log_folder().empty()) + if (log_folder.empty()) + // + { + params.args.add(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "")); + } + else + { + params.args.add(log_folder); + } // set log file basename and .log params.args.add("-lp"); @@ -1088,27 +1111,11 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon() LLFile::rename(new_log, old_log); } - std::string shutdown_timeout = gSavedSettings.getString("VivoxShutdownTimeout"); - if (!shutdown_timeout.empty()) + if (!shutdown_timeout().empty()) { params.args.add("-st"); params.args.add(shutdown_timeout); } - - // Voice in multiple instances; by Latif Khalifa - if (gSavedSettings.getBOOL("VoiceMultiInstance")) - { - S32 port_nr = 30000 + ll_rand(20000); - LLControlVariable* voice_port = gSavedSettings.getControl("VivoxVoicePort"); - if (voice_port) - { - voice_port->setValue(LLSD(port_nr), false); - params.args.add("-i"); - params.args.add(llformat("127.0.0.1:%u", gSavedSettings.getU32("VivoxVoicePort"))); - } - } - // - params.cwd = gDirUtilp->getAppRODataDir(); // Check if using the old SLVoice for Linux. the SDK in that version is too old to handle the extra args @@ -1130,9 +1137,7 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon() sGatewayPtr = LLProcess::create(params); - // Unfail voice connection failures - //mDaemonHost = LLHost(host.c_str(), port); - mDaemonHost = LLHost(gSavedSettings.getString("VivoxVoiceHost").c_str(), gSavedSettings.getU32("VivoxVoicePort")); + mDaemonHost = LLHost(host().c_str(), port); } else { @@ -5789,14 +5794,15 @@ bool LLVivoxVoiceClient::voiceEnabled(bool no_cache) // Replace frequently called gSavedSettings //return gSavedSettings.getBOOL("EnableVoiceChat") && // !gSavedSettings.getBOOL("CmdLineDisableVoice") && - // !gNonInteractive; + // !gNonInteractive && + // !sVoiceInstanceMuted; if (no_cache) { - return gSavedSettings.getBOOL("EnableVoiceChat") && !gSavedSettings.getBOOL("CmdLineDisableVoice") && !gNonInteractive; + return gSavedSettings.getBOOL("EnableVoiceChat") && !gSavedSettings.getBOOL("CmdLineDisableVoice") && !gNonInteractive && !sVoiceInstanceMuted; } static LLCachedControl sEnableVoiceChat(gSavedSettings, "EnableVoiceChat"); static LLCachedControl sCmdLineDisableVoice(gSavedSettings, "CmdLineDisableVoice"); - return sEnableVoiceChat && !sCmdLineDisableVoice && !gNonInteractive; + return sEnableVoiceChat && !sCmdLineDisableVoice && !gNonInteractive && !sVoiceInstanceMuted; // } // diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 19725849f8..cb88c0c0df 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -175,6 +175,8 @@ public: virtual bool voiceEnabled(bool no_cache = false); // virtual void setVoiceEnabled(bool enabled); + static void unmuteVoiceInstance() { sVoiceInstanceMuted = false; } + static bool isMutedVoiceInstance() { return sVoiceInstanceMuted; } virtual BOOL lipSyncEnabled(); virtual void setLipSyncEnabled(BOOL enabled); virtual void setMuteMic(bool muted); // Set the mute state of the local mic. @@ -931,6 +933,7 @@ private: // This variables can last longer than vivox in coroutines so we need them as static static bool sShuttingDown; static bool sConnected; + static bool sVoiceInstanceMuted; // Second+ instance of viewer starts muted static LLPumpIO* sPump; LLEventMailDrop mVivoxPump; diff --git a/indra/newview/skins/default/textures/icons/VoiceMute_Off.png b/indra/newview/skins/default/textures/icons/VoiceMute_Off.png new file mode 100644 index 0000000000..425ba267a5 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/VoiceMute_Off.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index e3e073e24b..cfd21330ba 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -66,6 +66,7 @@ with the same filename but different name + diff --git a/indra/newview/skins/default/xui/az/panel_preferences_sound.xml b/indra/newview/skins/default/xui/az/panel_preferences_sound.xml index 59fa3606c3..7ea84d21e5 100644 --- a/indra/newview/skins/default/xui/az/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/az/panel_preferences_sound.xml @@ -98,7 +98,6 @@ Avtomatik oxutma - - - Please wait @@ -136,7 +136,7 @@ layout="topleft" left_delta="0" name="bar0" - top_delta="-2" + top_delta="-5" width="20" /> - + + Muted + +