From 509780073bc08cd03c21409f00dc98de5d26aaa2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 30 Sep 2009 20:28:38 +0200 Subject: [PATCH] screen: use idle events in screen_update() --- src/screen.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/screen.c b/src/screen.c index 9850f39..7295c47 100644 --- a/src/screen.c +++ b/src/screen.c @@ -365,17 +365,15 @@ screen_update(struct mpdclient *c) static bool single; static bool consume; static unsigned crossfade; - static unsigned dbupdate; /* print a message if mpd status has changed */ - if (c->status != NULL) { + if ((c->events & MPD_IDLE_OPTIONS) && c->status != NULL) { if (!initialized) { repeat = mpd_status_get_repeat(c->status); random_enabled = mpd_status_get_random(c->status); single = mpd_status_get_single(c->status); consume = mpd_status_get_consume(c->status); crossfade = mpd_status_get_crossfade(c->status); - dbupdate = mpd_status_get_update_id(c->status); initialized = true; } @@ -412,19 +410,16 @@ screen_update(struct mpdclient *c) screen_status_printf(_("Crossfade %d seconds"), mpd_status_get_crossfade(c->status)); - if (dbupdate != 0 && - dbupdate != mpd_status_get_update_id(c->status)) { - screen_status_printf(_("Database updated")); - } - repeat = mpd_status_get_repeat(c->status); random_enabled = mpd_status_get_random(c->status); single = mpd_status_get_single(c->status); consume = mpd_status_get_consume(c->status); crossfade = mpd_status_get_crossfade(c->status); - dbupdate = mpd_status_get_update_id(c->status); } + if (c->events & MPD_IDLE_DATABASE) + screen_status_printf(_("Database updated")); + /* update title/header window */ if (welcome && options.welcome_screen_list && time(NULL)-screen.start_timestamp <= SCREEN_WELCOME_TIME) -- 2.30.2