All pastes #794819 Raw Edit

Unnamed

public text v1 · immutable
#794819 ·published 2007-11-23 13:10 UTC
rendered paste body
Index: backendcapabilities.cpp
===================================================================
--- backendcapabilities.cpp     (revision 740499)
+++ backendcapabilities.cpp     (working copy)
@@ -23,6 +23,7 @@
 #include "phonondefs_p.h"
 #include "backendinterface.h"
 #include "factory.h"
+#include "globalconfig.h"
 #include "globalstatic_p.h"
 #include "objectdescription.h"

@@ -118,7 +119,20 @@
     qSort(ret.begin(), ret.end(), sortByInitialPreference<T ## Description>); \
     return ret; \
 }
-availableDevicesImpl(AudioOutputDevice)
+
+QList<AudioOutputDevice> BackendCapabilities::availableAudioOutputDevices()
+{
+    BackendInterface *backendIface = qobject_cast<BackendInterface *>(Factory::backend());
+    QList<AudioOutputDevice> ret;
+    if (backendIface) {
+        QList<int> deviceIndexes = GlobalConfig().audioOutputDeviceListFor(Phonon::NoCategory); // backendIface->objectDescriptionIndexes(Phonon::AudioOutputDeviceType);
+        foreach (int i, deviceIndexes)
+            ret.append(AudioOutputDevice::fromIndex(i));
+    }
+    //qSort(ret.begin(), ret.end(), sortByInitialPreference<AudioOutputDevice>);
+    return ret;
+}
+
 /*availableDevicesImpl(AudioCaptureDevice)
 availableDevicesImpl(VideoOutputDevice)
 availableDevicesImpl(VideoCaptureDevice)