Code

use MPD_IDLE_QUEUE instead of deprecated MPD_IDLE_PLAYLIST flag
authorRomain Bignon <romain@peerfuse.org>
Tue, 3 Nov 2009 20:49:37 +0000 (21:49 +0100)
committerRomain Bignon <romain@peerfuse.org>
Tue, 3 Nov 2009 20:49:37 +0000 (21:49 +0100)
Signed-off-by: Romain Bignon <romain@peerfuse.org>
src/main.c
src/mpdclient.c
src/screen_artist.c
src/screen_file.c
src/screen_queue.c
src/screen_search.c

index 8464035f1c0bcbf9f6cdbc918af9a524e2f12dba..29c53a8d6c54adbef1e8abb8ec1b1509b288cb0c 100644 (file)
@@ -1,17 +1,17 @@
 /* ncmpc (Ncurses MPD Client)
  * (c) 2004-2009 The Music Player Daemon Project
  * Project homepage: http://musicpd.org
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
-
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
-
+ *
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
@@ -55,7 +55,7 @@
 #include <locale.h>
 #endif
 
-/* time between mpd updates [s] */
+/* time between mpd updates [ms] */
 static const guint update_interval = 500;
 
 #define BUFSIZE 1024
index 059a6ee38898120dd6bb8416252372542cfd7021..ca7a7b61ba2352d53b47b889d0f14914b38c000e 100644 (file)
@@ -218,7 +218,7 @@ mpdclient_update(struct mpdclient *c)
                bool retval;
 
                if (c->source == NULL)
-                       c->events |= MPD_IDLE_PLAYLIST;
+                       c->events |= MPD_IDLE_QUEUE;
 
                if (!playlist_is_empty(&c->playlist))
                        retval = mpdclient_playlist_update_changes(c);
@@ -441,7 +441,7 @@ mpdclient_cmd_add(struct mpdclient *c, const struct mpd_song *song)
            !mpd_response_next(connection))
                return mpdclient_handle_error(c);
 
-       c->events |= MPD_IDLE_PLAYLIST;
+       c->events |= MPD_IDLE_QUEUE;
 
        status = mpdclient_recv_status(c);
        if (status == NULL)
@@ -500,7 +500,7 @@ mpdclient_cmd_delete(struct mpdclient *c, gint idx)
            !mpd_command_list_end(connection))
                return mpdclient_handle_error(c);
 
-       c->events |= MPD_IDLE_PLAYLIST;
+       c->events |= MPD_IDLE_QUEUE;
 
        status = mpdclient_recv_status(c);
        if (status == NULL)
@@ -582,7 +582,7 @@ mpdclient_cmd_delete_range(struct mpdclient *c, unsigned start, unsigned end)
            !mpd_command_list_end(connection))
                return mpdclient_handle_error(c);
 
-       c->events |= MPD_IDLE_PLAYLIST;
+       c->events |= MPD_IDLE_QUEUE;
 
        status = mpdclient_recv_status(c);
        if (status == NULL)
index 9bd1b3e0df6a7b85c1359adb05dd31c7002e8430..d6011a7bc13d078cb1c2feffa96efcf580c08f67 100644 (file)
@@ -394,12 +394,12 @@ screen_artist_update(struct mpdclient *c)
                /* the db has changed -> update the list */
                reload_lists(c);
 
-       if (c->events & (MPD_IDLE_DATABASE | MPD_IDLE_PLAYLIST))
+       if (c->events & (MPD_IDLE_DATABASE | MPD_IDLE_QUEUE))
                screen_browser_sync_highlights(browser.filelist, &c->playlist);
 
        if (c->events & (MPD_IDLE_DATABASE
 #ifndef NCMPC_MINI
-                        | MPD_IDLE_PLAYLIST
+                        | MPD_IDLE_QUEUE
 #endif
                         ))
                artist_repaint();
index 25a86d1bb8f0c0ca8d75f5746818fe361b9d8d4a..c6effe4012510dc6a80ec64c293c029558bdd8c7 100644 (file)
@@ -323,7 +323,7 @@ screen_file_update(struct mpdclient *c)
 
        if (c->events & (MPD_IDLE_DATABASE | MPD_IDLE_STORED_PLAYLIST
 #ifndef NCMPC_MINI
-                        | MPD_IDLE_PLAYLIST
+                        | MPD_IDLE_QUEUE
 #endif
                         )) {
                screen_browser_sync_highlights(browser.filelist, &c->playlist);
index 79a112b60468e889615ec525dcf1f7b484b5d25d..f3ca21a06e49a6c5a1ae2d73d0ac9483e3548df0 100644 (file)
@@ -551,12 +551,12 @@ screen_queue_paint(void)
 static void
 screen_queue_update(struct mpdclient *c)
 {
-       if (c->events & MPD_IDLE_PLAYLIST)
+       if (c->events & MPD_IDLE_QUEUE)
                screen_queue_restore_selection();
 
        if (((c->events & MPD_IDLE_PLAYER) != 0 &&
             screen_queue_song_change(c->status)) ||
-           c->events & MPD_IDLE_PLAYLIST)
+           c->events & MPD_IDLE_QUEUE)
                /* the queue or the current song has changed, we must
                   paint the new version */
                screen_queue_repaint();
index 5ca210daba0af56a50e538a4f1fa2bee5e973277..0561ae3f38b6381cb92436a4b442d5f214faa41e 100644 (file)
@@ -426,7 +426,7 @@ screen_search_get_title(char *str, size_t size)
 static void
 screen_search_update(struct mpdclient *c)
 {
-       if (browser.filelist != NULL && c->events & MPD_IDLE_PLAYLIST) {
+       if (browser.filelist != NULL && c->events & MPD_IDLE_QUEUE) {
                screen_browser_sync_highlights(browser.filelist, &c->playlist);
                search_repaint();
        }