aboutsummaryrefslogtreecommitdiff
path: root/src/player-controller.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-12-17 16:25:04 +0000
committerConor Curran <conor.curran@canonical.com>2010-12-17 16:25:04 +0000
commit80ce8f642c251dc765267fa1b1978fec59d23c97 (patch)
tree3966c20e333cc79744fe54e4aa699a693b934efd /src/player-controller.vala
parent7ea64f857b5f76cd06e01bfe49eda27c2d2da335 (diff)
parent032797fd7a92bc8a4fd979ddc12cacb0918ca73b (diff)
downloadayatana-indicator-sound-80ce8f642c251dc765267fa1b1978fec59d23c97.tar.gz
ayatana-indicator-sound-80ce8f642c251dc765267fa1b1978fec59d23c97.tar.bz2
ayatana-indicator-sound-80ce8f642c251dc765267fa1b1978fec59d23c97.zip
playlists - working nicely
Diffstat (limited to 'src/player-controller.vala')
-rw-r--r--src/player-controller.vala27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala
index 97f5303..24fd090 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 = 4;
+ public const int WIDGET_QUANTITY = 5;
public static enum widget_order{
SEPARATOR,
TITLE,
METADATA,
- TRANSPORT
+ TRANSPORT,
+ PLAYLISTS
}
public enum state{
@@ -135,12 +136,16 @@ public class PlayerController : GLib.Object
false);
this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE,
false);
+ this.custom_items[widget_order.PLAYLISTS].property_set_bool ( MENUITEM_PROP_ENABLED,
+ false );
return;
}
this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE,
this.custom_items[widget_order.METADATA].populated(MetadataMenuitem.attributes_format()));
this.custom_items[widget_order.TRANSPORT].property_set_bool(MENUITEM_PROP_VISIBLE,
true);
+ this.custom_items[widget_order.PLAYLISTS].property_set_bool(MENUITEM_PROP_VISIBLE,
+ true);
}
private void construct_widgets()
@@ -159,9 +164,19 @@ public class PlayerController : GLib.Object
// Transport item
TransportMenuitem transport_item = new TransportMenuitem(this);
this.custom_items.add(transport_item);
-
+
+ // Playlist item
+ PlaylistsMenuitem playlist_menuitem = new PlaylistsMenuitem(this);
+ this.custom_items.add(playlist_menuitem);
+
foreach(PlayerItem item in this.custom_items){
- root_menu.child_add_position(item, this.menu_offset + this.custom_items.index_of(item));
+ if (this.custom_items.index_of(item) != 4) {
+ root_menu.child_add_position(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));
+ }
}
}
@@ -184,11 +199,11 @@ 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);
+ title.toggle_active_triangle(true);
this.mpris_bridge.initial_update();
}
else{
this.update_state(state.DISCONNECTED);
}
- }
+ }
}