diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-06-06 20:42:22 +0200 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-06-06 20:42:22 +0200 |
commit | a1192a69cfdba207fa3e6ece69363649d8813dcf (patch) | |
tree | af869ae1c53e40a913572b0b81e437f755df8c17 /src/player-controller.vala | |
parent | 78068166398ffaee0bb2d997673139168fdfee3b (diff) | |
download | ayatana-indicator-sound-a1192a69cfdba207fa3e6ece69363649d8813dcf.tar.gz ayatana-indicator-sound-a1192a69cfdba207fa3e6ece69363649d8813dcf.tar.bz2 ayatana-indicator-sound-a1192a69cfdba207fa3e6ece69363649d8813dcf.zip |
track specific items outline implemented
Diffstat (limited to 'src/player-controller.vala')
-rw-r--r-- | src/player-controller.vala | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala index 20479d9..4689a42 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -23,13 +23,14 @@ using Gee; public class PlayerController : GLib.Object { - public const int WIDGET_QUANTITY = 5; + public const int WIDGET_QUANTITY = 6; public static enum widget_order{ SEPARATOR, TITLE, METADATA, TRANSPORT, + TRACK_SPECIFIC, PLAYLISTS } @@ -105,16 +106,24 @@ public class PlayerController : GLib.Object error.message ); } } + + public void enable_track_specific_items() + { + this.custom_items[widget_order.TRACK_SPECIFIC].property_set_bool (MENUITEM_PROP_VISIBLE, + true); + this.custom_items[widget_order.TRACK_SPECIFIC].property_set_bool (MENUITEM_PROP_ENABLED, + true); + } private void establish_mpris_connection() { if(this.current_state != state.READY || this.dbus_name == null ){ debug("establish_mpris_connection - Not ready to connect"); return; - } + } debug ( " establish mpris connection - use playlists value = %s ", this.use_playlists.to_string() ); - + this.mpris_bridge = new Mpris2Controller(this); this.determine_state(); } @@ -183,13 +192,17 @@ 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) != 4) { + if (this.custom_items.index_of(item) != 5) { root_menu.child_add_position(item, this.menu_offset + this.custom_items.index_of(item)); } else{ |