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.cpp41
1 files changed, 26 insertions, 15 deletions
diff --git a/linden/indra/newview/llvoiceclient.cpp b/linden/indra/newview/llvoiceclient.cpp
index bedf1d9..64a17ae 100644
--- a/linden/indra/newview/llvoiceclient.cpp
+++ b/linden/indra/newview/llvoiceclient.cpp
@@ -839,19 +839,12 @@ LLVoiceClient::LLVoiceClient()
839 mCaptureDeviceDirty = false; 839 mCaptureDeviceDirty = false;
840 mRenderDeviceDirty = false; 840 mRenderDeviceDirty = false;
841 841
842 // Load initial state from prefs. 842 // Use default values for everything then call updateSettings() after preferences are loaded
843 mVoiceEnabled = gSavedSettings.getBOOL("EnableVoiceChat"); 843 mVoiceEnabled = false;
844 mUsePTT = TRUE; //gSavedSettings.getBOOL("EnablePushToTalk"); 844 mUsePTT = true;
845 std::string keyString = gSavedSettings.getString("PushToTalkButton"); 845 mPTTIsToggle = false;
846 setPTTKey(keyString); 846 mEarLocation = 0;
847 mPTTIsToggle = gSavedSettings.getBOOL("PushToTalkToggle"); 847 mLipSyncEnabled = false;
848 mEarLocation = gSavedSettings.getS32("VoiceEarLocation");
849 setVoiceVolume(gSavedSettings.getBOOL("MuteVoice") ? 0.f : gSavedSettings.getF32("AudioLevelVoice"));
850 std::string captureDevice = gSavedSettings.getString("VoiceInputAudioDevice");
851 setCaptureDevice(captureDevice);
852 std::string renderDevice = gSavedSettings.getString("VoiceOutputAudioDevice");
853 setRenderDevice(renderDevice);
854 mLipSyncEnabled = gSavedSettings.getBOOL("LipSyncEnabled");
855 848
856 mTuningMode = false; 849 mTuningMode = false;
857 mTuningEnergy = 0.0f; 850 mTuningEnergy = 0.0f;
@@ -895,12 +888,11 @@ LLVoiceClient::~LLVoiceClient()
895 888
896//---------------------------------------------- 889//----------------------------------------------
897 890
898
899
900void LLVoiceClient::init(LLPumpIO *pump) 891void LLVoiceClient::init(LLPumpIO *pump)
901{ 892{
902 // constructor will set up gVoiceClient 893 // constructor will set up gVoiceClient
903 LLVoiceClient::getInstance()->mPump = pump; 894 LLVoiceClient::getInstance()->mPump = pump;
895 LLVoiceClient::getInstance()->updateSettings();
904} 896}
905 897
906void LLVoiceClient::terminate() 898void LLVoiceClient::terminate()
@@ -923,6 +915,25 @@ void LLVoiceClient::terminate()
923 } 915 }
924} 916}
925 917
918//---------------------------------------------------
919
920void LLVoiceClient::updateSettings()
921{
922 setVoiceEnabled(gSavedSettings.getBOOL("EnableVoiceChat"));
923 setUsePTT(gSavedSettings.getBOOL("PTTCurrentlyEnabled"));
924 std::string keyString = gSavedSettings.getString("PushToTalkButton");
925 setPTTKey(keyString);
926 setPTTIsToggle(gSavedSettings.getBOOL("PushToTalkToggle"));
927 setEarLocation(gSavedSettings.getS32("VoiceEarLocation"));
928 std::string serverName = gSavedSettings.getString("VivoxDebugServerName");
929 setVivoxDebugServerName(serverName);
930
931 std::string inputDevice = gSavedSettings.getString("VoiceInputAudioDevice");
932 setCaptureDevice(inputDevice);
933 std::string outputDevice = gSavedSettings.getString("VoiceOutputAudioDevice");
934 setRenderDevice(outputDevice);
935 setLipSyncEnabled(gSavedSettings.getBOOL("LipSyncEnabled"));
936}
926 937
927///////////////////////////// 938/////////////////////////////
928// utility functions 939// utility functions