From 41677b58d971ab57a79514d972f10acb04797130 Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 27 Dec 2015 21:55:19 +0100 Subject: initial music controller implementation --- musiccontroller.h | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) (limited to 'musiccontroller.h') diff --git a/musiccontroller.h b/musiccontroller.h index 33f6810..acf5beb 100644 --- a/musiccontroller.h +++ b/musiccontroller.h @@ -19,22 +19,79 @@ #ifndef WATCHFISH_MUSICCONTROLLER_H #define WATCHFISH_MUSICCONTROLLER_H -#include +#include namespace watchfish { +Q_DECLARE_LOGGING_CATEGORY(musicControllerCat) + class MusicControllerPrivate; class MusicController : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(MusicController) + Q_ENUMS(Status) public: explicit MusicController(QObject *parent = 0); ~MusicController(); + enum Status { + StatusNoPlayer = 0, + StatusStopped, + StatusPaused, + StatusPlaying + }; + + enum RepeatStatus { + RepeatNone = 0, + RepeatTrack, + RepeatPlaylist + }; + + Status status() const; + QString service() const; + + QVariantMap metadata() const; + + QString title() const; + QString album() const; + QString artist() const; + + QString albumArt() const; + + int duration() const; + + RepeatStatus repeat() const; + bool shuffle() const; + + int volume() const; + +public slots: + void play(); + void pause(); + void playPause(); + void next(); + void previous(); + + void volumeUp(); + void volumeDown(); + +signals: + void statusChanged(); + void serviceChanged(); + void metadataChanged(); + void titleChanged(); + void albumChanged(); + void artistChanged(); + void albumArtChanged(); + void durationChanged(); + void repeatChanged(); + void shuffleChanged(); + void volumeChanged(); + private: MusicControllerPrivate * const d_ptr; }; -- cgit v1.2.3