aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamian Huckle <damianhuckle@hotmail.com>2012-09-29 20:55:18 -0400
committerDamian Huckle <damianhuckle@hotmail.com>2012-09-29 20:57:43 -0400
commit4c9b6ddd8eadf1925248fb945db10e66e2a8ebfa (patch)
tree0121752703e9ce30aedadd8a3c91f0e79bc524e6
parenteadf49da06b3060c1e5c579506d5c691ba52c389 (diff)
[AE][SoftAE] Show friendly name of device
-rw-r--r--xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp25
-rw-r--r--xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h3
2 files changed, 27 insertions, 1 deletions
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
index f34a99998b..49051e12c0 100644
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
@@ -315,6 +315,9 @@ void CSoftAE::InternalOpenSink()
m_sink = NULL;
}
+ /* get the display name of the device */
+ GetDeviceFriendlyName(device);
+
/* if we already have a driver, prepend it to the device string */
if (!driver.empty())
device = driver + ":" + device;
@@ -331,7 +334,7 @@ void CSoftAE::InternalOpenSink()
ASSERT(newFormat.m_sampleRate > 0);
CLog::Log(LOGINFO, "CSoftAE::InternalOpenSink - %s Initialized:", m_sink->GetName());
- CLog::Log(LOGINFO, " Output Device : %s", device.c_str());
+ CLog::Log(LOGINFO, " Output Device : %s", m_deviceFriendlyName.c_str());
CLog::Log(LOGINFO, " Sample Rate : %d", newFormat.m_sampleRate);
CLog::Log(LOGINFO, " Sample Format : %s", CAEUtil::DataFormatToStr(newFormat.m_dataFormat));
CLog::Log(LOGINFO, " Channel Count : %d", newFormat.m_channelLayout.Count());
@@ -606,6 +609,26 @@ void CSoftAE::VerifySoundDevice(std::string& device, bool passthrough)
device = firstDevice;
}
+inline void CSoftAE::GetDeviceFriendlyName(std::string &device)
+{
+ m_deviceFriendlyName = "Device not found";
+ /* Match the device and find its friendly name */
+ for (AESinkInfoList::iterator itt = m_sinkInfoList.begin(); itt != m_sinkInfoList.end(); ++itt)
+ {
+ AESinkInfo sinkInfo = *itt;
+ for (AEDeviceInfoList::iterator itt2 = sinkInfo.m_deviceInfoList.begin(); itt2 != sinkInfo.m_deviceInfoList.end(); ++itt2)
+ {
+ CAEDeviceInfo& devInfo = *itt2;
+ if (devInfo.m_deviceName == device)
+ {
+ m_deviceFriendlyName = devInfo.m_displayName;
+ break;
+ }
+ }
+ }
+ return;
+}
+
void CSoftAE::Deinitialize()
{
if (m_thread)
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
index 742359a13d..d7c2f7184d 100644
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
@@ -120,12 +120,15 @@ private:
bool SetupEncoder(AEAudioFormat &format);
void Deinitialize();
+ inline void GetDeviceFriendlyName(std::string &device);
+
IAESink *GetSink(AEAudioFormat &desiredFormat, bool passthrough, std::string &device);
void StopAllSounds();
enum AEStdChLayout m_stdChLayout;
std::string m_device;
std::string m_passthroughDevice;
+ std::string m_deviceFriendlyName;
bool m_audiophile;
bool m_stereoUpmix;