diff options
author | Xavi Garcia Mena <xavi.garcia.mena@canonical.com> | 2015-10-19 07:54:03 +0000 |
---|---|---|
committer | CI Train Bot <ci-train-bot@canonical.com> | 2015-10-19 07:54:03 +0000 |
commit | b7160db4701c3d96c89948dfe7d1984abb605fd9 (patch) | |
tree | d1c0a50101d2732e2a4fa294d2d7097445a27796 /src/media-player-mpris.vala | |
parent | 918c9b9a95573b0dfe0e2e67ef30b998b5576e82 (diff) | |
parent | 4c8533b0fbe91b0186d4cdc5eb2b9703d1b776af (diff) | |
download | ayatana-indicator-sound-b7160db4701c3d96c89948dfe7d1984abb605fd9.tar.gz ayatana-indicator-sound-b7160db4701c3d96c89948dfe7d1984abb605fd9.tar.bz2 ayatana-indicator-sound-b7160db4701c3d96c89948dfe7d1984abb605fd9.zip |
Wily branch for MPRIS controls Fixes: #1373313
Approved by: PS Jenkins bot, Xavi Garcia
Diffstat (limited to 'src/media-player-mpris.vala')
-rw-r--r-- | src/media-player-mpris.vala | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/media-player-mpris.vala b/src/media-player-mpris.vala index 741d887..408cdda 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) |