From 6ce0f3ba319d0216fcbaa241e769e6525083683c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 30 Sep 2009 07:58:55 +0200 Subject: [PATCH] mpdclient, screen: don't use MPD_STATUS_NO_VOLUME It was removed from libmpdclient. --- src/mpdclient.c | 13 ++++++------- src/screen.c | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) 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); -- 2.30.2