aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMcCabe Maxsted2010-08-12 18:10:19 -0700
committerMcCabe Maxsted2010-08-12 18:10:19 -0700
commit4258b7c3bdfb801a333e0c826da3a18ef9c61c54 (patch)
tree2f9614012ac4f311d9aef551bb96440cf50fb888
parentFixed #381: using voice causes viewer crash on disconnect/quit (diff)
downloadmeta-impy-4258b7c3bdfb801a333e0c826da3a18ef9c61c54.zip
meta-impy-4258b7c3bdfb801a333e0c826da3a18ef9c61c54.tar.gz
meta-impy-4258b7c3bdfb801a333e0c826da3a18ef9c61c54.tar.bz2
meta-impy-4258b7c3bdfb801a333e0c826da3a18ef9c61c54.tar.xz
Added 'Reset Voice' button to Preferences > Voice from Emerald
-rw-r--r--linden/indra/newview/llprefsvoice.cpp26
-rw-r--r--linden/indra/newview/llprefsvoice.h1
-rw-r--r--linden/indra/newview/llvoiceclient.cpp4
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_preferences_voice.xml3
4 files changed, 32 insertions, 2 deletions
diff --git a/linden/indra/newview/llprefsvoice.cpp b/linden/indra/newview/llprefsvoice.cpp
index c2f42ff..167e079 100644
--- a/linden/indra/newview/llprefsvoice.cpp
+++ b/linden/indra/newview/llprefsvoice.cpp
@@ -111,6 +111,7 @@ LLPrefsVoice::~LLPrefsVoice()
111BOOL LLPrefsVoice::postBuild() 111BOOL LLPrefsVoice::postBuild()
112{ 112{
113 childSetCommitCallback("enable_voice_check", onCommitEnableVoiceChat, this); 113 childSetCommitCallback("enable_voice_check", onCommitEnableVoiceChat, this);
114 childSetAction("reset_voice", onClickResetVoice, this);
114 childSetAction("set_voice_hotkey_button", onClickSetKey, this); 115 childSetAction("set_voice_hotkey_button", onClickSetKey, this);
115 childSetAction("set_voice_middlemouse_button", onClickSetMiddleMouse, this); 116 childSetAction("set_voice_middlemouse_button", onClickSetMiddleMouse, this);
116 childSetAction("device_settings_btn", onClickVoiceDeviceSettings, NULL); 117 childSetAction("device_settings_btn", onClickVoiceDeviceSettings, NULL);
@@ -192,6 +193,31 @@ void LLPrefsVoice::onClickSetKey(void* user_data)
192 dialog->startModal(); 193 dialog->startModal();
193} 194}
194 195
196
197void LLPrefsVoice::onClickResetVoice(void* user_data)
198{
199 // *TODO: Change this to make voice really reset
200 BOOL voice_disabled = gSavedSettings.getBOOL("CmdLineDisableVoice");
201 bool enable = !voice_disabled && gSavedSettings.getBOOL("EnableVoiceChat");
202 if(enable)
203 {
204 //Seems to make voice at least reconnect to the current channel.
205 //Was hopeing it would have actualy restarted voice. --Liny
206 gSavedSettings.setBOOL("EnableVoiceChat", FALSE);
207 LLFloaterVoiceDeviceSettings* voice_device_settings = LLFloaterVoiceDeviceSettings::getInstance();
208 if(voice_device_settings)
209 {
210 voice_device_settings->apply();
211 }
212 gSavedSettings.setBOOL("EnableVoiceChat", TRUE);
213 voice_device_settings = LLFloaterVoiceDeviceSettings::getInstance();
214 if(voice_device_settings)
215 {
216 voice_device_settings->apply();
217 }
218 }
219}
220
195//static 221//static
196void LLPrefsVoice::onClickSetMiddleMouse(void* user_data) 222void LLPrefsVoice::onClickSetMiddleMouse(void* user_data)
197{ 223{
diff --git a/linden/indra/newview/llprefsvoice.h b/linden/indra/newview/llprefsvoice.h
index 49f6035..af298c5 100644
--- a/linden/indra/newview/llprefsvoice.h
+++ b/linden/indra/newview/llprefsvoice.h
@@ -50,6 +50,7 @@ public:
50 50
51private: 51private:
52 static void onCommitEnableVoiceChat(LLUICtrl* ctrl, void* user_data); 52 static void onCommitEnableVoiceChat(LLUICtrl* ctrl, void* user_data);
53 static void onClickResetVoice(void* user_data);
53 static void onClickSetKey(void* user_data); 54 static void onClickSetKey(void* user_data);
54 static void onClickSetMiddleMouse(void* user_data); 55 static void onClickSetMiddleMouse(void* user_data);
55 static void onClickVoiceDeviceSettings(void* user_data); 56 static void onClickVoiceDeviceSettings(void* user_data);
diff --git a/linden/indra/newview/llvoiceclient.cpp b/linden/indra/newview/llvoiceclient.cpp
index 908bedb..660b60a 100644
--- a/linden/indra/newview/llvoiceclient.cpp
+++ b/linden/indra/newview/llvoiceclient.cpp
@@ -1215,7 +1215,7 @@ void LLVoiceClient::terminate()
1215 1215
1216void LLVoiceClient::updateSettings() 1216void LLVoiceClient::updateSettings()
1217{ 1217{
1218 setVoiceEnabled(gSavedSettings.getBOOL("EnableVoiceChat")); 1218 setVoiceEnabled(gSavedSettings.getBOOL("EnableVoiceChat") && !gSavedSettings.getBOOL("CmdLineDisableVoice"));
1219 setUsePTT(gSavedSettings.getBOOL("PTTCurrentlyEnabled")); 1219 setUsePTT(gSavedSettings.getBOOL("PTTCurrentlyEnabled"));
1220 std::string keyString = gSavedSettings.getString("PushToTalkButton"); 1220 std::string keyString = gSavedSettings.getString("PushToTalkButton");
1221 setPTTKey(keyString); 1221 setPTTKey(keyString);
@@ -5821,7 +5821,7 @@ void LLVoiceClient::setVoiceEnabled(bool enabled)
5821 5821
5822bool LLVoiceClient::voiceEnabled() 5822bool LLVoiceClient::voiceEnabled()
5823{ 5823{
5824 return gSavedSettings.getBOOL("EnableVoiceChat") && !gSavedSettings.getBOOL("CmdLineDisableVoice"); 5824 return LLVoiceClient::getInstance()->mVoiceEnabled;//gSavedSettings.getBOOL("EnableVoiceChat") && !gSavedSettings.getBOOL("CmdLineDisableVoice");
5825} 5825}
5826 5826
5827void LLVoiceClient::setLipSyncEnabled(BOOL enabled) 5827void LLVoiceClient::setLipSyncEnabled(BOOL enabled)
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_voice.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_voice.xml
index 8712be5..8e6fc0d 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_voice.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_voice.xml
@@ -76,6 +76,9 @@
76 <button bottom_delta="-40" follows="left|top" font="SansSerif" height="20" 76 <button bottom_delta="-40" follows="left|top" font="SansSerif" height="20"
77 label="Device Settings" left="28" mouse_opaque="true" 77 label="Device Settings" left="28" mouse_opaque="true"
78 name="device_settings_btn" width="155" /> 78 name="device_settings_btn" width="155" />
79 <button bottom_delta="0" follows="left|top" font="SansSerif" halign="center" height="20"
80 label="Reset Voice" left_delta="160" mouse_opaque="true"
81 name="reset_voice" width="115" />
79 <text_editor type="string" length="1" allow_html="false" bg_readonly_color="0 0 0 0" bottom_delta="-32" 82 <text_editor type="string" length="1" allow_html="false" bg_readonly_color="0 0 0 0" bottom_delta="-32"
80 embedded_items="false" enabled="false" follows="left|top" 83 embedded_items="false" enabled="false" follows="left|top"
81 font="SansSerifSmall" height="35" hide_border="true" hide_scrollbar="true" 84 font="SansSerifSmall" height="35" hide_border="true" hide_scrollbar="true"