diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-07-14 23:36:29 +0100 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-07-14 23:36:29 +0100 |
commit | 4823b3c35b8e8c1334ad947286abf0d88b6de701 (patch) | |
tree | 9b5115bcc4e50e744467afa4f497f6199634730b /src/mpris-controller.vala | |
parent | bf4f73249f5b6bf4c9196f251382c5a6cec9634f (diff) | |
download | ayatana-indicator-sound-4823b3c35b8e8c1334ad947286abf0d88b6de701.tar.gz ayatana-indicator-sound-4823b3c35b8e8c1334ad947286abf0d88b6de701.tar.bz2 ayatana-indicator-sound-4823b3c35b8e8c1334ad947286abf0d88b6de701.zip |
positionset now working - tested with vlc
Diffstat (limited to 'src/mpris-controller.vala')
-rw-r--r-- | src/mpris-controller.vala | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mpris-controller.vala b/src/mpris-controller.vala index afe9190..f40614c 100644 --- a/src/mpris-controller.vala +++ b/src/mpris-controller.vala @@ -26,8 +26,6 @@ public class MprisController : GLib.Object public dynamic DBus.Object mpris_player{get; construct;} public PlayerController owner {get; construct;} public string mpris_interface {get; construct;} - private string name; - struct status { public int32 playback; @@ -99,17 +97,18 @@ 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){ warning("Can't fetch the duration of the track therefore cant set the position"); return; } - uint32 total_time = time_value.get_uint32(); - debug("total time of track = %i", (int)total_time); + uint32 total_time = time_value.get_uint(); + //debug("total time of track = %i", (int)total_time); double new_time_position = total_time * position/100.0; - this.mpris_player.SetPosition((int)(new_time_position * 1000)); + //debug("new position = %f", (new_time_position * 1000)); + this.mpris_player.PositionSet((int32)(new_time_position * 1000)); } public bool connected() |