summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatervoicedevicesettings.cpp
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2010-04-01 21:47:22 -0700
committerRoxie Linden <roxie@lindenlab.com>2010-04-01 21:47:22 -0700
commitaa0a129b6798f8be554d1d9d41cbd217a0040daf (patch)
treea206cf638fa4a8f48dd869e0ccf12b7b6a428972 /indra/newview/llfloatervoicedevicesettings.cpp
parent98695056c2fbfb91de805d9e2a01cde23668c4d3 (diff)
parent86dc5bce1a6fdde1238fea97ca1f6f8acb862184 (diff)
Automated Merge
Diffstat (limited to 'indra/newview/llfloatervoicedevicesettings.cpp')
-rw-r--r--indra/newview/llfloatervoicedevicesettings.cpp41
1 files changed, 17 insertions, 24 deletions
diff --git a/indra/newview/llfloatervoicedevicesettings.cpp b/indra/newview/llfloatervoicedevicesettings.cpp
index 638c9f1b8c..63365e3461 100644
--- a/indra/newview/llfloatervoicedevicesettings.cpp
+++ b/indra/newview/llfloatervoicedevicesettings.cpp
@@ -64,9 +64,6 @@ LLPanelVoiceDeviceSettings::LLPanelVoiceDeviceSettings()
// grab "live" mic volume level
mMicVolume = gSavedSettings.getF32("AudioLevelMic");
- // ask for new device enumeration
- // now do this in onOpen() instead...
- //gVoiceClient->refreshDeviceLists();
}
LLPanelVoiceDeviceSettings::~LLPanelVoiceDeviceSettings()
@@ -105,7 +102,7 @@ void LLPanelVoiceDeviceSettings::draw()
refresh();
// let user know that volume indicator is not yet available
- bool is_in_tuning_mode = gVoiceClient->inTuningMode();
+ bool is_in_tuning_mode = LLVoiceClient::getInstance()->inTuningMode();
childSetVisible("wait_text", !is_in_tuning_mode);
LLPanel::draw();
@@ -113,7 +110,7 @@ void LLPanelVoiceDeviceSettings::draw()
if (is_in_tuning_mode)
{
const S32 num_bars = 5;
- F32 voice_power = gVoiceClient->tuningGetEnergy() / LLVoiceClient::OVERDRIVEN_POWER_LEVEL;
+ F32 voice_power = LLVoiceClient::getInstance()->tuningGetEnergy() / LLVoiceClient::OVERDRIVEN_POWER_LEVEL;
S32 discrete_power = llmin(num_bars, llfloor(voice_power * (F32)num_bars + 0.1f));
for(S32 power_bar_idx = 0; power_bar_idx < num_bars; power_bar_idx++)
@@ -194,13 +191,13 @@ void LLPanelVoiceDeviceSettings::refresh()
LLSlider* volume_slider = getChild<LLSlider>("mic_volume_slider");
// set mic volume tuning slider based on last mic volume setting
F32 current_volume = (F32)volume_slider->getValue().asReal();
- gVoiceClient->tuningSetMicVolume(current_volume);
+ LLVoiceClient::getInstance()->tuningSetMicVolume(current_volume);
// Fill in popup menus
mCtrlInputDevices = getChild<LLComboBox>("voice_input_device");
mCtrlOutputDevices = getChild<LLComboBox>("voice_output_device");
- if(!gVoiceClient->deviceSettingsAvailable())
+ if(!LLVoiceClient::getInstance()->deviceSettingsAvailable())
{
// The combo boxes are disabled, since we can't get the device settings from the daemon just now.
// Put the currently set default (ONLY) in the box, and select it.
@@ -219,17 +216,16 @@ void LLPanelVoiceDeviceSettings::refresh()
}
else if (!mDevicesUpdated)
{
- LLVoiceClient::deviceList *devices;
-
- LLVoiceClient::deviceList::iterator iter;
+ LLVoiceDeviceList::const_iterator iter;
if(mCtrlInputDevices)
{
mCtrlInputDevices->removeall();
mCtrlInputDevices->add( getString("default_text"), ADD_BOTTOM );
- devices = gVoiceClient->getCaptureDevices();
- for(iter=devices->begin(); iter != devices->end(); iter++)
+ for(iter=LLVoiceClient::getInstance()->getCaptureDevices().begin();
+ iter != LLVoiceClient::getInstance()->getCaptureDevices().end();
+ iter++)
{
mCtrlInputDevices->add( *iter, ADD_BOTTOM );
}
@@ -245,8 +241,8 @@ void LLPanelVoiceDeviceSettings::refresh()
mCtrlOutputDevices->removeall();
mCtrlOutputDevices->add( getString("default_text"), ADD_BOTTOM );
- devices = gVoiceClient->getRenderDevices();
- for(iter=devices->begin(); iter != devices->end(); iter++)
+ for(iter= LLVoiceClient::getInstance()->getRenderDevices().begin();
+ iter != LLVoiceClient::getInstance()->getRenderDevices().end(); iter++)
{
mCtrlOutputDevices->add( *iter, ADD_BOTTOM );
}
@@ -268,37 +264,34 @@ void LLPanelVoiceDeviceSettings::initialize()
mDevicesUpdated = FALSE;
// ask for new device enumeration
- gVoiceClient->refreshDeviceLists();
+ LLVoiceClient::getInstance()->refreshDeviceLists();
// put voice client in "tuning" mode
- gVoiceClient->tuningStart();
+ LLVoiceClient::getInstance()->tuningStart();
LLVoiceChannel::suspend();
}
void LLPanelVoiceDeviceSettings::cleanup()
{
- if (gVoiceClient)
- {
- gVoiceClient->tuningStop();
- }
+ LLVoiceClient::getInstance()->tuningStop();
LLVoiceChannel::resume();
}
// static
void LLPanelVoiceDeviceSettings::onCommitInputDevice(LLUICtrl* ctrl, void* user_data)
{
- if(gVoiceClient)
+ if(LLVoiceClient::getInstance())
{
- gVoiceClient->setCaptureDevice(ctrl->getValue().asString());
+ LLVoiceClient::getInstance()->setCaptureDevice(ctrl->getValue().asString());
}
}
// static
void LLPanelVoiceDeviceSettings::onCommitOutputDevice(LLUICtrl* ctrl, void* user_data)
{
- if(gVoiceClient)
+ if(LLVoiceClient::getInstance())
{
- gVoiceClient->setRenderDevice(ctrl->getValue().asString());
+ LLVoiceClient::getInstance()->setRenderDevice(ctrl->getValue().asString());
}
}