diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-01-11 18:08:00 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-01-11 18:08:00 (GMT) |
commit | 24392fb62bb34a80eb7ce13662b0a8744c9ab415 (patch) | |
tree | 5cfef2c30f07356e361d8c69948130af364c5b93 /src/3rdparty/phonon/mmf/effectfactory.cpp | |
parent | 5a8c0ded599263446010dfc1729dcab8b2f62f0d (diff) | |
download | Qt-24392fb62bb34a80eb7ce13662b0a8744c9ab415.zip Qt-24392fb62bb34a80eb7ce13662b0a8744c9ab415.tar.gz Qt-24392fb62bb34a80eb7ce13662b0a8744c9ab415.tar.bz2 |
Added enable/disable parameter to each effect in Phonon MMF backend
Task-number: QTBUG-4659
Reviewed-by: Espen Riskedal
Diffstat (limited to 'src/3rdparty/phonon/mmf/effectfactory.cpp')
-rw-r--r-- | src/3rdparty/phonon/mmf/effectfactory.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/3rdparty/phonon/mmf/effectfactory.cpp b/src/3rdparty/phonon/mmf/effectfactory.cpp index 081f6a3..c5e33d5 100644 --- a/src/3rdparty/phonon/mmf/effectfactory.cpp +++ b/src/3rdparty/phonon/mmf/effectfactory.cpp @@ -176,6 +176,13 @@ EffectFactory::EffectData EffectFactory::getData() OutputStreamFactory streamFactory; QScopedPointer<CMdaAudioOutputStream> stream(streamFactory.create()); + EffectParameter param( + /* parameterId */ AbstractAudioEffect::ParameterEnable, + /* name */ tr("Enabled"), + /* hints */ EffectParameter::ToggledHint, + /* defaultValue */ QVariant(bool(true))); + data.m_parameters.append(param); + if (data.m_supported = BackendNode::getParameters (stream.data(), data.m_parameters)) { const QString description = QCoreApplication::translate @@ -185,6 +192,14 @@ EffectFactory::EffectData EffectFactory::getData() data.m_descriptions.insert("available", true); } + // Sanity check to ensure that all parameter IDs are unique + QSet<int> ids; + foreach (param, data.m_parameters) { + Q_ASSERT_X(ids.find(param.id()) == ids.end(), Q_FUNC_INFO, + "Parameter list contains duplicates"); + ids.insert(param.id()); + } + return data; } |