Permalink
Browse files

[SoftAE] Add support for EnumerateOutputDevicesEx to SoftAE

  • Loading branch information...
1 parent 6d47c83 commit 672ca92fb57d19d815bebc47751138885fb67ddb @Karlson2k committed Oct 18, 2012
Showing with 32 additions and 0 deletions.
  1. +31 −0 xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
  2. +1 −0 xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
@@ -688,6 +688,37 @@ void CSoftAE::EnumerateOutputDevices(AEDeviceList &devices, bool passthrough)
}
}
+bool CSoftAE::EnumerateOutputDevicesEx(std::vector<AEDeviceEx> &devices, bool passthrough)
+{
+ 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;
+ AEDeviceEx dev;
+ if (passthrough && !devInfo.SupportsRaw())
+ continue;
+
+ dev.m_DeviceType = devInfo.m_deviceType;
+ dev.m_DeviceName = devInfo.GetAEDeviceName();
+ dev.m_SupportedDataFormats = devInfo.m_dataFormats;
+
+ /* add the sink name if we have more then one sink type */
+ if (m_sinkInfoList.size() > 1)
+ dev.m_DisplayName = sinkInfo.m_sinkName + ":";
+
+ dev.m_DisplayName += devInfo.m_displayName;
+
+ if (!devInfo.m_displayNameExtra.empty())
+ dev.m_DisplayName += ", " + devInfo.m_displayNameExtra;
+
+ devices.push_back(dev);
+ }
+ }
+ return true;
+}
+
std::string CSoftAE::GetDefaultDevice(bool passthrough)
{
for (AESinkInfoList::iterator itt = m_sinkInfoList.begin(); itt != m_sinkInfoList.end(); ++itt)
@@ -99,6 +99,7 @@ class CSoftAE : public IThreadedAE
double GetCacheTotal();
virtual void EnumerateOutputDevices(AEDeviceList &devices, bool passthrough);
+ virtual bool EnumerateOutputDevicesEx(std::vector<AEDeviceEx> &devices, bool passthrough);
virtual std::string GetDefaultDevice(bool passthrough);
virtual bool SupportsRaw();

0 comments on commit 672ca92

Please sign in to comment.