From 627cb0dee939d8ee739a3720ef2f3d219c0f7567 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Mon, 5 Jun 2017 19:57:00 +0200
Subject: Add and bind backward/forward seeks
---
nncmpp.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/nncmpp.c b/nncmpp.c
index 93c0390..858effb 100644
--- a/nncmpp.c
+++ b/nncmpp.c
@@ -1502,6 +1502,8 @@ app_goto_tab (int tab_index)
XX( MPD_TOGGLE, "Toggle play/pause" ) \
XX( MPD_STOP, "Stop playback" ) \
XX( MPD_NEXT, "Next song" ) \
+ XX( MPD_BACKWARD, "Seek backwards" ) \
+ XX( MPD_FORWARD, "Seek forwards" ) \
XX( MPD_VOLUME_UP, "Increase volume" ) \
XX( MPD_VOLUME_DOWN, "Decrease volume" ) \
\
@@ -1661,11 +1663,13 @@ app_process_action (enum action action)
}
break;
- // TODO: relative seeks
-#if 0
- FORWARD: MPD_SIMPLE ("seekcur", "+10");
- BACKWARD: MPD_SIMPLE ("seekcur", "-10");
-#endif
+ // XXX: these should rather be parametrized
+ case ACTION_MPD_FORWARD:
+ MPD_SIMPLE ("seekcur", "+10");
+ break;
+ case ACTION_MPD_BACKWARD:
+ MPD_SIMPLE ("seekcur", "-10");
+ break;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -1859,6 +1863,8 @@ g_default_bindings[] =
{ "r", ACTION_MPD_REPLACE, {}},
{ "u", ACTION_MPD_UPDATE_DB, {}},
+ { "M-Left", ACTION_MPD_BACKWARD, {}},
+ { "M-Right", ACTION_MPD_FORWARD, {}},
{ "Left", ACTION_MPD_PREVIOUS, {}},
{ "Right", ACTION_MPD_NEXT, {}},
{ "h", ACTION_MPD_PREVIOUS, {}},
--
cgit v1.2.3-70-g09d2