summaryrefslogtreecommitdiff
path: root/musiccontroller_p.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2015-12-27 21:55:19 +0100
committerJavier <dev.git@javispedro.com>2015-12-27 21:55:19 +0100
commit41677b58d971ab57a79514d972f10acb04797130 (patch)
tree2f85a5427f1bfc8952ef731dccb1ee09123f7895 /musiccontroller_p.h
parentffeca2b8740fba10e916fe04e89ef2fd5c606a90 (diff)
downloadlibwatchfish-41677b58d971ab57a79514d972f10acb04797130.tar.gz
libwatchfish-41677b58d971ab57a79514d972f10acb04797130.zip
initial music controller implementation
Diffstat (limited to 'musiccontroller_p.h')
-rw-r--r--musiccontroller_p.h27
1 files changed, 24 insertions, 3 deletions
diff --git a/musiccontroller_p.h b/musiccontroller_p.h
index 5711e65..dd26ff0 100644
--- a/musiccontroller_p.h
+++ b/musiccontroller_p.h
@@ -1,15 +1,15 @@
#ifndef WATCHFISH_MUSICCONTROLLER_P_H
#define WATCHFISH_MUSICCONTROLLER_P_H
-#include <QtDBus/QDBusServiceWatcher>
-#include <QtDBus/QDBusContext>
+#include <MprisQt/mpris.h>
+#include <MprisQt/mprismanager.h>
#include "musiccontroller.h"
namespace watchfish
{
-class MusicControllerPrivate : public QObject, protected QDBusContext
+class MusicControllerPrivate : public QObject
{
Q_OBJECT
@@ -17,6 +17,27 @@ public:
MusicControllerPrivate(MusicController *q);
~MusicControllerPrivate();
+public:
+ MprisManager *manager;
+ MusicController::Status curStatus;
+ QString curTitle;
+ QString curAlbum;
+ QString curArtist;
+ QString curAlbumArt;
+ int curDuration;
+
+private:
+ static QString stripAlbumArtComponent(const QString& component);
+ static QString findAlbumArt(const QString &artist, const QString &album);
+ void updateStatus();
+ void updateAlbumArt();
+ void updateMetadata();
+
+private slots:
+ void handleCurrentServiceChanged();
+ void handlePlaybackStatusChanged();
+ void handleMetadataChanged();
+
private:
MusicController * const q_ptr;
Q_DECLARE_PUBLIC(MusicController)