Code

mpdclient: define MPD_IDLE_ALL
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>
Fri, 4 Nov 2011 00:01:37 +0000 (01:01 +0100)
committerJonathan Neuschäfer <j.neuschaefer@gmx.net>
Fri, 4 Nov 2011 20:37:26 +0000 (21:37 +0100)
src/main.c
src/mpdclient.c
src/mpdclient.h

index 0f1ecf888182025c6297157ec9529517a83b22f4..389b8c68e570f2c8eb52a22e0419a81cfa62f35d 100644 (file)
@@ -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();
 
index 637aef76b8d0ffea6d8d4682c632eba3e67be154..34d26df69e30a81965f3df091af98aad267a48cc 100644 (file)
@@ -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
index 798e979c4d2bbcf73f006282b944627e71c97794..7cdf7f5da121021f1726fe5a703e3489a944bbcf 100644 (file)
@@ -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