From 2ff72f033af3f24ffb816bc19a34fc794f585775 Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 5 Mar 2017 17:23:33 +0100 Subject: Implement statusBar Display in statusBar: * viewMode * number of files in playlist * length of playlist in h:m:s * player status (Stopped, Playing, Paused) --- playerwidget.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'playerwidget.h') diff --git a/playerwidget.h b/playerwidget.h index 383cbc3..bbe8333 100644 --- a/playerwidget.h +++ b/playerwidget.h @@ -21,8 +21,9 @@ class PlayerWidget : public QWidget { public: enum ItemType { Artist, Album, Song, Genre }; enum PopulateType { FilterType, IdType, EmptyType }; - enum CustomRoles { TypeRole = Qt::UserRole + 1, IdRole = Qt::UserRole + 2, FullPathRole = Qt::UserRole + 3, GenreRole = Qt::UserRole + 4, ArtistRole = Qt::UserRole + 5, TitleRole = Qt::UserRole + 6, AlbumRole = Qt::UserRole + 7 }; + enum CustomRoles { TypeRole = Qt::UserRole + 1, IdRole = Qt::UserRole + 2, FullPathRole = Qt::UserRole + 3, GenreRole = Qt::UserRole + 4, ArtistRole = Qt::UserRole + 5, TitleRole = Qt::UserRole + 6, AlbumRole = Qt::UserRole + 7, LengthRole = Qt::UserRole + 8 }; explicit PlayerWidget(QWidget *parent = 0); + const QMediaPlayer* player() const { return mPlayer; } public slots: void doPopulateByArtist(); @@ -51,6 +52,13 @@ class PlayerWidget : public QWidget { void continuePlaying(QMediaPlayer::State state); void expand(); + signals: + void viewModeChanged(const QString &viewMode); + void playModeChanged(const QString &playMode); + void numFilesChanged(int numFiles); + void playListLengthChanged(quint64 secs); + void message(const QString &msg); + private: void setupGui(); void createActions(); @@ -82,6 +90,7 @@ class PlayerWidget : public QWidget { QAction *mPlayA; QAction *mStopA; qint64 mDurSecs; + quint64 mPlayListLength; }; #endif // PLAYERWIDGET_H -- cgit v1.2.3-70-g09d2