diff --git a/src/mpris.vala b/src/mpris.vala index 8243845..7d69bd9 100644 --- a/src/mpris.vala +++ b/src/mpris.vala @@ -40,7 +40,7 @@ class MprisPlayer : Object { internal signal void on_stop (); internal signal void on_play (); internal signal void on_seek (int64 offset); - internal signal void on_set_position (string track_id, int64 position); + internal signal void on_set_position (ObjectPath track_id, int64 position); public void next () throws Error { this.on_next (); } public void previous () throws Error { this.on_previous (); } @@ -49,7 +49,7 @@ class MprisPlayer : Object { public void stop () throws Error { this.on_stop (); } public void play () throws Error { this.on_play (); } public void seek (int64 offset) throws Error { this.on_seek (offset); } - public void set_position (string track_id, int64 position) throws Error { this.on_set_position (track_id, position); } + public void set_position (ObjectPath track_id, int64 position) throws Error { this.on_set_position (track_id, position); } public void open_uri (string uri) throws Error { assert (false); } public signal void seeked (int64 position); @@ -152,6 +152,12 @@ class MprisPlayer : Object { if (playbin.state == PlaybinState.PAUSED) playbin.play (); else if (playbin.state == PlaybinState.PLAYING) playbin.pause (); }); + this.on_stop.connect (() => { + playbin.stop (); + }); + + // TODO: seeking from mpris + // TODO: trigger the seeked signal when applicable this.notify.connect ((p) => { var builder = new VariantBuilder (VariantType.ARRAY);