From 7576ffb4d9b247d1db2e44a7ea0f4ec8b5101f20 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 8 Mar 2011 21:43:50 +0000 Subject: seeking is working, need a tidy up --- src/mpris2-controller.vala | 6 ++++++ src/mpris2-interfaces.vala | 1 + src/transport-menu-item.vala | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index e5bc1f6..dae8dfb 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -186,6 +186,12 @@ public class Mpris2Controller : GLib.Object else if(command == TransportMenuitem.action.NEXT){ this.player.Next.begin(); } + else if(command == TransportMenuitem.action.REWIND){ + this.player.Seek.begin(-1); + } + else if(command == TransportMenuitem.action.FORWIND){ + this.player.Seek.begin(1); + } } public bool connected() diff --git a/src/mpris2-interfaces.vala b/src/mpris2-interfaces.vala index 5506a47..5dab1d2 100644 --- a/src/mpris2-interfaces.vala +++ b/src/mpris2-interfaces.vala @@ -42,6 +42,7 @@ public interface MprisPlayer : Object { public abstract async void PlayPause() throws IOError; public abstract async void Next() throws IOError; public abstract async void Previous() throws IOError; + public abstract async void Seek(int64 offset) throws IOError; // signals public signal void Seeked(int64 new_position); } diff --git a/src/transport-menu-item.vala b/src/transport-menu-item.vala index b0009d9..d5ae283 100644 --- a/src/transport-menu-item.vala +++ b/src/transport-menu-item.vala @@ -26,7 +26,9 @@ public class TransportMenuitem : PlayerItem public enum action{ PREVIOUS, PLAY_PAUSE, - NEXT + NEXT, + REWIND, + FORWIND } public enum state{ -- cgit v1.2.3