From 4325e0092d77cc2d993c7305c49d0517f3defb0e Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 13 Jul 2010 12:18:08 +0100 Subject: prep work done for scrub bar --- src/player-controller.vala | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/player-controller.vala') diff --git a/src/player-controller.vala b/src/player-controller.vala index d272d14..db81ee2 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -23,8 +23,16 @@ using Gee; public class PlayerController : GLib.Object { - public const int METADATA = 2; - private const int TRANSPORT = 3; + public const int WIDGET_QUANTITY = 4;//for now //5; + + public static enum widget_order{ + SEPARATOR, + TITLE, + METADATA, + TRANSPORT + } + //public const int METADATA = 2; + //private const int TRANSPORT = 3; public enum state{ OFFLINE, @@ -51,7 +59,6 @@ public class PlayerController : GLib.Object this.custom_items = new ArrayList(); this.update_state(initial_state); this.menu_offset = offset; - debug("offset = %i", offset); construct_widgets(); establish_mpris_connection(); update_layout(); @@ -66,7 +73,7 @@ public class PlayerController : GLib.Object public void activate() { this.establish_mpris_connection(); - this.custom_items[METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, true); + this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, true); } /* @@ -126,8 +133,8 @@ public class PlayerController : GLib.Object visibility = false; } debug("about the set the visibility on both the transport and metadata widget to %s", visibility.to_string()); - this.custom_items[TRANSPORT].property_set_bool(MENUITEM_PROP_VISIBLE, visibility); - this.custom_items[METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, visibility); + this.custom_items[widget_order.TRANSPORT].property_set_bool(MENUITEM_PROP_VISIBLE, visibility); + this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, visibility); // DEBUG if(this.mpris_adaptor == null){ warning("Why is the mpris object null"); -- cgit v1.2.3 From bf4f73249f5b6bf4c9196f251382c5a6cec9634f Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 14 Jul 2010 18:03:32 +0100 Subject: scrub bar almost working - vala Glib value bugs again are biting me --- src/player-controller.vala | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/player-controller.vala') diff --git a/src/player-controller.vala b/src/player-controller.vala index db81ee2..48416b9 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -23,16 +23,15 @@ using Gee; public class PlayerController : GLib.Object { - public const int WIDGET_QUANTITY = 4;//for now //5; + public const int WIDGET_QUANTITY = 5; public static enum widget_order{ SEPARATOR, TITLE, METADATA, + SCRUB, TRANSPORT } - //public const int METADATA = 2; - //private const int TRANSPORT = 3; public enum state{ OFFLINE, @@ -134,14 +133,14 @@ public class PlayerController : GLib.Object } debug("about the set the visibility on both the transport and metadata widget to %s", visibility.to_string()); this.custom_items[widget_order.TRANSPORT].property_set_bool(MENUITEM_PROP_VISIBLE, visibility); - this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, visibility); + this.custom_items[widget_order.SCRUB].property_set_bool(MENUITEM_PROP_VISIBLE, visibility); + this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, visibility); // DEBUG if(this.mpris_adaptor == null){ warning("Why is the mpris object null"); } } - - + private void construct_widgets() { // Separator item @@ -154,11 +153,16 @@ public class PlayerController : GLib.Object // Metadata item MetadataMenuitem metadata_item = new MetadataMenuitem(); this.custom_items.add(metadata_item); - + + // Scrub item + ScrubMenuitem scrub_item = new ScrubMenuitem(this); + this.custom_items.add(scrub_item); + // Transport item TransportMenuitem transport_item = new TransportMenuitem(this); this.custom_items.add(transport_item); + foreach(PlayerItem item in this.custom_items){ root_menu.child_add_position(item, this.menu_offset + this.custom_items.index_of(item)); } -- cgit v1.2.3 From cf97680d74aa9ab00cd55359d9e16acdad9f057f Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 22 Jul 2010 19:56:43 +0200 Subject: trying to set the time line --- src/player-controller.vala | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/player-controller.vala') diff --git a/src/player-controller.vala b/src/player-controller.vala index 48416b9..f824d6f 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -60,13 +60,14 @@ public class PlayerController : GLib.Object this.menu_offset = offset; construct_widgets(); establish_mpris_connection(); - update_layout(); + this.update_layout(); } public void update_state(state new_state) { debug("update_state - player controller %s : new state %i", this.name, new_state); this.current_state = new_state; + //this.update_layout(); } public void activate() @@ -125,10 +126,12 @@ public class PlayerController : GLib.Object } } - private void update_layout() + public void update_layout() { bool visibility = true; - if(this.current_state != state.CONNECTED){ + MetadataMenuitem meta_item = this.custom_items[widget_order.METADATA] as MetadataMenuitem; + if(this.current_state != state.CONNECTED /*|| + meta_item.not_populated()*/){ visibility = false; } debug("about the set the visibility on both the transport and metadata widget to %s", visibility.to_string()); @@ -136,8 +139,8 @@ public class PlayerController : GLib.Object this.custom_items[widget_order.SCRUB].property_set_bool(MENUITEM_PROP_VISIBLE, visibility); this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, visibility); // DEBUG - if(this.mpris_adaptor == null){ - warning("Why is the mpris object null"); + if(visibility == false){ + warning("Update layout of client %s is setting widgets to invisibile!", this.name); } } -- cgit v1.2.3