diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfloatervoicedevicesettings.cpp | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/linden/indra/newview/llfloatervoicedevicesettings.cpp b/linden/indra/newview/llfloatervoicedevicesettings.cpp index 7ffaa73..ad9d776 100644 --- a/linden/indra/newview/llfloatervoicedevicesettings.cpp +++ b/linden/indra/newview/llfloatervoicedevicesettings.cpp | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * $LicenseInfo:firstyear=2007&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2007&license=viewergpl$ |
7 | * | 7 | * |
8 | * Copyright (c) 2007-2008, Linden Research, Inc. | 8 | * Copyright (c) 2007-2009, Linden Research, Inc. |
9 | * | 9 | * |
10 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
11 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -85,14 +85,15 @@ BOOL LLPanelVoiceDeviceSettings::postBuild() | |||
85 | void LLPanelVoiceDeviceSettings::draw() | 85 | void LLPanelVoiceDeviceSettings::draw() |
86 | { | 86 | { |
87 | // let user know that volume indicator is not yet available | 87 | // let user know that volume indicator is not yet available |
88 | childSetVisible("wait_text", !gVoiceClient->inTuningMode()); | 88 | bool is_in_tuning_mode = gVoiceClient->inTuningMode(); |
89 | childSetVisible("wait_text", !is_in_tuning_mode); | ||
89 | 90 | ||
90 | LLPanel::draw(); | 91 | LLPanel::draw(); |
91 | 92 | ||
92 | F32 voice_power = gVoiceClient->tuningGetEnergy(); | 93 | F32 voice_power = gVoiceClient->tuningGetEnergy(); |
93 | S32 discrete_power = 0; | 94 | S32 discrete_power = 0; |
94 | 95 | ||
95 | if (!gVoiceClient->inTuningMode()) | 96 | if (!is_in_tuning_mode) |
96 | { | 97 | { |
97 | discrete_power = 0; | 98 | discrete_power = 0; |
98 | } | 99 | } |
@@ -101,7 +102,7 @@ void LLPanelVoiceDeviceSettings::draw() | |||
101 | discrete_power = llmin(4, llfloor((voice_power / LLVoiceClient::OVERDRIVEN_POWER_LEVEL) * 4.f)); | 102 | discrete_power = llmin(4, llfloor((voice_power / LLVoiceClient::OVERDRIVEN_POWER_LEVEL) * 4.f)); |
102 | } | 103 | } |
103 | 104 | ||
104 | if (gVoiceClient->inTuningMode()) | 105 | if (is_in_tuning_mode) |
105 | { | 106 | { |
106 | for(S32 power_bar_idx = 0; power_bar_idx < 5; power_bar_idx++) | 107 | for(S32 power_bar_idx = 0; power_bar_idx < 5; power_bar_idx++) |
107 | { | 108 | { |
@@ -136,7 +137,11 @@ void LLPanelVoiceDeviceSettings::apply() | |||
136 | } | 137 | } |
137 | 138 | ||
138 | // assume we are being destroyed by closing our embedding window | 139 | // assume we are being destroyed by closing our embedding window |
139 | gSavedSettings.setF32("AudioLevelMic", mMicVolume); | 140 | LLSlider* volume_slider = getChild<LLSlider>("mic_volume_slider"); |
141 | if(volume_slider) | ||
142 | { | ||
143 | gSavedSettings.setF32("AudioLevelMic", (F32)volume_slider->getValue().asReal()); | ||
144 | } | ||
140 | } | 145 | } |
141 | 146 | ||
142 | void LLPanelVoiceDeviceSettings::cancel() | 147 | void LLPanelVoiceDeviceSettings::cancel() |
@@ -149,6 +154,13 @@ void LLPanelVoiceDeviceSettings::cancel() | |||
149 | 154 | ||
150 | if(mCtrlOutputDevices) | 155 | if(mCtrlOutputDevices) |
151 | mCtrlOutputDevices->setSimple(mOutputDevice); | 156 | mCtrlOutputDevices->setSimple(mOutputDevice); |
157 | |||
158 | gSavedSettings.setF32("AudioLevelMic", mMicVolume); | ||
159 | LLSlider* volume_slider = getChild<LLSlider>("mic_volume_slider"); | ||
160 | if(volume_slider) | ||
161 | { | ||
162 | volume_slider->setValue(mMicVolume); | ||
163 | } | ||
152 | } | 164 | } |
153 | 165 | ||
154 | void LLPanelVoiceDeviceSettings::refresh() | 166 | void LLPanelVoiceDeviceSettings::refresh() |
@@ -156,8 +168,8 @@ void LLPanelVoiceDeviceSettings::refresh() | |||
156 | //grab current volume | 168 | //grab current volume |
157 | LLSlider* volume_slider = getChild<LLSlider>("mic_volume_slider"); | 169 | LLSlider* volume_slider = getChild<LLSlider>("mic_volume_slider"); |
158 | // set mic volume tuning slider based on last mic volume setting | 170 | // set mic volume tuning slider based on last mic volume setting |
159 | mMicVolume = (F32)volume_slider->getValue().asReal(); | 171 | F32 current_volume = (F32)volume_slider->getValue().asReal(); |
160 | gVoiceClient->tuningSetMicVolume(mMicVolume); | 172 | gVoiceClient->tuningSetMicVolume(current_volume); |
161 | 173 | ||
162 | // Fill in popup menus | 174 | // Fill in popup menus |
163 | mCtrlInputDevices = getChild<LLComboBox>("voice_input_device"); | 175 | mCtrlInputDevices = getChild<LLComboBox>("voice_input_device"); |
@@ -247,13 +259,19 @@ void LLPanelVoiceDeviceSettings::onClose(bool app_quitting) | |||
247 | // static | 259 | // static |
248 | void LLPanelVoiceDeviceSettings::onCommitInputDevice(LLUICtrl* ctrl, void* user_data) | 260 | void LLPanelVoiceDeviceSettings::onCommitInputDevice(LLUICtrl* ctrl, void* user_data) |
249 | { | 261 | { |
250 | gSavedSettings.setString("VoiceInputAudioDevice", ctrl->getValue().asString()); | 262 | if(gVoiceClient) |
263 | { | ||
264 | gVoiceClient->setCaptureDevice(ctrl->getValue().asString()); | ||
265 | } | ||
251 | } | 266 | } |
252 | 267 | ||
253 | // static | 268 | // static |
254 | void LLPanelVoiceDeviceSettings::onCommitOutputDevice(LLUICtrl* ctrl, void* user_data) | 269 | void LLPanelVoiceDeviceSettings::onCommitOutputDevice(LLUICtrl* ctrl, void* user_data) |
255 | { | 270 | { |
256 | gSavedSettings.setString("VoiceOutputAudioDevice", ctrl->getValue().asString()); | 271 | if(gVoiceClient) |
272 | { | ||
273 | gVoiceClient->setRenderDevice(ctrl->getValue().asString()); | ||
274 | } | ||
257 | } | 275 | } |
258 | 276 | ||
259 | // | 277 | // |