aboutsummaryrefslogtreecommitdiff
path: root/src/mpris2-controller.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-08-11 20:04:04 +0100
committerConor Curran <conor.curran@canonical.com>2010-08-11 20:04:04 +0100
commitb63691637ebc766e90c0da44e76cc7b9cc49872e (patch)
tree2c745c8bfa45f3d45402ce5e21308f5391e11de2 /src/mpris2-controller.vala
parent9244bd84d655fae8bbb2772d4aac1550b57a7c1c (diff)
downloadayatana-indicator-sound-b63691637ebc766e90c0da44e76cc7b9cc49872e.tar.gz
ayatana-indicator-sound-b63691637ebc766e90c0da44e76cc7b9cc49872e.tar.bz2
ayatana-indicator-sound-b63691637ebc766e90c0da44e76cc7b9cc49872e.zip
mpris2 working for now, but its all going to change again
Diffstat (limited to 'src/mpris2-controller.vala')
-rw-r--r--src/mpris2-controller.vala25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala
index 00d7bb0..20cfc9e 100644
--- a/src/mpris2-controller.vala
+++ b/src/mpris2-controller.vala
@@ -126,9 +126,18 @@ public class Mpris2Controller : GLib.Object
debug("total time of track = %i", (int)total_time);
double new_time_position = total_time * position/100.0;
debug("new position = %f", (new_time_position * 1000));
- int32 trackid = this.mpris2_player.Metadata.lookup("trackid");
- debug("the trackid = %i", trackid);
- this.mpris2_player.SetPosition((int32)(new_time_position));
+
+ Value? v = this.mpris2_player.Metadata.lookup("trackid");
+ if(v != null){
+ if(v.holds (typeof (int))){
+ debug("the trackid = %i", v.get_int());
+ }
+ else if(v.holds (typeof (string))){
+ debug("the trackid = %s", v.get_string());
+ }
+ }
+
+ //this.mpris2_player.SetPosition((int32)(new_time_position));
ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem;
scrub.update_position(this.mpris2_player.Position);
}
@@ -156,12 +165,18 @@ public class Mpris2Controller : GLib.Object
this.owner.custom_items[PlayerController.widget_order.METADATA].update(ht,
MetadataMenuitem.attributes_format());
debug("about to update the duration on the scrub bar");
-
- this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris2_player.Metadata,
+ Value? v = ht.lookup("time");
+ if(v != null)
+ {
+ debug("with the duration of %i", (int)v.get_uint());
+ debug("with Position of %i", this.mpris2_player.Position);
+ }
+ this.owner.custom_items[PlayerController.widget_order.SCRUB].update(ht,
ScrubMenuitem.attributes_format());
ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem;
scrub.update_position(this.mpris2_player.Position);
}
+
}