diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-12-20 16:55:31 +0000 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-12-20 16:55:31 +0000 |
commit | bc927c2284c55ca8a30146ae905a76aa08f26fa1 (patch) | |
tree | 9d3696fadb043b36f48d695d1db3227efeec13ba | |
parent | 80ce8f642c251dc765267fa1b1978fec59d23c97 (diff) | |
download | ayatana-indicator-sound-bc927c2284c55ca8a30146ae905a76aa08f26fa1.tar.gz ayatana-indicator-sound-bc927c2284c55ca8a30146ae905a76aa08f26fa1.tar.bz2 ayatana-indicator-sound-bc927c2284c55ca8a30146ae905a76aa08f26fa1.zip |
implemented suggested optional playlist mechanism
-rw-r--r-- | src/mpris2-controller.vala | 7 | ||||
-rw-r--r-- | src/mpris2-interfaces.vala | 2 | ||||
-rw-r--r-- | 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 <http://www.gnu.org/licenses/>. 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 { |