summaryrefslogtreecommitdiffstats
path: root/src/multimedia/audio
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2009-12-09 00:31:53 (GMT)
committerKurt Korbatits <kurt.korbatits@nokia.com>2009-12-09 00:31:53 (GMT)
commitf814791b18df3ba0828fefa9f40b2fc955185daf (patch)
tree95dbffda90569c126bb11f43d8ec8b788c437a09 /src/multimedia/audio
parentb70f9d3969fdf7789ba1c5f4d942b2625b1bf689 (diff)
downloadQt-f814791b18df3ba0828fefa9f40b2fc955185daf.zip
Qt-f814791b18df3ba0828fefa9f40b2fc955185daf.tar.gz
Qt-f814791b18df3ba0828fefa9f40b2fc955185daf.tar.bz2
Add -audio-backend and -no-audio-backend configure option.
Allow better control over audio backend used. Reviewed-by:Justin McPherson
Diffstat (limited to 'src/multimedia/audio')
-rw-r--r--src/multimedia/audio/audio.pri5
-rw-r--r--src/multimedia/audio/qaudiodevicefactory.cpp14
2 files changed, 19 insertions, 0 deletions
diff --git a/src/multimedia/audio/audio.pri b/src/multimedia/audio/audio.pri
index c445941..625b871c 100644
--- a/src/multimedia/audio/audio.pri
+++ b/src/multimedia/audio/audio.pri
@@ -17,6 +17,8 @@ SOURCES += $$PWD/qaudio.cpp \
$$PWD/qaudioengine.cpp \
$$PWD/qaudiodevicefactory.cpp
+contains(QT_CONFIG, audio-backend) {
+
mac {
HEADERS += $$PWD/qaudioinput_mac_p.h \
$$PWD/qaudiooutput_mac_p.h \
@@ -51,3 +53,6 @@ mac {
}
}
}
+} else {
+ DEFINES += QT_NO_AUDIO_BACKEND
+}
diff --git a/src/multimedia/audio/qaudiodevicefactory.cpp b/src/multimedia/audio/qaudiodevicefactory.cpp
index 89e4394..bc1656d 100644
--- a/src/multimedia/audio/qaudiodevicefactory.cpp
+++ b/src/multimedia/audio/qaudiodevicefactory.cpp
@@ -45,6 +45,7 @@
#include <private/qfactoryloader_p.h>
#include "qaudiodevicefactory_p.h"
+#ifndef QT_NO_AUDIO_BACKEND
#if defined(Q_OS_WIN)
#include "qaudiodeviceinfo_win32_p.h"
#include "qaudiooutput_win32_p.h"
@@ -58,6 +59,7 @@
#include "qaudiooutput_alsa_p.h"
#include "qaudioinput_alsa_p.h"
#endif
+#endif
QT_BEGIN_NAMESPACE
@@ -125,10 +127,12 @@ public:
QList<QAudioDeviceInfo> QAudioDeviceFactory::availableDevices(QAudio::Mode mode)
{
QList<QAudioDeviceInfo> devices;
+#ifndef QT_NO_AUDIO_BACKEND
#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA))
foreach (const QByteArray &handle, QAudioDeviceInfoInternal::availableDevices(mode))
devices << QAudioDeviceInfo(QLatin1String("builtin"), handle, mode);
#endif
+#endif
QFactoryLoader* l = loader();
foreach (QString const& key, l->keys()) {
@@ -153,9 +157,11 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice()
if (list.size() > 0)
return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioInput);
}
+#ifndef QT_NO_AUDIO_BACKEND
#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA))
return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultInputDevice(), QAudio::AudioInput);
#endif
+#endif
return QAudioDeviceInfo();
}
@@ -168,9 +174,11 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultOutputDevice()
if (list.size() > 0)
return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioOutput);
}
+#ifndef QT_NO_AUDIO_BACKEND
#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA))
return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultOutputDevice(), QAudio::AudioOutput);
#endif
+#endif
return QAudioDeviceInfo();
}
@@ -178,10 +186,12 @@ QAbstractAudioDeviceInfo* QAudioDeviceFactory::audioDeviceInfo(const QString &re
{
QAbstractAudioDeviceInfo *rc = 0;
+#ifndef QT_NO_AUDIO_BACKEND
#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA))
if (realm == QLatin1String("builtin"))
return new QAudioDeviceInfoInternal(handle, mode);
#endif
+#endif
QAudioEngineFactoryInterface* plugin =
qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(realm));
@@ -205,10 +215,12 @@ QAbstractAudioInput* QAudioDeviceFactory::createInputDevice(QAudioDeviceInfo con
{
if (deviceInfo.isNull())
return new QNullInputDevice();
+#ifndef QT_NO_AUDIO_BACKEND
#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA))
if (deviceInfo.realm() == QLatin1String("builtin"))
return new QAudioInputPrivate(deviceInfo.handle(), format);
#endif
+#endif
QAudioEngineFactoryInterface* plugin =
qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(deviceInfo.realm()));
@@ -222,10 +234,12 @@ QAbstractAudioOutput* QAudioDeviceFactory::createOutputDevice(QAudioDeviceInfo c
{
if (deviceInfo.isNull())
return new QNullOutputDevice();
+#ifndef QT_NO_AUDIO_BACKEND
#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA))
if (deviceInfo.realm() == QLatin1String("builtin"))
return new QAudioOutputPrivate(deviceInfo.handle(), format);
#endif
+#endif
QAudioEngineFactoryInterface* plugin =
qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(deviceInfo.realm()));