EXT-3394: Reverting removal of prefs volume slider.
This change reverts the code parts of e038c0211968 that relate to the sound preferences slider. Lis has already re-enabled the slider in the panel_preferences_sound.xml XUI file. So the overall change for EXT-3394 is now: - remove the volume slider from the Voice Controls panel - make 50 be the default volume level, not 62master
parent
77aa787c01
commit
d82f82d796
|
|
@ -40,6 +40,7 @@
|
|||
#include "llcombobox.h"
|
||||
#include "llfocusmgr.h"
|
||||
#include "lliconctrl.h"
|
||||
#include "llsliderctrl.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llvoiceclient.h"
|
||||
#include "llvoicechannel.h"
|
||||
|
|
@ -60,6 +61,9 @@ LLPanelVoiceDeviceSettings::LLPanelVoiceDeviceSettings()
|
|||
mOutputDevice = gSavedSettings.getString("VoiceOutputAudioDevice");
|
||||
mDevicesUpdated = FALSE;
|
||||
|
||||
// grab "live" mic volume level
|
||||
mMicVolume = gSavedSettings.getF32("AudioLevelMic");
|
||||
|
||||
// ask for new device enumeration
|
||||
// now do this in onOpen() instead...
|
||||
//gVoiceClient->refreshDeviceLists();
|
||||
|
|
@ -71,6 +75,10 @@ LLPanelVoiceDeviceSettings::~LLPanelVoiceDeviceSettings()
|
|||
|
||||
BOOL LLPanelVoiceDeviceSettings::postBuild()
|
||||
{
|
||||
LLSlider* volume_slider = getChild<LLSlider>("mic_volume_slider");
|
||||
// set mic volume tuning slider based on last mic volume setting
|
||||
volume_slider->setValue(mMicVolume);
|
||||
|
||||
childSetCommitCallback("voice_input_device", onCommitInputDevice, this);
|
||||
childSetCommitCallback("voice_output_device", onCommitOutputDevice, this);
|
||||
|
||||
|
|
@ -149,6 +157,15 @@ void LLPanelVoiceDeviceSettings::apply()
|
|||
gSavedSettings.setString("VoiceOutputAudioDevice", s);
|
||||
mOutputDevice = s;
|
||||
}
|
||||
|
||||
// assume we are being destroyed by closing our embedding window
|
||||
LLSlider* volume_slider = getChild<LLSlider>("mic_volume_slider");
|
||||
if(volume_slider)
|
||||
{
|
||||
F32 slider_value = (F32)volume_slider->getValue().asReal();
|
||||
gSavedSettings.setF32("AudioLevelMic", slider_value);
|
||||
mMicVolume = slider_value;
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelVoiceDeviceSettings::cancel()
|
||||
|
|
@ -161,12 +178,22 @@ void LLPanelVoiceDeviceSettings::cancel()
|
|||
|
||||
if(mCtrlOutputDevices)
|
||||
mCtrlOutputDevices->setSimple(mOutputDevice);
|
||||
|
||||
gSavedSettings.setF32("AudioLevelMic", mMicVolume);
|
||||
LLSlider* volume_slider = getChild<LLSlider>("mic_volume_slider");
|
||||
if(volume_slider)
|
||||
{
|
||||
volume_slider->setValue(mMicVolume);
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelVoiceDeviceSettings::refresh()
|
||||
{
|
||||
// update the live input level display
|
||||
gVoiceClient->tuningSetMicVolume();
|
||||
//grab current volume
|
||||
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);
|
||||
|
||||
// Fill in popup menus
|
||||
mCtrlInputDevices = getChild<LLComboBox>("voice_input_device");
|
||||
|
|
@ -236,6 +263,7 @@ void LLPanelVoiceDeviceSettings::initialize()
|
|||
{
|
||||
mInputDevice = gSavedSettings.getString("VoiceInputAudioDevice");
|
||||
mOutputDevice = gSavedSettings.getString("VoiceOutputAudioDevice");
|
||||
mMicVolume = gSavedSettings.getF32("AudioLevelMic");
|
||||
mDevicesUpdated = FALSE;
|
||||
|
||||
// ask for new device enumeration
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ protected:
|
|||
static void onCommitInputDevice(LLUICtrl* ctrl, void* user_data);
|
||||
static void onCommitOutputDevice(LLUICtrl* ctrl, void* user_data);
|
||||
|
||||
F32 mMicVolume;
|
||||
std::string mInputDevice;
|
||||
std::string mOutputDevice;
|
||||
class LLComboBox *mCtrlInputDevices;
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class LLVoiceClient: public LLSingleton<LLVoiceClient>
|
|||
void tuningCaptureStartSendMessage(int duration);
|
||||
void tuningCaptureStopSendMessage();
|
||||
|
||||
void tuningSetMicVolume(float volume=0.5f);
|
||||
void tuningSetMicVolume(float volume);
|
||||
void tuningSetSpeakerVolume(float volume);
|
||||
float tuningGetEnergy(void);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue