@@ -154,6 +154,11 @@ class MprisPlayer: public QObject {
154154 // / - If @@canControl is false, you cannot assign the `Stopped` state.
155155 // / (or any of the others, though their repsective properties will also be false)
156156 Q_PROPERTY (qs::service::mpris::MprisPlaybackState::Enum playbackState READ playbackState WRITE setPlaybackState NOTIFY playbackStateChanged BINDABLE bindablePlaybackState);
157+ // / True if @@playbackState == `MprisPlaybackState.Playing`.
158+ // /
159+ // / Setting this property is equivalent to calling @@play() or @@pause().
160+ // / You cannot set this property if @@canTogglePlaying is false.
161+ Q_PROPERTY (bool isPlaying READ isPlaying WRITE setPlaying NOTIFY isPlayingChanged BINDABLE bindableIsPlaying);
157162 // / The loop state of the media player, or `None` if @@loopSupported is false.
158163 // /
159164 // / May only be written to if @@canControl and @@loopSupported are true.
@@ -274,6 +279,9 @@ class MprisPlayer: public QObject {
274279
275280 void setPlaybackState (MprisPlaybackState::Enum playbackState);
276281
282+ QS_BINDABLE_GETTER (bool , bIsPlaying, isPlaying, bindableIsPlaying);
283+ void setPlaying (bool playing);
284+
277285 QS_BINDABLE_GETTER (MprisLoopState::Enum, bLoopState, loopState, bindableLoopState);
278286 [[nodiscard]] bool loopSupported () const ;
279287 void setLoopState (MprisLoopState::Enum loopState);
@@ -351,6 +359,7 @@ class MprisPlayer: public QObject {
351359 void trackAlbumArtistChanged ();
352360 void trackArtUrlChanged ();
353361 void playbackStateChanged ();
362+ void isPlayingChanged ();
354363 void loopStateChanged ();
355364 void loopSupportedChanged ();
356365 void rateChanged ();
@@ -412,6 +421,7 @@ private slots:
412421 Q_OBJECT_BINDABLE_PROPERTY (MprisPlayer, bool , bCanGoPrevious, &MprisPlayer::canGoPreviousChanged);
413422 Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS (MprisPlayer, qreal, bVolume, 1 , &MprisPlayer::volumeChanged);
414423 Q_OBJECT_BINDABLE_PROPERTY (MprisPlayer, MprisPlaybackState::Enum, bPlaybackState, &MprisPlayer::playbackStateChanged);
424+ Q_OBJECT_BINDABLE_PROPERTY (MprisPlayer, bool , bIsPlaying, &MprisPlayer::isPlayingChanged);
415425 QS_BINDING_SUBSCRIBE_METHOD (MprisPlayer, bPlaybackState, requestPositionUpdate, onValueChanged);
416426 Q_OBJECT_BINDABLE_PROPERTY (MprisPlayer, MprisLoopState::Enum, bLoopState, &MprisPlayer::loopStateChanged);
417427 Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS (MprisPlayer, qreal, bRate, 1 , &MprisPlayer::rateChanged);
0 commit comments