diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-07-22 19:56:43 +0200 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-07-22 19:56:43 +0200 |
commit | cf97680d74aa9ab00cd55359d9e16acdad9f057f (patch) | |
tree | 5a96a46ad8617c0fc7f24870f4d3840078b7a50d /src/mpris-controller.vala | |
parent | 928fbf4bab7659ec523ae16adc052ca42fece589 (diff) | |
download | ayatana-indicator-sound-cf97680d74aa9ab00cd55359d9e16acdad9f057f.tar.gz ayatana-indicator-sound-cf97680d74aa9ab00cd55359d9e16acdad9f057f.tar.bz2 ayatana-indicator-sound-cf97680d74aa9ab00cd55359d9e16acdad9f057f.zip |
trying to set the time line
Diffstat (limited to 'src/mpris-controller.vala')
-rw-r--r-- | src/mpris-controller.vala | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mpris-controller.vala b/src/mpris-controller.vala index 9586b3d..8ecd20a 100644 --- a/src/mpris-controller.vala +++ b/src/mpris-controller.vala @@ -65,8 +65,7 @@ public class MprisController : GLib.Object ScrubMenuitem.attributes_format()); // temporary fix ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; - scrub.update_position(this.mpris_player.PositionGet()); - + scrub.update_position(this.mpris_player.PositionGet()); } public void transport_event(TransportMenuitem.action command) @@ -86,7 +85,7 @@ public class MprisController : GLib.Object public void set_position(double position) { - //debug("Set position with pos (0-100) %f", position); + debug("Set position with pos (0-100) %f", position); HashTable<string, Value?> data = this.mpris_player.GetMetadata(); Value? time_value = data.lookup("time"); if(time_value == null){ @@ -94,10 +93,12 @@ public class MprisController : GLib.Object return; } uint32 total_time = time_value.get_uint(); - //debug("total time of track = %i", (int)total_time); + 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)); - this.mpris_player.PositionSet((int32)(new_time_position * 1000)); + debug("new position = %f", (new_time_position * 1000)); + this.mpris_player.PositionSet((int32)(new_time_position)); + ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem; + scrub.update_position(this.mpris_player.PositionGet()); } public bool connected() |