From bc927c2284c55ca8a30146ae905a76aa08f26fa1 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 20 Dec 2010 16:55:31 +0000 Subject: implemented suggested optional playlist mechanism --- src/mpris2-controller.vala | 7 ++++--- src/mpris2-interfaces.vala | 2 -- src/player-item.vala | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 58a1906..4990b38 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -102,9 +102,10 @@ public class Mpris2Controller : GLib.Object public bool playlist_support() { - // awaiting spec updates - // return this.mpris2_root.HasPlaylists; - return true; + if (this.playlists == null) return false; + uint32? count = this.playlists.PlaylistCount; + if ( count == null || count <= 0 ) return false; + return true; } private bool ensure_correct_playback_status(){ diff --git a/src/mpris2-interfaces.vala b/src/mpris2-interfaces.vala index 4f01c4c..a731de8 100644 --- a/src/mpris2-interfaces.vala +++ b/src/mpris2-interfaces.vala @@ -21,8 +21,6 @@ with this program. If not, see . public interface MprisRoot : Object { // properties public abstract bool HasTracklist{owned get; set;} - //waiting for MPRIS approval - //public abstract bool HasPlaylist{owned get; set;} public abstract bool CanQuit{owned get; set;} public abstract bool CanRaise{owned get; set;} public abstract string Identity{owned get; set;} diff --git a/src/player-item.vala b/src/player-item.vala index 75f673b..f883a1e 100644 --- a/src/player-item.vala +++ b/src/player-item.vala @@ -28,7 +28,7 @@ public class PlayerItem : Dbusmenu.Menuitem public PlayerItem(string type) { - Object(item_type: type); + Object(item_type: type); } construct { -- cgit v1.2.3