aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llvoiceclient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llvoiceclient.cpp')
-rw-r--r--linden/indra/newview/llvoiceclient.cpp52
1 files changed, 6 insertions, 46 deletions
diff --git a/linden/indra/newview/llvoiceclient.cpp b/linden/indra/newview/llvoiceclient.cpp
index f0dafef..738eeac 100644
--- a/linden/indra/newview/llvoiceclient.cpp
+++ b/linden/indra/newview/llvoiceclient.cpp
@@ -678,31 +678,6 @@ void LLVivoxProtocolParser::processResponse(std::string tag)
678 678
679/////////////////////////////////////////////////////////////////////////////////////////////// 679///////////////////////////////////////////////////////////////////////////////////////////////
680 680
681class LLVoiceClientPrefsListener: public LLSimpleListener
682{
683 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
684 {
685 // Note: Ignore the specific event value, look up the ones we want
686
687 gVoiceClient->setVoiceEnabled(gSavedSettings.getBOOL("EnableVoiceChat"));
688 gVoiceClient->setUsePTT(gSavedSettings.getBOOL("PTTCurrentlyEnabled"));
689 std::string keyString = gSavedSettings.getString("PushToTalkButton");
690 gVoiceClient->setPTTKey(keyString);
691 gVoiceClient->setPTTIsToggle(gSavedSettings.getBOOL("PushToTalkToggle"));
692 gVoiceClient->setEarLocation(gSavedSettings.getS32("VoiceEarLocation"));
693 std::string serverName = gSavedSettings.getString("VivoxDebugServerName");
694 gVoiceClient->setVivoxDebugServerName(serverName);
695
696 std::string inputDevice = gSavedSettings.getString("VoiceInputAudioDevice");
697 gVoiceClient->setCaptureDevice(inputDevice);
698 std::string outputDevice = gSavedSettings.getString("VoiceOutputAudioDevice");
699 gVoiceClient->setRenderDevice(outputDevice);
700
701 return true;
702 }
703};
704static LLVoiceClientPrefsListener voice_prefs_listener;
705
706class LLVoiceClientMuteListObserver : public LLMuteListObserver 681class LLVoiceClientMuteListObserver : public LLMuteListObserver
707{ 682{
708 /* virtual */ void onChange() { gVoiceClient->muteListChanged();} 683 /* virtual */ void onChange() { gVoiceClient->muteListChanged();}
@@ -859,16 +834,6 @@ LLVoiceClient::LLVoiceClient()
859 std::string renderDevice = gSavedSettings.getString("VoiceOutputAudioDevice"); 834 std::string renderDevice = gSavedSettings.getString("VoiceOutputAudioDevice");
860 setRenderDevice(renderDevice); 835 setRenderDevice(renderDevice);
861 836
862 // Set up our listener to get updates on all prefs values we care about.
863 gSavedSettings.getControl("EnableVoiceChat")->addListener(&voice_prefs_listener);
864 gSavedSettings.getControl("PTTCurrentlyEnabled")->addListener(&voice_prefs_listener);
865 gSavedSettings.getControl("PushToTalkButton")->addListener(&voice_prefs_listener);
866 gSavedSettings.getControl("PushToTalkToggle")->addListener(&voice_prefs_listener);
867 gSavedSettings.getControl("VoiceEarLocation")->addListener(&voice_prefs_listener);
868 gSavedSettings.getControl("VivoxDebugServerName")->addListener(&voice_prefs_listener);
869 gSavedSettings.getControl("VoiceInputAudioDevice")->addListener(&voice_prefs_listener);
870 gSavedSettings.getControl("VoiceOutputAudioDevice")->addListener(&voice_prefs_listener);
871
872 mTuningMode = false; 837 mTuningMode = false;
873 mTuningEnergy = 0.0f; 838 mTuningEnergy = 0.0f;
874 mTuningMicVolume = 0; 839 mTuningMicVolume = 0;
@@ -1239,12 +1204,7 @@ void LLVoiceClient::stateMachine()
1239 // Check for parcel boundary crossing 1204 // Check for parcel boundary crossing
1240 { 1205 {
1241 LLViewerRegion *region = gAgent.getRegion(); 1206 LLViewerRegion *region = gAgent.getRegion();
1242 LLParcel *parcel = NULL; 1207 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
1243
1244 if(gParcelMgr)
1245 {
1246 parcel = gParcelMgr->getAgentParcel();
1247 }
1248 1208
1249 if(region && parcel) 1209 if(region && parcel)
1250 { 1210 {
@@ -1281,7 +1241,7 @@ void LLVoiceClient::stateMachine()
1281 break; 1241 break;
1282 1242
1283 case stateStart: 1243 case stateStart:
1284 if(gDisableVoice) 1244 if(gSavedSettings.getBOOL("CmdLineDisableVoice"))
1285 { 1245 {
1286 // Voice is locked out, we must not launch the vivox daemon. 1246 // Voice is locked out, we must not launch the vivox daemon.
1287 setState(stateJail); 1247 setState(stateJail);
@@ -1661,9 +1621,9 @@ void LLVoiceClient::stateMachine()
1661 notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LOGGED_IN); 1621 notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LOGGED_IN);
1662 1622
1663 // Set up the mute list observer if it hasn't been set up already. 1623 // Set up the mute list observer if it hasn't been set up already.
1664 if((!sMuteListListener_listening) && (gMuteListp)) 1624 if((!sMuteListListener_listening))
1665 { 1625 {
1666 gMuteListp->addObserver(&mutelist_listener); 1626 LLMuteList::getInstance()->addObserver(&mutelist_listener);
1667 sMuteListListener_listening = true; 1627 sMuteListListener_listening = true;
1668 } 1628 }
1669 1629
@@ -3103,7 +3063,7 @@ void LLVoiceClient::updateMuteState(participantState *p)
3103{ 3063{
3104 if(p->mAvatarIDValid) 3064 if(p->mAvatarIDValid)
3105 { 3065 {
3106 bool isMuted = gMuteListp->isMuted(p->mAvatarID, LLMute::flagVoiceChat); 3066 bool isMuted = LLMuteList::getInstance()->isMuted(p->mAvatarID, LLMute::flagVoiceChat);
3107 if(p->mOnMuteList != isMuted) 3067 if(p->mOnMuteList != isMuted)
3108 { 3068 {
3109 p->mOnMuteList = isMuted; 3069 p->mOnMuteList = isMuted;
@@ -3644,7 +3604,7 @@ void LLVoiceClient::setVoiceEnabled(bool enabled)
3644 3604
3645bool LLVoiceClient::voiceEnabled() 3605bool LLVoiceClient::voiceEnabled()
3646{ 3606{
3647 return gSavedSettings.getBOOL("EnableVoiceChat") && !gDisableVoice; 3607 return gSavedSettings.getBOOL("EnableVoiceChat") && !gSavedSettings.getBOOL("CmdLineDisableVoice");
3648} 3608}
3649 3609
3650void LLVoiceClient::setUsePTT(bool usePTT) 3610void LLVoiceClient::setUsePTT(bool usePTT)