aboutsummaryrefslogtreecommitdiff
path: root/src/mpris2-controller.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-09-13 12:49:01 +0100
committerConor Curran <conor.curran@canonical.com>2010-09-13 12:49:01 +0100
commit61f5618272f6e9ef010965b546344d67f39650f7 (patch)
tree071507b273b51dfaf06cec53759d149e7b85cd8e /src/mpris2-controller.vala
parent40cde0089157e7ac2475b32ff2afad9ea031260b (diff)
downloadayatana-indicator-sound-61f5618272f6e9ef010965b546344d67f39650f7.tar.gz
ayatana-indicator-sound-61f5618272f6e9ef010965b546344d67f39650f7.tar.bz2
ayatana-indicator-sound-61f5618272f6e9ef010965b546344d67f39650f7.zip
removed redundant scrub code
Diffstat (limited to 'src/mpris2-controller.vala')
-rw-r--r--src/mpris2-controller.vala43
1 files changed, 1 insertions, 42 deletions
diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala
index 4717f41..bab20ae 100644
--- a/src/mpris2-controller.vala
+++ b/src/mpris2-controller.vala
@@ -83,11 +83,8 @@ public class Mpris2Controller : GLib.Object
this.player = (MprisPlayer) connection.get_object (root_interface.concat(".").concat(this.owner.name.down()),
"/org/mpris/MediaPlayer2",
root_interface.concat(".Player"));
- this.player.Seeked += onSeeked;
-
this.properties_interface = (FreeDesktopProperties) connection.get_object("org.freedesktop.Properties.PropertiesChanged",//root_interface.concat(".").concat(this.owner.name.down()),
- "/org/mpris/MediaPlayer2");
-
+ "/org/mpris/MediaPlayer2");
this.properties_interface.PropertiesChanged += property_changed_cb;
} catch (DBus.Error e) {
@@ -98,8 +95,6 @@ public class Mpris2Controller : GLib.Object
public void property_changed_cb(string interface_source, HashTable<string, Value?> changed_properties, string[] invalid )
{
debug("properties-changed for interface %s and owner %s", interface_source, this.owner.name.down());
- debug("is the invalid array null : %s", (invalid == null).to_string());
- debug("invalid length : %i", invalid.length);
if(changed_properties == null || interface_source.has_prefix(this.root_interface) == false ){
warning("Property-changed hash is null or this is an interface that doesn't concerns us");
@@ -207,42 +202,6 @@ public class Mpris2Controller : GLib.Object
}
}
}
- /**
- TODO: SetPosition on the player object is not working with rhythmbox,
- runtime error - "dbus function not supported"
- */
- public void set_track_position(double position)
- {
- debug("Set position with pos (0-100) %f", position);
- Value? time_value = this.player.Metadata.lookup("mpris:length");
- if(time_value == null){
- warning("Can't fetch the duration of the track therefore cant set the position");
- return;
- }
- // work in microseconds (scale up by 10 TTP-of 6)
- int64 total_time = time_value.get_int64();
- 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));
-
- Value? v = this.player.Metadata.lookup("mpris:trackid");
- if(v != null){
- if(v.holds (typeof (string))){
- DBus.ObjectPath path = new ObjectPath(v.get_string());
- try{
- this.player.SetPosition(path, (int64)(new_time_position));
- }
- catch(DBus.Error e){
- error("DBus Error calling the player objects SetPosition method %s",
- e.message);
- }
- }
- }
- }
-
- public void onSeeked(int64 position){
- debug("Seeked signal callback with pos = %i", (int)position/1000);
- }
public bool connected()
{