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");
|
auto trackidVariant = this->pMetadata.get().value("mpris:trackid");
|
||||||
if (trackidVariant.isValid() && trackidVariant.canConvert<QString>()) {
|
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);
|
this->onSeek(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -242,6 +242,8 @@ public:
|
||||||
[[nodiscard]] QList<QString> supportedMimeTypes() const;
|
[[nodiscard]] QList<QString> supportedMimeTypes() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
void trackChanged();
|
||||||
|
|
||||||
QSDOC_HIDE void ready();
|
QSDOC_HIDE void ready();
|
||||||
void canControlChanged();
|
void canControlChanged();
|
||||||
void canPlayChanged();
|
void canPlayChanged();
|
||||||
|
|
Loading…
Reference in a new issue