diff options
author | Frans Englich <frans.englich@nokia.com> | 2009-08-17 15:24:34 (GMT) |
---|---|---|
committer | Frans Englich <frans.englich@nokia.com> | 2009-08-17 15:24:34 (GMT) |
commit | 257984d8b8cf31394c4f20070ea045f5ae7fa170 (patch) | |
tree | 274a54cf0ab767db12070ad8319deb66bc1e2f97 /src/3rdparty/phonon/mmf/mediaobject.cpp | |
parent | a7b1ad0b2ecdedd5f2a9d52fe09c4497078bc669 (diff) | |
download | Qt-257984d8b8cf31394c4f20070ea045f5ae7fa170.zip Qt-257984d8b8cf31394c4f20070ea045f5ae7fa170.tar.gz Qt-257984d8b8cf31394c4f20070ea045f5ae7fa170.tar.bz2 |
More delegation, basic plumbing.
Diffstat (limited to 'src/3rdparty/phonon/mmf/mediaobject.cpp')
-rw-r--r-- | src/3rdparty/phonon/mmf/mediaobject.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp index 4769249..e9e4b5b 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.cpp +++ b/src/3rdparty/phonon/mmf/mediaobject.cpp @@ -17,6 +17,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. */ #include "abstractplayer.h" +#include "audioplayer.h" +#include "mmf_videoplayer.h" #include "mediaobject.h" using namespace Phonon; @@ -65,7 +67,7 @@ qint32 MMF::MediaObject::tickInterval() const void MMF::MediaObject::setTickInterval(qint32 interval) { - m_player->setTransitionTime(interval); + m_player->setTickInterval(interval); } bool MMF::MediaObject::hasVideo() const @@ -110,9 +112,24 @@ MediaSource MMF::MediaObject::source() const void MMF::MediaObject::setSource(const MediaSource &source) { + loadPlayer(source); + return m_player->setSource(source); } +void MMF::MediaObject::loadPlayer(const MediaSource &source) +{ + disconnect(m_player.data(), 0, this, 0); + + // TODO determine media type + m_player.reset(new AudioPlayer()); + + connect(m_player.data(), SIGNAL(totalTimeChanged()), SIGNAL(totalTimeChanged())); + connect(m_player.data(), SIGNAL(stateChanged(Phonon::State, Phonon::State)), SIGNAL(stateChanged(Phonon::State, Phonon::State))); + connect(m_player.data(), SIGNAL(finished()), SIGNAL(finished())); + connect(m_player.data(), SIGNAL(tick(qint64)), SIGNAL(tick(qint64))); +} + void MMF::MediaObject::setNextSource(const MediaSource &source) { return m_player->setNextSource(source); |