]> mj.ucw.cz Git - ursary.git/commitdiff
MPD: Separate stop/prev/next buttons
authorMartin Mares <mj@ucw.cz>
Sun, 14 Oct 2018 19:44:10 +0000 (21:44 +0200)
committerMartin Mares <mj@ucw.cz>
Sun, 14 Oct 2018 19:44:26 +0000 (21:44 +0200)
mpd.c
ursaryd.c
ursaryd.h

diff --git a/mpd.c b/mpd.c
index 12c6f50b87a182620e1fa93ab9cab84f6f48dcef..0e2fb1c8b2ca3c1d734bc3cbba41197acd179167 100644 (file)
--- a/mpd.c
+++ b/mpd.c
@@ -328,6 +328,16 @@ void mpd_pause(int arg)
   return mpd_cmd(NULL, "pause %d", arg);
 }
 
+void mpd_next(void)
+{
+  return mpd_cmd(NULL, "next");
+}
+
+void mpd_prev(void)
+{
+  return mpd_cmd(NULL, "previous");
+}
+
 static void mpd_connect(struct main_timer *t)
 {
   timer_del(t);
index c15db3d20b20fb3e81e60b268654120877a60c2a..97791f2d0c2b352ecddc361ce7d1ff09f84c2eec 100644 (file)
--- a/ursaryd.c
+++ b/ursaryd.c
@@ -633,6 +633,18 @@ void notify_button(int button, int on)
     case 12:
       update_mpd_from_button(button, on);
       break;
+    case 13:
+      if (on)
+       mpd_stop();
+      break;
+    case 14:
+      if (on)
+       mpd_prev();
+      break;
+    case 15:
+      if (on)
+       mpd_next();
+      break;
     default:
       update_group_from_button(button, on);
     }
index 20a2a2ca68af8dd4dd40ba7bbc229bbed28872c6..805e2b89fe06c8ea7c14f59aa81b9f4440fde90a 100644 (file)
--- a/ursaryd.h
+++ b/ursaryd.h
@@ -107,3 +107,5 @@ const char *mpd_get_player_state(void);
 void mpd_play(void);
 void mpd_stop(void);
 void mpd_pause(int arg);
+void mpd_next(void);
+void mpd_prev(void);