From 764dce0dc1abcaa66b872f44b2cd9b6158d1dc37 Mon Sep 17 00:00:00 2001 From: Qball Cow Date: Thu, 13 Aug 2009 09:46:59 +0200 Subject: [PATCH] Toggle play/pause on play command. --- mmkeys.vala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mmkeys.vala b/mmkeys.vala index 7d06a30..b7b9818 100644 --- a/mmkeys.vala +++ b/mmkeys.vala @@ -42,7 +42,12 @@ public class MMKeys : Gmpc.Plugin.Base { private void callback (MediaKeys mkeys, string application, string keys) { if(this.get_enabled() == false) return; if(application != "gmpc") return; - if(keys == "Play") MPD.Player.play(server); + if(keys == "Play") { + if(MPD.Player.get_state(server) == MPD.Player.State.PLAY) + MPD.Player.pause(server); + else + MPD.Player.play(server); + } else if(keys == "Pause") MPD.Player.pause(server); else if(keys == "Next") MPD.Player.next(server); else if(keys == "Previous") MPD.Player.prev(server); -- 2.11.4.GIT