From c6df72ffb7fa549e817dc3d71d2762d8071eb0cb Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Wed, 28 Sep 2011 23:01:21 +0200 Subject: fixing a problem with the play/pause button --- qmafwwatchlet/qmafwwatchletplayer.cpp | 10 +++++++++- qmafwwatchlet/qmafwwatchletplayer.h | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'qmafwwatchlet') diff --git a/qmafwwatchlet/qmafwwatchletplayer.cpp b/qmafwwatchlet/qmafwwatchletplayer.cpp index cc63508..8f51fbf 100644 --- a/qmafwwatchlet/qmafwwatchletplayer.cpp +++ b/qmafwwatchlet/qmafwwatchletplayer.cpp @@ -137,7 +137,8 @@ void QMafwWatchletPlayer::reconnect() this, SLOT(handleChangedMetadata(const QString&, const QList&))); connect(_renderer, SIGNAL(stateChanged(MafwRenderer::State)), this, SLOT(handleChangedState(MafwRenderer::State))); - _renderer->getCurrentMediaInfo(this, SLOT(handleMediaInfo(MafwMediaInfo))); + _renderer->getStatus(this, SLOT(handleStatusResults(QString,uint,int))); + _renderer->getCurrentMediaInfo(this, SLOT(handleMediaInfo(MafwMediaInfo))); } else if (_renderer) { disconnect(_renderer, 0, this, 0); } @@ -265,6 +266,13 @@ void QMafwWatchletPlayer::handleMediaInfo(const MafwMediaInfo &info) handleChangedMetadata(MAFW_METADATA_KEY_RENDERER_ART_URI, data[MAFW_METADATA_KEY_RENDERER_ART_URI]); } +void QMafwWatchletPlayer::handleStatusResults(const QString &playlistId, uint playbackIndex, int playbackState) +{ + Q_UNUSED(playlistId); + Q_UNUSED(playbackIndex); + _state = static_cast(playbackState); +} + void QMafwWatchletPlayer::doVolumeUp(const QString& name, const QVariant& value) { _renderer->setMafwProperty(name, value.toUInt() + 10); diff --git a/qmafwwatchlet/qmafwwatchletplayer.h b/qmafwwatchlet/qmafwwatchletplayer.h index 0d035e2..625635c 100644 --- a/qmafwwatchlet/qmafwwatchletplayer.h +++ b/qmafwwatchlet/qmafwwatchletplayer.h @@ -16,7 +16,7 @@ class QMafwWatchlet; class QMafwWatchletPlayer : public QObject { - Q_OBJECT + Q_OBJECT Q_PROPERTY(QString title READ title NOTIFY titleChanged) Q_PROPERTY(QString album READ album NOTIFY albumChanged) Q_PROPERTY(QString artist READ artist NOTIFY artistChanged) @@ -72,6 +72,7 @@ private slots: void handleChangedMetadata(const QString& s, const QList& l); void handleChangedState(MafwRenderer::State state); void handleMediaInfo(const MafwMediaInfo& info); + void handleStatusResults(const QString& playlistId, uint playbackIndex, int playbackState); void doVolumeUp(const QString& name, const QVariant& value); void doVolumeDown(const QString& name, const QVariant& value); -- cgit v1.2.3