aboutsummaryrefslogtreecommitdiff
path: root/src/media-player-mpris.vala
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-09-15 14:16:10 +0200
committerXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-09-15 14:16:10 +0200
commita3b4aa7d5959ed275dd501ae2264e81b00b184b3 (patch)
treebbf439be2344033510ccc1b0e26ab0e25aa3484b /src/media-player-mpris.vala
parentf76bbdf9eefaffd594078efe534ad1090f5aa41f (diff)
downloadayatana-indicator-sound-a3b4aa7d5959ed275dd501ae2264e81b00b184b3.tar.gz
ayatana-indicator-sound-a3b4aa7d5959ed275dd501ae2264e81b00b184b3.tar.bz2
ayatana-indicator-sound-a3b4aa7d5959ed275dd501ae2264e81b00b184b3.zip
Added changed to reflect the state of the player control buttons
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)