forked from quickshell/quickshell
service/mpris: reset position timestamps on seek
Moving the onPositionUpdated callback to a bpPosition binding caused it not to fire when Position was changed to the same value, which can happen when quickly changing tracks before the player has sent a new position. This reverts the above change while still updating position on seek.
This commit is contained in:
parent
fca058e66c
commit
761d99d644
2 changed files with 10 additions and 5 deletions
|
@ -391,6 +391,8 @@ private slots:
|
|||
private:
|
||||
void onMetadataChanged();
|
||||
void onPositionUpdated();
|
||||
// call instead of setting bpPosition
|
||||
void setPosition(qlonglong position);
|
||||
void requestPositionUpdate() { this->pPosition.requestUpdate(); };
|
||||
|
||||
// clang-format off
|
||||
|
@ -457,7 +459,7 @@ private:
|
|||
QS_DBUS_PROPERTY_BINDING(MprisPlayer, pCanSeek, bpCanSeek, playerProperties, "CanSeek");
|
||||
QS_DBUS_PROPERTY_BINDING(MprisPlayer, pCanGoNext, bpCanGoNext, playerProperties, "CanGoNext");
|
||||
QS_DBUS_PROPERTY_BINDING(MprisPlayer, pCanGoPrevious, bpCanGoPrevious, playerProperties, "CanGoPrevious");
|
||||
QS_DBUS_PROPERTY_BINDING(MprisPlayer, qlonglong, pPosition, bpPosition, playerProperties, "Position", false);
|
||||
QS_DBUS_PROPERTY_BINDING(MprisPlayer, qlonglong, pPosition, bpPosition, onPositionUpdated, playerProperties, "Position", false);
|
||||
QS_DBUS_PROPERTY_BINDING(MprisPlayer, pVolume, bVolume, playerProperties, "Volume", false);
|
||||
QS_DBUS_PROPERTY_BINDING(MprisPlayer, pMetadata, bpMetadata, playerProperties, "Metadata");
|
||||
QS_DBUS_PROPERTY_BINDING(MprisPlayer, pPlaybackStatus, bpPlaybackStatus, playerProperties, "PlaybackStatus");
|
||||
|
@ -466,8 +468,6 @@ private:
|
|||
QS_DBUS_PROPERTY_BINDING(MprisPlayer, pMinRate, bMinRate, playerProperties, "MinimumRate", false);
|
||||
QS_DBUS_PROPERTY_BINDING(MprisPlayer, pMaxRate, bMaxRate, playerProperties, "MaximumRate", false);
|
||||
QS_DBUS_PROPERTY_BINDING(MprisPlayer, pShuffle, bShuffle, playerProperties, "Shuffle", false);
|
||||
|
||||
QS_BINDING_SUBSCRIBE_METHOD(MprisPlayer, bpPosition, onPositionUpdated, onValueChanged);
|
||||
// clang-format on
|
||||
|
||||
QDateTime lastPositionTimestamp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue