aboutsummaryrefslogtreecommitdiff
path: root/src/mpris2-controller.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-08-18 11:57:27 +0100
committerConor Curran <conor.curran@canonical.com>2010-08-18 11:57:27 +0100
commit4897f3ce524e6d91ecd0c70142556be0f29367b7 (patch)
tree5aa8c8001b5ea2f7417dd2bf962347e527581425 /src/mpris2-controller.vala
parent75ba919b383a4da5d2634e4f9b85a3cdcbaa907d (diff)
downloadayatana-indicator-sound-4897f3ce524e6d91ecd0c70142556be0f29367b7.tar.gz
ayatana-indicator-sound-4897f3ce524e6d91ecd0c70142556be0f29367b7.tar.bz2
ayatana-indicator-sound-4897f3ce524e6d91ecd0c70142556be0f29367b7.zip
ready for the merge
Diffstat (limited to 'src/mpris2-controller.vala')
-rw-r--r--src/mpris2-controller.vala13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala
index 8b937b7..65d881a 100644
--- a/src/mpris2-controller.vala
+++ b/src/mpris2-controller.vala
@@ -208,10 +208,11 @@ public class Mpris2Controller : GLib.Object
warning("Can't fetch the duration of the track therefore cant set the position");
return;
}
- uint32 total_time = time_value.get_uint();
+ // work in microseconds (scale up by 10 TTP-of 3)
+ uint32 total_time = time_value.get_uint() * 1000;
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));
+ debug("new position = %f", (new_time_position));
Value? v = this.player.Metadata.lookup("trackid");
if(v != null){
@@ -219,11 +220,11 @@ public class Mpris2Controller : GLib.Object
debug("the trackid = %s", v.get_string());
DBus.ObjectPath path = new ObjectPath(v.get_string());
try{
- this.player.SetPosition(path, (int64)(new_time_position * 1000));
+ //this.player.SetPosition(path, (int64)(new_time_position));
}
- catch(DBus.Error error){
- warning("DBus Error calling the player objects SetPosition method %s",
- error.message);
+ catch(DBus.Error e){
+ error("DBus Error calling the player objects SetPosition method %s",
+ e.message);
}
}
}