aboutsummaryrefslogtreecommitdiff
path: root/src/media-player-mpris.vala
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-10-15 12:08:07 +0200
committerXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-10-15 12:08:07 +0200
commite5a1645266514e38c49281a7f8da296a0e81687d (patch)
tree633da2d705450f8a1eae26c4a0ae372a2e20131f /src/media-player-mpris.vala
parentd3802b66c55e50ff1b9e2103cd446cb586d8acb3 (diff)
parent828fae630464f2eae96145cffcf97e5791497264 (diff)
downloadayatana-indicator-sound-e5a1645266514e38c49281a7f8da296a0e81687d.tar.gz
ayatana-indicator-sound-e5a1645266514e38c49281a7f8da296a0e81687d.tar.bz2
ayatana-indicator-sound-e5a1645266514e38c49281a7f8da296a0e81687d.zip
Added integragrion tests to the devices labels and icons
Diffstat (limited to 'src/media-player-mpris.vala')
-rw-r--r--src/media-player-mpris.vala22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/media-player-mpris.vala b/src/media-player-mpris.vala
index 741d887..780d724 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,10 @@ 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 ("CanGoPrevious", "b", null) ||
+ changed_properties.lookup ("CanPlay", "b", null) || changed_properties.lookup ("CanPause", "b", null) ) {
+ this.playbackstatus_changed ();
+ }
var metadata = changed_properties.lookup_value ("Metadata", new VariantType ("a{sv}"));
if (metadata != null)