diff --git a/plugins/mprisremote/mprisremoteplayer.cpp b/plugins/mprisremote/mprisremoteplayer.cpp index 8c93a68e5..e519e3be6 100644 --- a/plugins/mprisremote/mprisremoteplayer.cpp +++ b/plugins/mprisremote/mprisremoteplayer.cpp @@ -26,6 +26,10 @@ MprisRemotePlayer::MprisRemotePlayer() : m_playing(false) + , m_canPlay(true) + , m_canPause(true) + , m_canGoPrevious(true) + , m_canGoNext(true) , m_nowPlaying() , m_volume(50) , m_length(0) @@ -50,13 +54,16 @@ void MprisRemotePlayer::parseNetworkPacket(const NetworkPacket& np) m_album = np.get(QStringLiteral("album"), m_album); m_volume = np.get(QStringLiteral("volume"), m_volume); m_length = np.get(QStringLiteral("length"), m_length); - if(np.has(QStringLiteral("pos"))){ + if (np.has(QStringLiteral("pos"))) { m_lastPosition = np.get(QStringLiteral("pos"), m_lastPosition); m_lastPositionTime = QDateTime::currentMSecsSinceEpoch(); } m_playing = np.get(QStringLiteral("isPlaying"), m_playing); m_canSeek = np.get(QStringLiteral("canSeek"), m_canSeek); - + m_canPlay = np.get(QStringLiteral("canPlay"), m_canPlay); + m_canPause = np.get(QStringLiteral("canPause"), m_canPause); + m_canGoPrevious = np.get(QStringLiteral("canGoPrevious"), m_canGoPrevious); + m_canGoNext = np.get(QStringLiteral("canGoNext"), m_canGoNext); } long MprisRemotePlayer::position() const @@ -113,3 +120,19 @@ bool MprisRemotePlayer::canSeek() const { return m_canSeek; } + +bool MprisRemotePlayer::canPlay() const { + return m_canPlay; +} + +bool MprisRemotePlayer::canPause() const { + return m_canPause; +} + +bool MprisRemotePlayer::canGoPrevious() const { + return m_canGoPrevious; +} + +bool MprisRemotePlayer::canGoNext() const { + return m_canGoNext; +} diff --git a/plugins/mprisremote/mprisremoteplayer.h b/plugins/mprisremote/mprisremoteplayer.h index a83458d9b..bafe12c1d 100644 --- a/plugins/mprisremote/mprisremoteplayer.h +++ b/plugins/mprisremote/mprisremoteplayer.h @@ -41,10 +41,19 @@ public: QString album() const; bool canSeek() const; + bool canPlay() const; + bool canPause() const; + bool canGoPrevious() const; + bool canGoNext() const; + private: QString id; bool m_playing; + bool m_canPlay; + bool m_canPause; + bool m_canGoPrevious; + bool m_canGoNext; QString m_nowPlaying; int m_volume; long m_length;