diff options
author | Oz Linden <oz@lindenlab.com> | 2018-04-15 09:41:47 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2018-04-15 09:41:47 -0400 |
commit | 4ab4bfb2c7bd79a89b347969c7812db366538ed9 (patch) | |
tree | 686c64391897f8f010dcf6fda5972182fd2fa887 /indra/newview/llpanelvoicedevicesettings.cpp | |
parent | 73b44833a6a801a7bc72810664557e559d54575d (diff) |
VOICE-59: better fix for display human-friendly names for voice input and output devices
Diffstat (limited to 'indra/newview/llpanelvoicedevicesettings.cpp')
-rw-r--r-- | indra/newview/llpanelvoicedevicesettings.cpp | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/indra/newview/llpanelvoicedevicesettings.cpp b/indra/newview/llpanelvoicedevicesettings.cpp index 3dfa559dac..28631e2b7b 100644 --- a/indra/newview/llpanelvoicedevicesettings.cpp +++ b/indra/newview/llpanelvoicedevicesettings.cpp @@ -38,8 +38,6 @@ // 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"); @@ -234,25 +232,18 @@ void LLPanelVoiceDeviceSettings::refresh() } else if (LLVoiceClient::getInstance()->deviceSettingsUpdated()) { - LLVoiceDeviceList::const_iterator iter; + LLVoiceDeviceList::const_iterator device; if(mCtrlInputDevices) { mCtrlInputDevices->removeall(); mCtrlInputDevices->add(getLocalizedDeviceName(DEFAULT_DEVICE), DEFAULT_DEVICE, ADD_BOTTOM); - for(iter=LLVoiceClient::getInstance()->getCaptureDevices().begin(); - iter != LLVoiceClient::getInstance()->getCaptureDevices().end(); - iter++) + for(device=LLVoiceClient::getInstance()->getCaptureDevices().begin(); + device != LLVoiceClient::getInstance()->getCaptureDevices().end(); + device++) { - // 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); + mCtrlInputDevices->add(getLocalizedDeviceName(device->display_name), device->full_name, ADD_BOTTOM); } // Fix invalid input audio device preference. @@ -269,17 +260,11 @@ void LLPanelVoiceDeviceSettings::refresh() mCtrlOutputDevices->removeall(); mCtrlOutputDevices->add(getLocalizedDeviceName(DEFAULT_DEVICE), DEFAULT_DEVICE, ADD_BOTTOM); - for(iter= LLVoiceClient::getInstance()->getRenderDevices().begin(); - iter != LLVoiceClient::getInstance()->getRenderDevices().end(); iter++) + for(device = LLVoiceClient::getInstance()->getRenderDevices().begin(); + device != LLVoiceClient::getInstance()->getRenderDevices().end(); + device++) { - // 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); + mCtrlOutputDevices->add(getLocalizedDeviceName(device->display_name), device->full_name, ADD_BOTTOM); } // Fix invalid output audio device preference. |