diff options
author | Frans Englich <frans.englich@nokia.com> | 2009-09-06 23:22:32 (GMT) |
---|---|---|
committer | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-09-09 15:30:19 (GMT) |
commit | c4fb0864e229ff33e4b454c74116573a9ea79054 (patch) | |
tree | 15b70bac51904b01c1885c103bb69a6d95551b6c /src/3rdparty/phonon/mmf/abstractaudioeffect.cpp | |
parent | 7d2d15bbc9d598daf94800b576aff19a68119ed1 (diff) | |
download | Qt-c4fb0864e229ff33e4b454c74116573a9ea79054.zip Qt-c4fb0864e229ff33e4b454c74116573a9ea79054.tar.gz Qt-c4fb0864e229ff33e4b454c74116573a9ea79054.tar.bz2 |
Make the MediaObject propagation generic for all kinds of nodes.
Previously the MediaObject propagation was only done for effects, but now it's
for all kinds of nodes. This is needed for AudioOutput.
Diffstat (limited to 'src/3rdparty/phonon/mmf/abstractaudioeffect.cpp')
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractaudioeffect.cpp | 50 |
1 files changed, 10 insertions, 40 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp index 4c876e1..665b9e4 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp @@ -29,7 +29,6 @@ using namespace Phonon::MMF; AbstractAudioEffect::AbstractAudioEffect(QObject *parent, const QList<EffectParameter> ¶ms) : MediaNode::MediaNode(parent) , m_params(params) - , m_isApplied(false) { } @@ -55,50 +54,21 @@ QVariant AbstractAudioEffect::parameterValue(const EffectParameter &queriedParam return val; } -void AbstractAudioEffect::setParameterValue(const EffectParameter ¶m, - const QVariant &newValue) +bool AbstractAudioEffect::activateOnMediaObject(MediaObject *mo) { - m_values.insert(param.id(), newValue); - parameterChanged(param.id(), newValue); -} + AudioPlayer *const ap = qobject_cast<AudioPlayer *>(mo->abstractPlayer()); -bool AbstractAudioEffect::activateBackwardsInChain(MediaNode *target) -{ - // TODO we need to walk forward too. - MediaNode *current = target; - - while (current) { - MMF::MediaObject *const mo = qobject_cast<MMF::MediaObject *>(current); - if(!mo) - continue; - - AudioPlayer *const ap = qobject_cast<AudioPlayer *>(mo->abstractPlayer()); - - if (ap) { - activateOn(ap->player()); - // There might be stuff before the mediaobject, but - // that's undefined for us. - return true; - } - else - current = current->source(); - } - - return false; + if (ap) + return activateOn(ap->player()); + else + return true; } -bool AbstractAudioEffect::connectMediaNode(MediaNode *target) +void AbstractAudioEffect::setParameterValue(const EffectParameter ¶m, + const QVariant &newValue) { - /** - * We first call this function, so source() and target() - * is properly set up. - */ - MediaNode::connectMediaNode(target); - - if (!m_isApplied && activateBackwardsInChain(target)) - m_isApplied = true; - - return true; + m_values.insert(param.id(), newValue); + parameterChanged(param.id(), newValue); } QT_END_NAMESPACE |