summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-01-11 16:05:17 (GMT)
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-01-11 16:30:44 (GMT)
commit99acb8f8e53767e59a5634609b0d3582ae5b0d7c (patch)
tree15c8149eac6f3389b7f3f0430e845f99cb037848 /src/3rdparty/phonon/mmf/abstractaudioeffect.cpp
parentaefcf35b4e4dd62771b9fe531c84d35e13f2c660 (diff)
downloadQt-99acb8f8e53767e59a5634609b0d3582ae5b0d7c.zip
Qt-99acb8f8e53767e59a5634609b0d3582ae5b0d7c.tar.gz
Qt-99acb8f8e53767e59a5634609b0d3582ae5b0d7c.tar.bz2
Refactored AbstractAudioEffect to reduce redundancy in derived classes
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.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp
index cdddf02..3bce86b 100644
--- a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp
+++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp
@@ -70,7 +70,8 @@ void AbstractAudioEffect::setParameterValue(const Phonon::EffectParameter &param
m_values.insert(param.id(), newValue);
if (m_effect.data()) {
- parameterChanged(param.id(), newValue);
+ const EffectParameter& internalParam = internalParameter(param.id());
+ parameterChanged(internalParam, newValue);
// TODO: handle audio effect errors
TRAP_IGNORE(m_effect->ApplyL());
}
@@ -122,11 +123,27 @@ void AbstractAudioEffect::createEffect()
}
if (m_effect.data()) {
- applyParameters();
+ EffectParameter param;
+ foreach (param, m_params) {
+ const QVariant value = parameterValue(param);
+ parameterChanged(param, value);
+ }
+
// TODO: handle audio effect errors
TRAP_IGNORE(m_effect->EnableL());
}
}
+const MMF::EffectParameter& AbstractAudioEffect::internalParameter(int id) const
+{
+ const EffectParameter *result = 0;
+ for (int i=0; i<m_params.count() && !result; ++i) {
+ if (m_params[i].id() == id)
+ result = &m_params[i];
+ }
+ Q_ASSERT_X(result, Q_FUNC_INFO, "Parameter not found");
+ return *result;
+}
+
QT_END_NAMESPACE