From: Martin Mares Date: Sun, 14 Oct 2018 19:44:10 +0000 (+0200) Subject: MPD: Separate stop/prev/next buttons X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=180fbde08239c1c2f19e87ee5709784bff529d90;p=ursary.git MPD: Separate stop/prev/next buttons --- diff --git a/mpd.c b/mpd.c index 12c6f50..0e2fb1c 100644 --- 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); diff --git a/ursaryd.c b/ursaryd.c index c15db3d..97791f2 100644 --- 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); } diff --git a/ursaryd.h b/ursaryd.h index 20a2a2c..805e2b8 100644 --- 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);