diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-12-21 14:53:56 +0000 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-12-21 14:53:56 +0000 |
commit | 4843ae15f1ce4111c03b0fc24f5a8989d0619697 (patch) | |
tree | 55c320b02c23bedfc750ea25702d461402205520 /src/mpris2-controller.vala | |
parent | c8c7681e7b9e2995d29fa58c931aa09e451c4fee (diff) | |
download | ayatana-indicator-sound-4843ae15f1ce4111c03b0fc24f5a8989d0619697.tar.gz ayatana-indicator-sound-4843ae15f1ce4111c03b0fc24f5a8989d0619697.tar.bz2 ayatana-indicator-sound-4843ae15f1ce4111c03b0fc24f5a8989d0619697.zip |
playlists ready to go into trunk
Diffstat (limited to 'src/mpris2-controller.vala')
-rw-r--r-- | src/mpris2-controller.vala | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 35dc4e4..5f98541 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -97,6 +97,7 @@ public class Mpris2Controller : GLib.Object Variant? playlist_v = changed_properties.lookup("ActivePlaylist"); if ( playlist_v != null ){ this.fetch_active_playlist(); + //Timeout.add ( 200, fetch_active_playlist ); } } @@ -154,6 +155,7 @@ public class Mpris2Controller : GLib.Object this.owner.custom_items[PlayerController.widget_order.METADATA].update(cleaned_metadata, MetadataMenuitem.attributes_format()); this.fetch_playlists(); + this.fetch_active_playlist(); } public void transport_update(TransportMenuitem.action command) @@ -172,10 +174,8 @@ public class Mpris2Controller : GLib.Object public void fetch_playlists() { - if (this.playlists == null){ - warning("Playlists object is null"); - return; - } + if (this.playlists == null) return; + PlaylistDetails[] current_playlists = this.playlists.GetPlaylists(0, 10, "Alphabetical", @@ -184,30 +184,17 @@ public class Mpris2Controller : GLib.Object debug( "Size of the playlist array = %i", current_playlists.length ); PlaylistsMenuitem playlists_item = this.owner.custom_items[PlayerController.widget_order.PLAYLISTS] as PlaylistsMenuitem; playlists_item.update(current_playlists); - /*foreach(PlaylistDetails detail in current_playlists){ - debug(" \n \n "); - debug( "Playlist Name = %s", detail.name); - debug( "Playlist path = %s", detail.path); - debug( "Playlist icon path = %s", detail.icon_path); - debug(" \n \n "); - }*/ } + return; } - public void fetch_active_playlist() + private void fetch_active_playlist() { - if (this.playlists == null && this.playlists.ActivePlaylist.valid == true){ + if (this.playlists == null && this.playlists.ActivePlaylist.valid == false){ warning("Playlists object is null or we don't have an active playlist"); - return; } PlaylistsMenuitem playlists_item = this.owner.custom_items[PlayerController.widget_order.PLAYLISTS] as PlaylistsMenuitem; playlists_item.update_active_playlist ( this.playlists.ActivePlaylist.details ); - /*debug(" \n \n "); - debug( "Active Playlist Name = %s", active_details.name); - debug( "Active Playlist path = %s", active_details.path); - debug( "Active Playlist icon path = %s", active_details.icon_path); - debug(" \n \n "); - */ } |