From f383ead1168dde3374dabc2040035907d4ab484d Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 12 Jul 2010 16:13:48 +0100 Subject: the beginnings of the scrub bar --- src/scrub-menu-item.vala | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/scrub-menu-item.vala (limited to 'src/scrub-menu-item.vala') diff --git a/src/scrub-menu-item.vala b/src/scrub-menu-item.vala new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3 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/scrub-menu-item.vala | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'src/scrub-menu-item.vala') diff --git a/src/scrub-menu-item.vala b/src/scrub-menu-item.vala index e69de29..409494a 100644 --- a/src/scrub-menu-item.vala +++ b/src/scrub-menu-item.vala @@ -0,0 +1,43 @@ +/* +Copyright 2010 Canonical Ltd. + +Authors: + Conor Curran + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see . +*/ + +using Dbusmenu; +using DbusmenuScrub; +using Gee; + +public class ScrubMenuitem : PlayerItem +{ + public ScrubMenuitem(PlayerController parent) + { + Object(item_type: MENUITEM_TYPE); + } + + public override void handle_event(string name, GLib.Value input_value, uint timestamp) + { + debug("handle_event for owner %s with owner state = %i", this.owner.name, this.owner.current_state); + } + + public static HashSet attributes_format() + { + HashSet attrs = new HashSet(); + attrs.add(MENUITEM_DURATION); + attrs.add(MENUITEM_POSITION); + return attrs; + } +} \ No newline at end of file -- 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/scrub-menu-item.vala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/scrub-menu-item.vala') diff --git a/src/scrub-menu-item.vala b/src/scrub-menu-item.vala index 409494a..9988378 100644 --- a/src/scrub-menu-item.vala +++ b/src/scrub-menu-item.vala @@ -25,12 +25,14 @@ public class ScrubMenuitem : PlayerItem { public ScrubMenuitem(PlayerController parent) { - Object(item_type: MENUITEM_TYPE); + debug("Transport object constructor - service side"); + Object(item_type: MENUITEM_TYPE, owner: parent); } public override void handle_event(string name, GLib.Value input_value, uint timestamp) { - debug("handle_event for owner %s with owner state = %i", this.owner.name, this.owner.current_state); + debug("handle_event for owner %s with value: %f", this.owner.name, input_value.get_double()); + this.owner.mpris_adaptor.set_position(input_value.get_double()); } public static HashSet attributes_format() -- cgit v1.2.3 From 6bab9d75b22aa21ed27e4961e6dbf4bbcdd2e94c Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 15 Jul 2010 13:23:52 +0100 Subject: label text updating according to position and duration and scrub bar positioning now working --- src/scrub-menu-item.vala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/scrub-menu-item.vala') diff --git a/src/scrub-menu-item.vala b/src/scrub-menu-item.vala index 9988378..cfd6312 100644 --- a/src/scrub-menu-item.vala +++ b/src/scrub-menu-item.vala @@ -25,7 +25,6 @@ public class ScrubMenuitem : PlayerItem { public ScrubMenuitem(PlayerController parent) { - debug("Transport object constructor - service side"); Object(item_type: MENUITEM_TYPE, owner: parent); } @@ -34,6 +33,12 @@ public class ScrubMenuitem : PlayerItem debug("handle_event for owner %s with value: %f", this.owner.name, input_value.get_double()); this.owner.mpris_adaptor.set_position(input_value.get_double()); } + + public void update_position(int32 new_position) + { + this.property_set_int(MENUITEM_POSITION, new_position); + } + public static HashSet attributes_format() { -- cgit v1.2.3 From 928fbf4bab7659ec523ae16adc052ca42fece589 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 21 Jul 2010 11:56:15 +0200 Subject: scrub bar working --- src/scrub-menu-item.vala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/scrub-menu-item.vala') diff --git a/src/scrub-menu-item.vala b/src/scrub-menu-item.vala index cfd6312..29fa903 100644 --- a/src/scrub-menu-item.vala +++ b/src/scrub-menu-item.vala @@ -37,14 +37,14 @@ public class ScrubMenuitem : PlayerItem public void update_position(int32 new_position) { this.property_set_int(MENUITEM_POSITION, new_position); - } - + } public static HashSet attributes_format() { HashSet attrs = new HashSet(); attrs.add(MENUITEM_DURATION); attrs.add(MENUITEM_POSITION); + attrs.add(MENUITEM_PLAY_STATE); return attrs; } } \ No newline at end of file -- cgit v1.2.3