From: Max Kellermann Date: Wed, 30 Sep 2009 05:58:55 +0000 (+0200) Subject: mpdclient, screen: don't use MPD_STATUS_NO_VOLUME X-Git-Tag: release-0.16~285 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6ce0f3ba319d0216fcbaa241e769e6525083683c;p=ncmpc.git mpdclient, screen: don't use MPD_STATUS_NO_VOLUME It was removed from libmpdclient. --- diff --git a/src/mpdclient.c b/src/mpdclient.c index 77638d6..aecf4f9 100644 --- a/src/mpdclient.c +++ b/src/mpdclient.c @@ -144,7 +144,7 @@ mpdclient_new(void) c = g_new0(struct mpdclient, 1); playlist_init(&c->playlist); - c->volume = MPD_STATUS_NO_VOLUME; + c->volume = -1; return c; } @@ -216,7 +216,7 @@ mpdclient_update(struct mpdclient *c) { bool retval; - c->volume = MPD_STATUS_NO_VOLUME; + c->volume = -1; if (MPD_ERROR(c)) return false; @@ -458,10 +458,10 @@ gint mpdclient_cmd_volume_up(struct mpdclient *c) return -1; if (c->status == NULL || - mpd_status_get_volume(c->status) == MPD_STATUS_NO_VOLUME) + mpd_status_get_volume(c->status) == -1) return 0; - if (c->volume == MPD_STATUS_NO_VOLUME) + if (c->volume < 0) c->volume = mpd_status_get_volume(c->status); if (c->volume >= 100) @@ -475,11 +475,10 @@ gint mpdclient_cmd_volume_down(struct mpdclient *c) if (MPD_ERROR(c)) return -1; - if (c->status == NULL || - mpd_status_get_volume(c->status) == MPD_STATUS_NO_VOLUME) + if (c->status == NULL || mpd_status_get_volume(c->status) < 0) return 0; - if (c->volume == MPD_STATUS_NO_VOLUME) + if (c->volume < 0) c->volume = mpd_status_get_volume(c->status); if (c->volume <= 0) diff --git a/src/screen.c b/src/screen.c index eaff0d9..15a98d0 100644 --- a/src/screen.c +++ b/src/screen.c @@ -165,7 +165,7 @@ get_volume(const struct mpd_status *status) { return status != NULL ? mpd_status_get_volume(status) - : MPD_STATUS_NO_VOLUME; + : -1; } static void @@ -202,7 +202,7 @@ paint_top_window2(const char *header, struct mpdclient *c) } volume = get_volume(c->status); - if (volume == MPD_STATUS_NO_VOLUME) + if (volume < 0) g_snprintf(buf, 32, _("Volume n/a")); else g_snprintf(buf, 32, _("Volume %d%%"), volume);