Emitting CanPlay and CanPause on change

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=898998 for more
information.
This commit is contained in:
Alexander Kernozhitsky 2018-08-21 14:20:22 +03:00 committed by John Maguire
parent 4ac2dedefa
commit a71694f61b
1 changed files with 8 additions and 0 deletions

View File

@ -131,6 +131,8 @@ void Mpris2::EngineStateChanged(Engine::State newState) {
EmitNotification("Metadata");
}
EmitNotification("CanPlay");
EmitNotification("CanPause");
EmitNotification("PlaybackStatus", PlaybackStatus(newState));
if (newState == Engine::Playing)
EmitNotification("CanSeek", CanSeek(newState));
@ -181,6 +183,10 @@ void Mpris2::EmitNotification(const QString& name) {
value = CanGoPrevious();
else if (name == "CanSeek")
value = CanSeek();
else if (name == "CanPlay")
value = CanPlay();
else if (name == "CanPause")
value = CanPause();
if (value.isValid()) EmitNotification(name, value);
}
@ -328,6 +334,8 @@ QString Mpris2::current_track_id() const {
// changing song starts...
void Mpris2::CurrentSongChanged(const Song& song) {
ArtLoaded(song, "");
EmitNotification("CanPlay");
EmitNotification("CanPause");
EmitNotification("CanGoNext", CanGoNext());
EmitNotification("CanGoPrevious", CanGoPrevious());
EmitNotification("CanSeek", CanSeek());