forked from quickshell/quickshell
service/mpris: add trackChanged signal
This commit is contained in:
parent
af45502913
commit
ed3708f5cb
|
@ -258,7 +258,13 @@ void MprisPlayer::onMetadataChanged() {
|
|||
|
||||
auto trackidVariant = this->pMetadata.get().value("mpris:trackid");
|
||||
if (trackidVariant.isValid() && trackidVariant.canConvert<QString>()) {
|
||||
this->mTrackId = trackidVariant.value<QString>();
|
||||
auto trackId = trackidVariant.value<QString>();
|
||||
|
||||
if (trackId != this->mTrackId) {
|
||||
this->mTrackId = trackId;
|
||||
emit this->trackChanged();
|
||||
}
|
||||
|
||||
this->onSeek(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -242,6 +242,8 @@ public:
|
|||
[[nodiscard]] QList<QString> supportedMimeTypes() const;
|
||||
|
||||
signals:
|
||||
void trackChanged();
|
||||
|
||||
QSDOC_HIDE void ready();
|
||||
void canControlChanged();
|
||||
void canPlayChanged();
|
||||
|
|
Loading…
Reference in a new issue