diff options
Diffstat (limited to 'src/player-controller.vala')
-rw-r--r-- | src/player-controller.vala | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala index a08f692..52adb23 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -23,12 +23,13 @@ using Gee; public class PlayerController : GLib.Object { - public const int WIDGET_QUANTITY = 4; + public const int WIDGET_QUANTITY = 5; public static enum widget_order{ SEPARATOR, METADATA, TRANSPORT, + TRACK_SPECIFIC, PLAYLISTS } @@ -105,6 +106,14 @@ public class PlayerController : GLib.Object error.message ); } } + + public void enable_track_specific_items() + { + debug ("enable_track_specific_items"); + TrackSpecificMenuitem menuitem = this.custom_items[widget_order.TRACK_SPECIFIC] as TrackSpecificMenuitem; + menuitem.root_item.property_set_bool (MENUITEM_PROP_VISIBLE, true); + menuitem.root_item.property_set_bool (MENUITEM_PROP_ENABLED, true); + } private void establish_mpris_connection() { @@ -180,16 +189,24 @@ public class PlayerController : GLib.Object // Transport item TransportMenuitem transport_item = new TransportMenuitem(this); this.custom_items.add(transport_item); + + // Track Specific item + TrackSpecificMenuitem track_specific_item = new TrackSpecificMenuitem(this); + this.custom_items.add(track_specific_item); // Playlist item PlaylistsMenuitem playlist_menuitem = new PlaylistsMenuitem(this); this.custom_items.add(playlist_menuitem); foreach(PlayerItem item in this.custom_items){ - if (this.custom_items.index_of(item) == 3) { + if (this.custom_items.index_of(item) == 4) { PlaylistsMenuitem playlists_menuitem = item as PlaylistsMenuitem; root_menu.child_add_position(playlists_menuitem.root_item, this.menu_offset + this.custom_items.index_of(item)); } + else if (this.custom_items.index_of(item) == 3) { + TrackSpecificMenuitem trackspecific_menuitem = item as TrackSpecificMenuitem; + root_menu.child_add_position(trackspecific_menuitem.root_item, this.menu_offset + this.custom_items.index_of(item)); + } else{ root_menu.child_add_position(item, this.menu_offset + this.custom_items.index_of(item)); } |