aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatervoicewizard.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloatervoicewizard.cpp45
1 files changed, 34 insertions, 11 deletions
diff --git a/linden/indra/newview/llfloatervoicewizard.cpp b/linden/indra/newview/llfloatervoicewizard.cpp
index 28c8280..65601ff 100644
--- a/linden/indra/newview/llfloatervoicewizard.cpp
+++ b/linden/indra/newview/llfloatervoicewizard.cpp
@@ -13,12 +13,12 @@
13 * ("GPL"), unless you have obtained a separate licensing agreement 13 * ("GPL"), unless you have obtained a separate licensing agreement
14 * ("Other License"), formally executed by you and Linden Lab. Terms of 14 * ("Other License"), formally executed by you and Linden Lab. Terms of
15 * the GPL can be found in doc/GPL-license.txt in this distribution, or 15 * the GPL can be found in doc/GPL-license.txt in this distribution, or
16 * online at http://secondlife.com/developers/opensource/gplv2 16 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
17 * 17 *
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at http://secondlife.com/developers/opensource/flossexception 21 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 * 22 *
23 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -132,6 +132,8 @@ void LLFloaterVoiceWizard::draw()
132 132
133void LLFloaterVoiceWizard::onOpen() 133void LLFloaterVoiceWizard::onOpen()
134{ 134{
135 LLFloaterDeviceSettings::hideInstance();
136
135 if(mDevicePanel) 137 if(mDevicePanel)
136 { 138 {
137 mDevicePanel->onOpen(); 139 mDevicePanel->onOpen();
@@ -246,6 +248,9 @@ BOOL LLPanelDeviceSettings::postBuild()
246 volume_slider->setValue(mMicVolume); 248 volume_slider->setValue(mMicVolume);
247 } 249 }
248 250
251 childSetCommitCallback("voice_input_device", onCommitInputDevice, this);
252 childSetCommitCallback("voice_output_device", onCommitOutputDevice, this);
253
249 return TRUE; 254 return TRUE;
250} 255}
251 256
@@ -270,19 +275,19 @@ void LLPanelDeviceSettings::draw()
270 275
271 if (gVoiceClient->inTuningMode()) 276 if (gVoiceClient->inTuningMode())
272 { 277 {
273 const S32 GAP = 5;
274 S32 cur_x = 100;
275 S32 cur_y = 15;
276
277 for(S32 power_bar_idx = 0; power_bar_idx < 5; power_bar_idx++) 278 for(S32 power_bar_idx = 0; power_bar_idx < 5; power_bar_idx++)
278 { 279 {
279 if (power_bar_idx < discrete_power) 280 LLString view_name = llformat("%s%d", "bar", power_bar_idx);
281 LLView* bar_view = getChildByName(view_name, TRUE);
282 if (bar_view)
280 { 283 {
281 LLColor4 color = (power_bar_idx >= 3) ? gSavedSettings.getColor4("OverdrivenColor") : gSavedSettings.getColor4("SpeakingColor"); 284 if (power_bar_idx < discrete_power)
282 gl_rect_2d(cur_x, cur_y + 20, cur_x + 20, cur_y, color, TRUE); 285 {
286 LLColor4 color = (power_bar_idx >= 3) ? gSavedSettings.getColor4("OverdrivenColor") : gSavedSettings.getColor4("SpeakingColor");
287 gl_rect_2d(bar_view->getRect(), color, TRUE);
288 }
289 gl_rect_2d(bar_view->getRect(), LLColor4::grey, FALSE);
283 } 290 }
284 gl_rect_2d(cur_x, cur_y + 20, cur_x + 20, cur_y, LLColor4::grey, FALSE);
285 cur_x += 20 + GAP;
286 } 291 }
287 } 292 }
288} 293}
@@ -395,6 +400,9 @@ void LLPanelDeviceSettings::refresh()
395 400
396void LLPanelDeviceSettings::onOpen() 401void LLPanelDeviceSettings::onOpen()
397{ 402{
403 mInputDevice = gSavedSettings.getString("VoiceInputAudioDevice");
404 mOutputDevice = gSavedSettings.getString("VoiceOutputAudioDevice");
405 mMicVolume = gSavedSettings.getF32("AudioLevelMic");
398 mDevicesUpdated = FALSE; 406 mDevicesUpdated = FALSE;
399 407
400 // ask for new device enumeration 408 // ask for new device enumeration
@@ -402,11 +410,25 @@ void LLPanelDeviceSettings::onOpen()
402 410
403 // put voice client in "tuning" mode 411 // put voice client in "tuning" mode
404 gVoiceClient->tuningStart(); 412 gVoiceClient->tuningStart();
413 LLVoiceChannel::suspend();
405} 414}
406 415
407void LLPanelDeviceSettings::onClose(bool app_quitting) 416void LLPanelDeviceSettings::onClose(bool app_quitting)
408{ 417{
409 gVoiceClient->tuningStop(); 418 gVoiceClient->tuningStop();
419 LLVoiceChannel::resume();
420}
421
422// static
423void LLPanelDeviceSettings::onCommitInputDevice(LLUICtrl* ctrl, void* user_data)
424{
425 gSavedSettings.setString("VoiceInputAudioDevice", ctrl->getValue().asString());
426}
427
428// static
429void LLPanelDeviceSettings::onCommitOutputDevice(LLUICtrl* ctrl, void* user_data)
430{
431 gSavedSettings.setString("VoiceOutputAudioDevice", ctrl->getValue().asString());
410} 432}
411 433
412// 434//
@@ -424,6 +446,7 @@ LLFloaterDeviceSettings::LLFloaterDeviceSettings(const LLSD& seed) : LLFloater("
424 446
425void LLFloaterDeviceSettings::onOpen() 447void LLFloaterDeviceSettings::onOpen()
426{ 448{
449 LLFloaterVoiceWizard::hideInstance();
427 if(mDevicePanel) 450 if(mDevicePanel)
428 { 451 {
429 mDevicePanel->onOpen(); 452 mDevicePanel->onOpen();