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.vala29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala
index 20479d9..1ff8b08 100644
--- a/src/player-controller.vala
+++ b/src/player-controller.vala
@@ -23,11 +23,10 @@ using Gee;
public class PlayerController : GLib.Object
{
- public const int WIDGET_QUANTITY = 5;
+ public const int WIDGET_QUANTITY = 4;
public static enum widget_order{
SEPARATOR,
- TITLE,
METADATA,
TRANSPORT,
PLAYLISTS
@@ -111,10 +110,10 @@ public class PlayerController : GLib.Object
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();
}
@@ -136,8 +135,8 @@ public class PlayerController : GLib.Object
TransportMenuitem transport = this.custom_items[widget_order.TRANSPORT] as TransportMenuitem;
transport.change_play_state (Transport.State.PAUSED);
this.custom_items[widget_order.METADATA].reset(MetadataMenuitem.attributes_format());
- TitleMenuitem title = this.custom_items[widget_order.TITLE] as TitleMenuitem;
- title.toggle_active_triangle(false);
+ MetadataMenuitem md = this.custom_items[widget_order.METADATA] as MetadataMenuitem;
+ md.toggle_active_triangle(false);
this.mpris_bridge = null;
}
@@ -172,12 +171,8 @@ public class PlayerController : GLib.Object
// Separator item
this.custom_items.add(new PlayerItem(CLIENT_TYPES_SEPARATOR));
- // Title item
- TitleMenuitem title_menu_item = new TitleMenuitem(this);
- this.custom_items.add(title_menu_item);
-
// Metadata item
- MetadataMenuitem metadata_item = new MetadataMenuitem();
+ MetadataMenuitem metadata_item = new MetadataMenuitem(this);
this.custom_items.add(metadata_item);
// Transport item
@@ -189,12 +184,12 @@ 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) {
- root_menu.child_add_position(item, this.menu_offset + this.custom_items.index_of(item));
+ if (this.custom_items.index_of(item) == 3) {
+ 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{
- PlaylistsMenuitem playlists_menuitem = item as PlaylistsMenuitem;
- root_menu.child_add_position(playlists_menuitem.root_item, this.menu_offset + this.custom_items.index_of(item));
+ root_menu.child_add_position(item, this.menu_offset + this.custom_items.index_of(item));
}
}
}
@@ -203,8 +198,8 @@ public class PlayerController : GLib.Object
{
if(this.mpris_bridge.connected() == true){
this.update_state(state.CONNECTED);
- TitleMenuitem title = this.custom_items[widget_order.TITLE] as TitleMenuitem;
- title.toggle_active_triangle(true);
+ MetadataMenuitem md = this.custom_items[widget_order.METADATA] as MetadataMenuitem;
+ md.toggle_active_triangle(true);
this.mpris_bridge.initial_update();
}
else{