From a964487e2fcd11946b5f95ab36b20cbd1bea4a57 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 9 Dec 2010 11:36:33 +0000 Subject: moving towards testing proposed playlists api --- src/mpris2-interfaces.vala | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/mpris2-interfaces.vala') diff --git a/src/mpris2-interfaces.vala b/src/mpris2-interfaces.vala index ebea135..3f5519b 100644 --- a/src/mpris2-interfaces.vala +++ b/src/mpris2-interfaces.vala @@ -44,3 +44,27 @@ public interface MprisPlayer : Object { // signals public signal void Seeked(int64 new_position); } + + +// Playlist container +public struct PlaylistDetails{ + public ObjectPath path; + public string name; + public string icon_path; +} + +[DBus (name = "org.mpris.MediaPlayer2.Playlists")] +// TODO: API criticisms +// get playlists should be able to be async => pass in struct to be populated or pass in callback +public interface MprisPlaylists : Object { + //properties + public abstract string[] Orderings{owned get; set;} + public abstract uint32 PlaylistCount{owned get; set;} + + //methods + public abstract async void ActivatePlaylist(ObjectPath playlist_id) throws IOError; + public abstract PlaylistDetails[] GetPlaylists ( uint32 index, + uint32 max_count, + string order, + bool reverse_order ) throws IOError; +} \ No newline at end of file -- cgit v1.2.3 From f3b321919e3390f3d3af2eea33ad71611616ce61 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 10 Dec 2010 13:02:16 +0000 Subject: playlist widget population --- src/mpris2-interfaces.vala | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/mpris2-interfaces.vala') diff --git a/src/mpris2-interfaces.vala b/src/mpris2-interfaces.vala index 3f5519b..ab8ac95 100644 --- a/src/mpris2-interfaces.vala +++ b/src/mpris2-interfaces.vala @@ -1,6 +1,5 @@ /* Copyright 2010 Canonical Ltd. - Authors: Conor Curran @@ -45,7 +44,6 @@ public interface MprisPlayer : Object { public signal void Seeked(int64 new_position); } - // Playlist container public struct PlaylistDetails{ public ObjectPath path; @@ -54,8 +52,18 @@ public struct PlaylistDetails{ } [DBus (name = "org.mpris.MediaPlayer2.Playlists")] + // TODO: API criticisms -// get playlists should be able to be async => pass in struct to be populated or pass in callback +// Get_playlists should be able to be async => pass in callback pointer +// Lacking the ability to query the current playlist (should be asyncable) +// - needed to keep client and servers in sync +// => get_current_playlist -> +// Should return PlaylistDetails struct with each field nil if there is no active playlist. +// Otherwise a populated PlaylistDetails +// should be asyncable. +// => Need to be able to query get_playlist using ordered by last modified. +// => Need a signal to inform that the active playlist has changed + public interface MprisPlaylists : Object { //properties public abstract string[] Orderings{owned get; set;} @@ -63,8 +71,8 @@ public interface MprisPlaylists : Object { //methods public abstract async void ActivatePlaylist(ObjectPath playlist_id) throws IOError; - public abstract PlaylistDetails[] GetPlaylists ( uint32 index, - uint32 max_count, - string order, - bool reverse_order ) throws IOError; + public abstract PlaylistDetails[] GetPlaylists ( uint32 index, + uint32 max_count, + string order, + bool reverse_order ) throws IOError; } \ No newline at end of file -- cgit v1.2.3 From 93190886959bfa16b835794a4a12a9a945e7777e Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 10 Dec 2010 15:36:44 +0000 Subject: proposed extension proven and observations gathered --- src/mpris2-interfaces.vala | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mpris2-interfaces.vala') diff --git a/src/mpris2-interfaces.vala b/src/mpris2-interfaces.vala index ab8ac95..160f454 100644 --- a/src/mpris2-interfaces.vala +++ b/src/mpris2-interfaces.vala @@ -55,8 +55,6 @@ public struct PlaylistDetails{ // TODO: API criticisms // Get_playlists should be able to be async => pass in callback pointer -// Lacking the ability to query the current playlist (should be asyncable) -// - needed to keep client and servers in sync // => get_current_playlist -> // Should return PlaylistDetails struct with each field nil if there is no active playlist. // Otherwise a populated PlaylistDetails -- cgit v1.2.3 From 032797fd7a92bc8a4fd979ddc12cacb0918ca73b Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 17 Dec 2010 12:48:03 +0000 Subject: proved active-playlist prop use-case --- src/mpris2-interfaces.vala | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src/mpris2-interfaces.vala') diff --git a/src/mpris2-interfaces.vala b/src/mpris2-interfaces.vala index 160f454..578b6c8 100644 --- a/src/mpris2-interfaces.vala +++ b/src/mpris2-interfaces.vala @@ -50,23 +50,19 @@ public struct PlaylistDetails{ public string name; public string icon_path; } +// Active playlist property container +public struct ActivePlaylistContainer{ + public bool valid; + public PlaylistDetails active_playlist; +} [DBus (name = "org.mpris.MediaPlayer2.Playlists")] - -// TODO: API criticisms -// Get_playlists should be able to be async => pass in callback pointer -// => get_current_playlist -> -// Should return PlaylistDetails struct with each field nil if there is no active playlist. -// Otherwise a populated PlaylistDetails -// should be asyncable. -// => Need to be able to query get_playlist using ordered by last modified. -// => Need a signal to inform that the active playlist has changed - public interface MprisPlaylists : Object { //properties public abstract string[] Orderings{owned get; set;} public abstract uint32 PlaylistCount{owned get; set;} - + public abstract ActivePlaylistContainer ActivePlaylist {owned get; set;} + //methods public abstract async void ActivatePlaylist(ObjectPath playlist_id) throws IOError; public abstract PlaylistDetails[] GetPlaylists ( uint32 index, -- cgit v1.2.3 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-interfaces.vala | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mpris2-interfaces.vala') 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;} -- cgit v1.2.3 From c8c7681e7b9e2995d29fa58c931aa09e451c4fee Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 20 Dec 2010 18:02:50 +0000 Subject: playlists working --- src/mpris2-interfaces.vala | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mpris2-interfaces.vala') diff --git a/src/mpris2-interfaces.vala b/src/mpris2-interfaces.vala index a731de8..88610e6 100644 --- a/src/mpris2-interfaces.vala +++ b/src/mpris2-interfaces.vala @@ -50,6 +50,7 @@ public struct PlaylistDetails{ public string name; public string icon_path; } + // Active playlist property container public struct ActivePlaylistContainer{ public bool valid; -- cgit v1.2.3 From 07197b0c4a8153ad65daecf920d0e0d51b1bebbc Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Sun, 9 Jan 2011 15:05:33 +0000 Subject: nice refactor or mpris code --- src/mpris2-interfaces.vala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mpris2-interfaces.vala') diff --git a/src/mpris2-interfaces.vala b/src/mpris2-interfaces.vala index 88610e6..9d0b8c9 100644 --- a/src/mpris2-interfaces.vala +++ b/src/mpris2-interfaces.vala @@ -16,6 +16,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +const string MPRIS_PREFIX = "org.mpris.MediaPlayer2."; +const string MPRIS_MEDIA_PLAYER_PATH = "/org/mpris/MediaPlayer2"; [DBus (name = "org.mpris.MediaPlayer2")] public interface MprisRoot : Object { @@ -24,7 +26,7 @@ public interface MprisRoot : Object { public abstract bool CanQuit{owned get; set;} public abstract bool CanRaise{owned get; set;} public abstract string Identity{owned get; set;} - public abstract string DesktopEntry{owned get; set;} + public abstract string DesktopEntry{owned get; set;} // methods public abstract async void Quit() throws IOError; public abstract async void Raise() throws IOError; -- cgit v1.2.3