src/multimedia/audio/qaudiodevicefactory.cpp
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
--- a/src/multimedia/audio/qaudiodevicefactory.cpp	Tue Jul 06 15:10:48 2010 +0300
+++ b/src/multimedia/audio/qaudiodevicefactory.cpp	Wed Aug 18 10:37:55 2010 +0300
@@ -67,7 +67,8 @@
 
 QT_BEGIN_NAMESPACE
 
-#ifndef QT_NO_LIBRARY
+
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
 Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
         (QAudioEngineFactoryInterface_iid, QLatin1String("/audio"), Qt::CaseInsensitive))
 #endif
@@ -138,8 +139,7 @@
         devices << QAudioDeviceInfo(QLatin1String("builtin"), handle, mode);
 #endif
 #endif
-
-#ifndef QT_NO_LIBRARY
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     QFactoryLoader* l = loader();
 
     foreach (QString const& key, l->keys()) {
@@ -152,13 +152,12 @@
         delete plugin;
     }
 #endif
-
     return devices;
 }
 
 QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice()
 {
-#ifndef QT_NO_LIBRARY
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     QAudioEngineFactoryInterface* plugin = qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(QLatin1String("default")));
 
     if (plugin) {
@@ -178,7 +177,7 @@
 
 QAudioDeviceInfo QAudioDeviceFactory::defaultOutputDevice()
 {
-#ifndef QT_NO_LIBRARY
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     QAudioEngineFactoryInterface* plugin = qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(QLatin1String("default")));
 
     if (plugin) {
@@ -206,15 +205,13 @@
         return new QAudioDeviceInfoInternal(handle, mode);
 #endif
 #endif
-
-#ifndef QT_NO_LIBRARY
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     QAudioEngineFactoryInterface* plugin =
         qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(realm));
 
     if (plugin)
         rc = plugin->createDeviceInfo(handle, mode);
 #endif
-
     return rc == 0 ? new QNullDeviceInfo() : rc;
 }
 
@@ -238,14 +235,13 @@
         return new QAudioInputPrivate(deviceInfo.handle(), format);
 #endif
 #endif
-#ifndef QT_NO_LIBRARY
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     QAudioEngineFactoryInterface* plugin =
         qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(deviceInfo.realm()));
 
     if (plugin)
         return plugin->createInput(deviceInfo.handle(), format);
 #endif
-
     return new QNullInputDevice();
 }
 
@@ -259,15 +255,13 @@
         return new QAudioOutputPrivate(deviceInfo.handle(), format);
 #endif
 #endif
-
-#ifndef QT_NO_LIBRARY
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     QAudioEngineFactoryInterface* plugin =
         qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(deviceInfo.realm()));
 
     if (plugin)
         return plugin->createOutput(deviceInfo.handle(), format);
 #endif
-
     return new QNullOutputDevice();
 }