summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2009-11-10 08:56:29 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2009-11-12 14:22:08 (GMT)
commitfbf5e7b103626bb07fbb43449eaf014bdd299939 (patch)
treed8688484856cb8db1602fdd568193d4ddbea2dc9
parente0cd364f5b43c7b18214a605c7a5e1bb99c128a1 (diff)
downloadQt-fbf5e7b103626bb07fbb43449eaf014bdd299939.zip
Qt-fbf5e7b103626bb07fbb43449eaf014bdd299939.tar.gz
Qt-fbf5e7b103626bb07fbb43449eaf014bdd299939.tar.bz2
Fix QT_NO_PHONON_SETTINGSGROUP
Reviewed-by: paul
-rw-r--r--src/3rdparty/phonon/phonon/audiooutput.cpp6
-rw-r--r--src/3rdparty/phonon/phonon/backendcapabilities.cpp2
-rw-r--r--src/3rdparty/phonon/phonon/globalconfig.cpp10
3 files changed, 14 insertions, 4 deletions
diff --git a/src/3rdparty/phonon/phonon/audiooutput.cpp b/src/3rdparty/phonon/phonon/audiooutput.cpp
index 00b2ebd..962f828 100644
--- a/src/3rdparty/phonon/phonon/audiooutput.cpp
+++ b/src/3rdparty/phonon/phonon/audiooutput.cpp
@@ -257,6 +257,7 @@ void AudioOutputPrivate::setupBackendObject()
// set up attributes
pINTERFACE_CALL(setVolume(pow(volume, VOLTAGE_TO_LOUDNESS_EXPONENT)));
+#ifndef QT_NO_PHONON_SETTINGSGROUP
// if the output device is not available and the device was not explicitly set
if (!callSetOutputDevice(this, device) && !outputDeviceOverridden) {
// fall back in the preference list of output devices
@@ -276,6 +277,7 @@ void AudioOutputPrivate::setupBackendObject()
callSetOutputDevice(this, none);
handleAutomaticDeviceChange(none, FallbackChange);
}
+#endif //QT_NO_PHONON_SETTINGSGROUP
}
void AudioOutputPrivate::_k_volumeChanged(qreal newVolume)
@@ -305,6 +307,7 @@ void AudioOutputPrivate::_k_audioDeviceFailed()
pDebug() << Q_FUNC_INFO;
// outputDeviceIndex identifies a failing device
// fall back in the preference list of output devices
+#ifndef QT_NO_PHONON_SETTINGSGROUP
const QList<int> deviceList = GlobalConfig().audioOutputDeviceListFor(category, GlobalConfig::AdvancedDevicesFromSettings | GlobalConfig::HideUnavailableDevices);
for (int i = 0; i < deviceList.count(); ++i) {
const int devIndex = deviceList.at(i);
@@ -317,6 +320,7 @@ void AudioOutputPrivate::_k_audioDeviceFailed()
}
}
}
+#endif //QT_NO_PHONON_SETTINGSGROUP
// if we get here there is no working output device. Tell the backend.
const AudioOutputDevice none;
callSetOutputDevice(this, none);
@@ -326,6 +330,7 @@ void AudioOutputPrivate::_k_audioDeviceFailed()
void AudioOutputPrivate::_k_deviceListChanged()
{
pDebug() << Q_FUNC_INFO;
+#ifndef QT_NO_PHONON_SETTINGSGROUP
// let's see if there's a usable device higher in the preference list
const QList<int> deviceList = GlobalConfig().audioOutputDeviceListFor(category, GlobalConfig::AdvancedDevicesFromSettings);
DeviceChangeType changeType = HigherPreferenceChange;
@@ -351,6 +356,7 @@ void AudioOutputPrivate::_k_deviceListChanged()
break; // found one with higher preference that works
}
}
+#endif //QT_NO_PHONON_SETTINGSGROUP
}
static struct
diff --git a/src/3rdparty/phonon/phonon/backendcapabilities.cpp b/src/3rdparty/phonon/phonon/backendcapabilities.cpp
index 62c9cc9..5defe09 100644
--- a/src/3rdparty/phonon/phonon/backendcapabilities.cpp
+++ b/src/3rdparty/phonon/phonon/backendcapabilities.cpp
@@ -75,10 +75,12 @@ bool BackendCapabilities::isMimeTypeAvailable(const QString &mimeType)
QList<AudioOutputDevice> BackendCapabilities::availableAudioOutputDevices()
{
QList<AudioOutputDevice> ret;
+#ifndef QT_NO_PHONON_SETTINGSGROUP
const QList<int> deviceIndexes = GlobalConfig().audioOutputDeviceListFor(Phonon::NoCategory);
for (int i = 0; i < deviceIndexes.count(); ++i) {
ret.append(AudioOutputDevice::fromIndex(deviceIndexes.at(i)));
}
+#endif //QT_NO_PHONON_SETTINGSGROUP
return ret;
}
diff --git a/src/3rdparty/phonon/phonon/globalconfig.cpp b/src/3rdparty/phonon/phonon/globalconfig.cpp
index 3718c6a..429a29f 100644
--- a/src/3rdparty/phonon/phonon/globalconfig.cpp
+++ b/src/3rdparty/phonon/phonon/globalconfig.cpp
@@ -178,13 +178,15 @@ QList<int> GlobalConfig::audioOutputDeviceListFor(Phonon::Category category, int
return listSortedByConfig(backendConfig, category, defaultList);
}
-#endif //QT_NO_SETTINGSGROUPS
+#endif //QT_NO_PHONON_SETTINGSGROUP
int GlobalConfig::audioOutputDeviceFor(Phonon::Category category, int override) const
{
+#ifndef QT_NO_PHONON_SETTINGSGROUP
QList<int> ret = audioOutputDeviceListFor(category, override);
- if (ret.isEmpty())
- return -1;
- return ret.first();
+ if (!ret.isEmpty())
+ return ret.first();
+#endif //QT_NO_PHONON_SETTINGSGROUP
+ return -1;
}
#ifndef QT_NO_PHONON_AUDIOCAPTURE