From 4897f3ce524e6d91ecd0c70142556be0f29367b7 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 18 Aug 2010 11:57:27 +0100 Subject: ready for the merge --- src/mpris2-controller.vala | 13 +++++++------ src/sound-service.c | 5 ++--- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') 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); } } } diff --git a/src/sound-service.c b/src/sound-service.c index 16fa87c..12f067e 100644 --- a/src/sound-service.c +++ b/src/sound-service.c @@ -25,7 +25,6 @@ with this program. If not, see . static GMainLoop *mainloop = NULL; - /**********************************************************************************************************************/ // Init and exit functions /**********************************************************************************************************************/ @@ -42,8 +41,8 @@ service_shutdown (IndicatorService *service, gpointer user_data) if (mainloop != NULL) { g_debug("Service shutdown !"); // TODO: uncomment for release !! - //close_pulse_activites(); - //g_main_loop_quit(mainloop); + close_pulse_activites(); + g_main_loop_quit(mainloop); } return; } -- cgit v1.2.3