From 0cf7ca98010e4a3de33f05b412b5a9e7a6b04d20 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonathan=20Neusch=C3=A4fer?= Date: Fri, 4 Nov 2011 01:01:37 +0100 Subject: [PATCH] mpdclient: define MPD_IDLE_ALL --- src/main.c | 4 +--- src/mpdclient.c | 4 +--- src/mpdclient.h | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index 0f1ecf8..389b8c6 100644 --- a/src/main.c +++ b/src/main.c @@ -360,9 +360,7 @@ timer_reconnect(G_GNUC_UNUSED gpointer data) doupdate(); /* update immediately */ - mpd->events = MPD_IDLE_DATABASE|MPD_IDLE_STORED_PLAYLIST| - MPD_IDLE_QUEUE|MPD_IDLE_PLAYER|MPD_IDLE_MIXER|MPD_IDLE_OUTPUT| - MPD_IDLE_OPTIONS|MPD_IDLE_UPDATE; + mpd->events = MPD_IDLE_ALL; do_mpd_update(); diff --git a/src/mpdclient.c b/src/mpdclient.c index 637aef7..34d26df 100644 --- a/src/mpdclient.c +++ b/src/mpdclient.c @@ -136,9 +136,7 @@ mpdclient_disconnect(struct mpdclient *c) c->song = NULL; /* everything has changed after a disconnect */ - c->events |= MPD_IDLE_DATABASE|MPD_IDLE_STORED_PLAYLIST| - MPD_IDLE_QUEUE|MPD_IDLE_PLAYER|MPD_IDLE_MIXER|MPD_IDLE_OUTPUT| - MPD_IDLE_OPTIONS|MPD_IDLE_UPDATE; + c->events |= MPD_IDLE_ALL; } bool diff --git a/src/mpdclient.h b/src/mpdclient.h index 798e979..7cdf7f5 100644 --- a/src/mpdclient.h +++ b/src/mpdclient.h @@ -41,6 +41,26 @@ struct mpdclient { enum mpd_idle events; }; +enum { + /** + * all idle events the version of libmpdclient, ncmpc is compiled + * against, supports + */ + MPD_IDLE_ALL = MPD_IDLE_DATABASE + | MPD_IDLE_STORED_PLAYLIST + | MPD_IDLE_QUEUE + | MPD_IDLE_PLAYER + | MPD_IDLE_MIXER + | MPD_IDLE_OUTPUT + | MPD_IDLE_OPTIONS + | MPD_IDLE_UPDATE +#if LIBMPDCLIENT_CHECK_VERSION(2,5,0) + | MPD_IDLE_STICKER + | MPD_IDLE_SUBSCRIPTION + | MPD_IDLE_MESSAGE +#endif +}; + /** functions ***************************************************************/ bool -- 2.30.2