aboutsummaryrefslogtreecommitdiff
path: root/src/player-controller.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/player-controller.vala')
-rw-r--r--src/player-controller.vala21
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{