summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2011-09-28 23:01:21 +0200
committerJavier S. Pedro <maemo@javispedro.com>2011-09-28 23:01:21 +0200
commitc6df72ffb7fa549e817dc3d71d2762d8071eb0cb (patch)
tree8f57bc78ebc70e06a1676ec593521438c648fdf0
parent3dc79838b5484aba0d805a3c5dac4c0e26503ac6 (diff)
downloadsowatch-c6df72ffb7fa549e817dc3d71d2762d8071eb0cb.tar.gz
sowatch-c6df72ffb7fa549e817dc3d71d2762d8071eb0cb.zip
fixing a problem with the play/pause button
-rw-r--r--libsowatch/graphicswatchlet.h5
-rw-r--r--libsowatch/notification.h6
-rw-r--r--qmafwwatchlet/qmafwwatchletplayer.cpp10
-rw-r--r--qmafwwatchlet/qmafwwatchletplayer.h3
4 files changed, 19 insertions, 5 deletions
diff --git a/libsowatch/graphicswatchlet.h b/libsowatch/graphicswatchlet.h
index 61b68bf..6456a18 100644
--- a/libsowatch/graphicswatchlet.h
+++ b/libsowatch/graphicswatchlet.h
@@ -20,8 +20,8 @@ public:
QGraphicsScene* scene();
void setScene(QGraphicsScene* scene);
- static const int frameDelay = 20;
- static const int busyFrameDelay = 40;
+ static const int frameDelay = 25;
+ static const int busyFrameDelay = 50;
protected:
void activate();
@@ -35,7 +35,6 @@ private slots:
void frameTimeout();
private:
-
QRegion _damaged;
};
diff --git a/libsowatch/notification.h b/libsowatch/notification.h
index 3505c44..1af0264 100644
--- a/libsowatch/notification.h
+++ b/libsowatch/notification.h
@@ -13,6 +13,12 @@ class SOWATCH_EXPORT Notification : public QObject
{
Q_OBJECT
Q_ENUMS(Type)
+ Q_PROPERTY(Type type READ type)
+ Q_PROPERTY(uint count READ count)
+ Q_PROPERTY(QDateTime dateTime READ dateTime)
+ Q_PROPERTY(QString title READ title)
+ Q_PROPERTY(QString body READ body)
+ Q_PROPERTY(QImage image READ image)
public:
enum Type {
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<QVariant>&)));
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<MafwRenderer::State>(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<QVariant>& 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);