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/abstractaudioeffect.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/abstractaudioeffect.cpp')
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractaudioeffect.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp index e3672e6..132eb79 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp @@ -72,7 +72,6 @@ void AbstractAudioEffect::setParameterValue(const Phonon::EffectParameter ¶m if (m_effect.data()) { const EffectParameter& internalParam = internalParameter(param.id()); int err = parameterChanged(internalParam, newValue); - TRAP(err, m_effect->ApplyL()); // TODO: handle audio effect errors Q_UNUSED(err); } @@ -159,5 +158,37 @@ const MMF::EffectParameter& AbstractAudioEffect::internalParameter(int id) const return *result; } +int AbstractAudioEffect::parameterChanged(const EffectParameter ¶m, + const QVariant &value) +{ + int err = 0; + + switch (param.id()) { + case ParameterEnable: + setEnabled(value.toBool()); + break; + default: + { + const EffectParameter& internalParam = internalParameter(param.id()); + err = effectParameterChanged(internalParam, value); + } + break; + } + + if (!err) + TRAP(err, m_effect->ApplyL()); + + return err; +} + +int AbstractAudioEffect::effectParameterChanged( + const EffectParameter ¶m, const QVariant &value) +{ + // Default implementation + Q_ASSERT_X(false, Q_FUNC_INFO, "Effect has no parameters"); + return 0; +} + + QT_END_NAMESPACE |