aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/player-controller.vala37
-rw-r--r--src/sound-service.c4
2 files changed, 34 insertions, 7 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala
index 7ba2a70..2fa9dd2 100644
--- a/src/player-controller.vala
+++ b/src/player-controller.vala
@@ -23,14 +23,15 @@ 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,
SCRUB,
- TRANSPORT
+ TRANSPORT,
+ PLAYLIST
}
public enum state{
@@ -133,6 +134,8 @@ public class PlayerController : GLib.Object
this.custom_items[widget_order.SCRUB].property_set_bool(MENUITEM_PROP_VISIBLE,
false);
this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE,
+ false);
+ this.custom_items[widget_order.PLAYLIST].property_set_bool(MENUITEM_PROP_VISIBLE,
false);
return;
}
@@ -146,8 +149,10 @@ public class PlayerController : GLib.Object
this.custom_items[widget_order.TRANSPORT].property_set_bool(MENUITEM_PROP_VISIBLE,
- this.current_state == state.CONNECTED);
-
+ true);
+
+ this.custom_items[widget_order.PLAYLIST].property_set_bool(MENUITEM_PROP_VISIBLE,
+ true);
}
private void construct_widgets()
@@ -170,12 +175,34 @@ public class PlayerController : GLib.Object
// Transport item
TransportMenuitem transport_item = new TransportMenuitem(this);
this.custom_items.add(transport_item);
-
+
+ this.custom_items.add(create_playlist());
foreach(PlayerItem item in this.custom_items){
root_menu.child_add_position(item, this.menu_offset + this.custom_items.index_of(item));
}
}
+
+ private PlayerItem create_playlist()
+ {
+ PlayerItem playlist_root = new PlayerItem(CLIENT_TYPES_DEFAULT);
+ playlist_root.property_set(MENUITEM_PROP_LABEL, "Choose Playlist");
+
+ PlayerItem subentry_1 = new PlayerItem(CLIENT_TYPES_DEFAULT);
+ subentry_1.property_set(MENUITEM_PROP_LABEL, "90's Warp");
+
+ PlayerItem subentry_2 = new PlayerItem(CLIENT_TYPES_DEFAULT);
+ subentry_2.property_set(MENUITEM_PROP_LABEL, "Rune Grammafon 00's");
+
+ PlayerItem subentry_3 = new PlayerItem(CLIENT_TYPES_DEFAULT);
+ subentry_3.property_set(MENUITEM_PROP_LABEL, "Kranky pics");
+
+ playlist_root.child_append(subentry_1);
+ playlist_root.child_append(subentry_2);
+ playlist_root.child_append(subentry_3);
+
+ return playlist_root;
+ }
private static string format_client_name(string client_name)
{
diff --git a/src/sound-service.c b/src/sound-service.c
index 16fa87c..8768cd3 100644
--- a/src/sound-service.c
+++ b/src/sound-service.c
@@ -42,8 +42,8 @@ service_shutdown (IndicatorService *service, gpointer user_data)
if (mainloop != NULL) {
g_debug("Service shutdown !");
// TODO: uncomment for release !!
- //close_pulse_activites();
- //g_main_loop_quit(mainloop);
+ close_pulse_activites();
+ g_main_loop_quit(mainloop);
}
return;
}