summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelvoicedevicesettings.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2018-04-13 20:34:10 -0400
committerOz Linden <oz@lindenlab.com>2018-04-13 20:34:10 -0400
commit73b44833a6a801a7bc72810664557e559d54575d (patch)
treee8a1582e1c65fd1cad68367474ceace422b002ab /indra/newview/llpanelvoicedevicesettings.cpp
parentd71da863c9341aeaa64ec64119601d158affe747 (diff)
VOICE-59: display human-friendly names for voice input and output devices
Diffstat (limited to 'indra/newview/llpanelvoicedevicesettings.cpp')
-rw-r--r--indra/newview/llpanelvoicedevicesettings.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/indra/newview/llpanelvoicedevicesettings.cpp b/indra/newview/llpanelvoicedevicesettings.cpp
index 07f8045546..3dfa559dac 100644
--- a/indra/newview/llpanelvoicedevicesettings.cpp
+++ b/indra/newview/llpanelvoicedevicesettings.cpp
@@ -38,7 +38,8 @@
// Library includes (after viewer)
#include "lluictrlfactory.h"
-
+#include "llmemorystream.h"
+#include "llsdserialize.h"
static LLPanelInjector<LLPanelVoiceDeviceSettings> t_panel_group_general("panel_voice_device_settings");
static const std::string DEFAULT_DEVICE("Default");
@@ -244,7 +245,14 @@ void LLPanelVoiceDeviceSettings::refresh()
iter != LLVoiceClient::getInstance()->getCaptureDevices().end();
iter++)
{
- mCtrlInputDevices->add(getLocalizedDeviceName(*iter), *iter, ADD_BOTTOM);
+ // the devices in the list are serialized as an LLSD map
+ // deserialize to separate the display and device names
+ std::string device_names(*iter);
+ size_t len = device_names.size();
+ LLMemoryStream device_stream((U8*)device_names.c_str(), len);
+ LLSD device = LLSDSerialize::fromNotation(device_stream, len);
+
+ mCtrlInputDevices->add(getLocalizedDeviceName(device["display"]), device["device"], ADD_BOTTOM);
}
// Fix invalid input audio device preference.
@@ -264,7 +272,14 @@ void LLPanelVoiceDeviceSettings::refresh()
for(iter= LLVoiceClient::getInstance()->getRenderDevices().begin();
iter != LLVoiceClient::getInstance()->getRenderDevices().end(); iter++)
{
- mCtrlOutputDevices->add(getLocalizedDeviceName(*iter), *iter, ADD_BOTTOM);
+ // the devices in the list are serialized as an LLSD map
+ // deserialize to separate the display and device names
+ std::string device_names(*iter);
+ size_t len = device_names.size();
+ LLMemoryStream device_stream((U8*)device_names.c_str(), len);
+ LLSD device = LLSDSerialize::fromNotation(device_stream, len);
+
+ mCtrlOutputDevices->add(getLocalizedDeviceName(device["display"]), device["display"], ADD_BOTTOM);
}
// Fix invalid output audio device preference.