From e102f3b357c8ee39efde7406d7abfed5c0d16998 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 10 Jan 2011 12:57:35 +0000 Subject: porting in progress --- src/transport-menu-item.vala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/transport-menu-item.vala') diff --git a/src/transport-menu-item.vala b/src/transport-menu-item.vala index 0e4e6ee..55ee3b3 100644 --- a/src/transport-menu-item.vala +++ b/src/transport-menu-item.vala @@ -36,8 +36,8 @@ public class TransportMenuitem : PlayerItem public TransportMenuitem(PlayerController parent) { - Object(item_type: MENUITEM_TYPE, owner: parent); - this.property_set_int(MENUITEM_PLAY_STATE, 1); + Object(item_type: MENUITEM_TYPE, owner: parent); + this.property_set_int(MENUITEM_PLAY_STATE, 1); } public void change_play_state(state update) @@ -47,9 +47,9 @@ public class TransportMenuitem : PlayerItem this.property_set_int(MENUITEM_PLAY_STATE, update); } - public override void handle_event(string name, GLib.Value input_value, uint timestamp) + public override void handle_event(string name, Variant input_value, uint timestamp) { - int input = input_value.get_int(); + int input = input_value.get_int32(); debug("handle_event with value %s", input.to_string()); debug("transport owner name = %s", this.owner.app_info.get_name()); this.owner.mpris_bridge.transport_update((action)input); -- cgit v1.2.3 From 765d17777a49c1742371216b46b2992ff7dfc191 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 11 Jan 2011 09:13:20 -0600 Subject: working nicely --- src/transport-menu-item.vala | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/transport-menu-item.vala') diff --git a/src/transport-menu-item.vala b/src/transport-menu-item.vala index 55ee3b3..e93f0bb 100644 --- a/src/transport-menu-item.vala +++ b/src/transport-menu-item.vala @@ -47,11 +47,20 @@ public class TransportMenuitem : PlayerItem this.property_set_int(MENUITEM_PLAY_STATE, update); } - public override void handle_event(string name, Variant input_value, uint timestamp) + public override void handle_event(string name, + Variant input_value, + uint timestamp) { - int input = input_value.get_int32(); - debug("handle_event with value %s", input.to_string()); - debug("transport owner name = %s", this.owner.app_info.get_name()); + /*debug ( "Handle event in transport menu item - input variant is of type %s", + input_value.get_type_string() );*/ + Variant v = input_value; + if ( input_value.is_of_type ( VariantType.VARIANT) ){ + v = input_value.get_variant(); + } + + int32 input = v.get_int32(); + debug("transport menu item -> handle_event with value %s", input.to_string()); + //debug("transport owner name = %s", this.owner.app_info.get_name()); this.owner.mpris_bridge.transport_update((action)input); } -- cgit v1.2.3