aboutsummaryrefslogtreecommitdiff
path: root/src/media-player-mpris.vala
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-09-24 15:32:17 +0200
committerXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-09-24 15:32:17 +0200
commit035626d4df388a10e65226a81bd380f277fb12d2 (patch)
tree32125b88632237a5278dc28d61aabf82e1fb81aa /src/media-player-mpris.vala
parent53b1246ced87efdaaf4600cdbe606a6be7cae680 (diff)
parentc258047f9704b1baafc4bf25e92cba66101d8744 (diff)
downloadayatana-indicator-sound-035626d4df388a10e65226a81bd380f277fb12d2.tar.gz
ayatana-indicator-sound-035626d4df388a10e65226a81bd380f277fb12d2.tar.bz2
ayatana-indicator-sound-035626d4df388a10e65226a81bd380f277fb12d2.zip
merged lp:~xavi-garcia-mena/indicator-sound/next-play-prev-buttons-bug-1373313
Diffstat (limited to 'src/media-player-mpris.vala')
-rw-r--r--src/media-player-mpris.vala21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/media-player-mpris.vala b/src/media-player-mpris.vala
index 741d887..8bc2884 100644
--- a/src/media-player-mpris.vala
+++ b/src/media-player-mpris.vala
@@ -79,6 +79,24 @@ public class MediaPlayerMpris: MediaPlayer {
}
}
+ public override bool can_do_play {
+ get {
+ return this.proxy.CanPlay;
+ }
+ }
+
+ public override bool can_do_prev {
+ get {
+ return this.proxy.CanGoPrevious;
+ }
+ }
+
+ public override bool can_do_next {
+ get {
+ return this.proxy.CanGoNext;
+ }
+ }
+
/**
* Attach this object to a process of the associated media player. The player must own @dbus_name and
* implement the org.mpris.MediaPlayer2.Player interface.
@@ -272,6 +290,9 @@ public class MediaPlayerMpris: MediaPlayer {
if (changed_properties.lookup ("PlaybackStatus", "s", null)) {
this.state = this.proxy.PlaybackStatus != null ? this.proxy.PlaybackStatus : "Unknown";
}
+ if (changed_properties.lookup ("CanGoNext", "b", null) || changed_properties.lookup ("CanGoPrev", "b", null)) {
+ this.playbackstatus_changed ();
+ }
var metadata = changed_properties.lookup_value ("Metadata", new VariantType ("a{sv}"));
if (metadata != null)