diff options
author | Frans Englich <frans.englich@nokia.com> | 2009-08-26 14:36:32 (GMT) |
---|---|---|
committer | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-09-09 13:35:38 (GMT) |
commit | 7d2d15bbc9d598daf94800b576aff19a68119ed1 (patch) | |
tree | 61f881bda38b0559db6543ed87b55089e64ef25e /src/3rdparty/phonon/mmf/mediaobject.cpp | |
parent | c4d341ecf26d63cc7410756f8f7d1926c277f02f (diff) | |
download | Qt-7d2d15bbc9d598daf94800b576aff19a68119ed1.zip Qt-7d2d15bbc9d598daf94800b576aff19a68119ed1.tar.gz Qt-7d2d15bbc9d598daf94800b576aff19a68119ed1.tar.bz2 |
Work on extending the framework for accomodating effects.
This extends the framework for being able to handle audio effects, largely
affecting how the audio chain is set up, connected and disconnected, and
therefore the Backend has been refactored slightly, and the class MediaNode
introduced, see its documentation.
In addition two effects has been written: BassBoost and AudioEqualizer.
Diffstat (limited to 'src/3rdparty/phonon/mmf/mediaobject.cpp')
-rw-r--r-- | src/3rdparty/phonon/mmf/mediaobject.cpp | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp index a2a7e4d..4c7dc6d 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.cpp +++ b/src/3rdparty/phonon/mmf/mediaobject.cpp @@ -16,12 +16,16 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. */ +#include "audiooutput.h" #include "audioplayer.h" #include "defs.h" #include "dummyplayer.h" -#include "mediaobject.h" +#include "utils.h" #include "utils.h" #include "videoplayer.h" +#include "videowidget.h" + +#include "mediaobject.h" #include <QDir> @@ -34,8 +38,8 @@ using namespace Phonon::MMF; // Constructor / destructor //----------------------------------------------------------------------------- -MMF::MediaObject::MediaObject(QObject *parent) : QObject(parent) - , m_recognizerOpened(false) +MMF::MediaObject::MediaObject(QObject *parent) : MMF::MediaNode::MediaNode(parent) + , m_recognizerOpened(false) { m_player.reset(new DummyPlayer()); @@ -366,5 +370,41 @@ void MMF::MediaObject::setVideoOutput(VideoOutput* videoOutput) } +AbstractPlayer *MediaObject::abstractPlayer() const +{ + return m_player.data(); +} + +bool MediaObject::connectMediaNode(MediaNode *target) +{ + TRACE_CONTEXT(Backend::connect, EBackend); + + MediaNode::connectMediaNode(target); + + bool result = false; + + { + AudioOutput *const audioOutput = qobject_cast<AudioOutput *>(target); + + if (audioOutput) { + TRACE("this 0x%08x -> audioOutput 0x%08x", this, audioOutput); + audioOutput->setVolumeObserver(this); + return true; + } + } + + { + VideoWidget *const videoWidget = qobject_cast<VideoWidget *>(target); + + if (videoWidget) { + TRACE("this 0x%08x -> videoWidget 0x%08x", this, videoWidget); + this->setVideoOutput(&videoWidget->videoOutput()); + return true; + } + } + + return false; +} + QT_END_NAMESPACE |