diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-09-09 18:56:53 +0100 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-09-09 18:56:53 +0100 |
commit | 006dd7249ec75af061b289f38d62aa6589d07cb2 (patch) | |
tree | bc6a502c84d801167ceb3c6b7e6a54ded0bfeb23 | |
parent | 9f05fc93fc37dd326a68174be212cc23d270e00d (diff) | |
parent | 41e5d2ef85dd8f53a70464affdb9bbcab441f788 (diff) | |
download | ayatana-indicator-sound-006dd7249ec75af061b289f38d62aa6589d07cb2.tar.gz ayatana-indicator-sound-006dd7249ec75af061b289f38d62aa6589d07cb2.tar.bz2 ayatana-indicator-sound-006dd7249ec75af061b289f38d62aa6589d07cb2.zip |
merge playlist fixes
-rw-r--r-- | src/mpris2-controller.vala | 5 | ||||
-rw-r--r-- | src/music-player-bridge.vala | 2 | ||||
-rw-r--r-- | src/player-controller.vala | 6 | ||||
-rw-r--r-- | src/playlists-menu-item.vala | 1 | ||||
-rw-r--r-- | src/specific-items-manager.vala | 6 |
5 files changed, 12 insertions, 8 deletions
diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 8eeac08..ce35a06 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -21,11 +21,12 @@ using Transport; public class Mpris2Controller : GLib.Object { + public const int MAX_PLAYLIST_COUNT = 20; + public MprisRoot mpris2_root {get; construct;} public MprisPlayer player {get; construct;} public MprisPlaylists playlists {get; construct;} public FreeDesktopProperties properties_interface {get; construct;} - public PlayerController owner {get; construct;} public Mpris2Controller(PlayerController ctrl) @@ -226,7 +227,7 @@ public class Mpris2Controller : GLib.Object try{ current_playlists = yield this.playlists.GetPlaylists (0, - 10, + MAX_PLAYLIST_COUNT, "Alphabetical", false); } diff --git a/src/music-player-bridge.vala b/src/music-player-bridge.vala index 72c9bdb..0c9cb10 100644 --- a/src/music-player-bridge.vala +++ b/src/music-player-bridge.vala @@ -131,7 +131,7 @@ public class MusicPlayerBridge : GLib.Object this.registered_clients[mpris_key].use_playlists = use_playlists; this.registered_clients[mpris_key].update_state ( PlayerController.state.READY ); this.registered_clients[mpris_key].activate ( dbus_name ); - debug("Application has already registered - awaken the hibernation: %s \n", dbus_name ); + debug("Application has already registered - awaken the hibernation: %s with playlists %s \n", dbus_name, use_playlists.to_string() ); } } diff --git a/src/player-controller.vala b/src/player-controller.vala index 2f5569c..04d0bf9 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -30,6 +30,8 @@ public class PlayerController : GLib.Object TRANSPORT, PLAYLISTS } + + public enum state{ OFFLINE, @@ -169,11 +171,9 @@ public class PlayerController : GLib.Object public void update_layout() { - debug ("a call to update layout"); PlaylistsMenuitem playlists_menuitem = this.custom_items[widget_order.PLAYLISTS] as PlaylistsMenuitem; MetadataMenuitem metadata_menuitem = this.custom_items[widget_order.METADATA] as MetadataMenuitem; if(this.current_state != state.CONNECTED){ - // TODO metadata_menuitem.should_collapse (true); playlists_menuitem.root_item.property_set_bool (MENUITEM_PROP_VISIBLE, false ); @@ -212,7 +212,7 @@ public class PlayerController : GLib.Object this.custom_items.add(playlist_menuitem); foreach(PlayerItem item in this.custom_items){ - if (this.custom_items.index_of(item) == 4) { + if (this.custom_items.index_of(item) == WIDGET_QUANTITY-1) { PlaylistsMenuitem playlists_menuitem = item as PlaylistsMenuitem; root_menu.child_add_position(playlists_menuitem.root_item, this.menu_offset + this.custom_items.index_of(item)); } diff --git a/src/playlists-menu-item.vala b/src/playlists-menu-item.vala index 452a586..9cb7ac7 100644 --- a/src/playlists-menu-item.vala +++ b/src/playlists-menu-item.vala @@ -62,6 +62,7 @@ public class PlaylistsMenuitem : PlayerItem ); this.current_playlists.set( menuitem.id, menuitem ); this.root_item.child_append( menuitem ); + debug ("populating valid playlists %s", detail.name); } // Finally remove any that might have been deleted foreach (Dbusmenu.Menuitem item in this.current_playlists.values) { diff --git a/src/specific-items-manager.vala b/src/specific-items-manager.vala index 1bfe03e..923cf3f 100644 --- a/src/specific-items-manager.vala +++ b/src/specific-items-manager.vala @@ -51,10 +51,12 @@ public class SpecificItemsManager : GLib.Object { int result = 0 ; if (this.of_type == category.TRACK){ - result = this.owner.menu_offset + 4 + this.proxy_items.size; + result = this.owner.menu_offset + this.owner.WIDGET_QUANTITY + this.proxy_items.size; } else if (this.of_type == category.PLAYER){ - int pos = this.owner.menu_offset + 4 + this.owner.track_specific_count(); + int pos = this.owner.menu_offset + this.owner.WIDGET_QUANTITY + this.owner.track_specific_count(); + //Surely the playlists item is there whether its visible or not ? + //TODO test playlists and player specific item positioning. pos += this.owner.use_playlists == true ? 1 : 0; result = pos; } |