summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a537ee8)
raw | patch | inline | side by side (parent: a537ee8)
author | Max Kellermann <max@duempel.org> | |
Tue, 29 Sep 2009 20:33:02 +0000 (22:33 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Tue, 29 Sep 2009 20:33:02 +0000 (22:33 +0200) |
As a side effect, this patch adds the missing
mpdclient_finish_command() call to
mpdclient_playlist_update_changes().
mpdclient_finish_command() call to
mpdclient_playlist_update_changes().
src/mpdclient.c | patch | blob | history | |
src/mpdclient.h | patch | blob | history |
diff --git a/src/mpdclient.c b/src/mpdclient.c
index 179aecc2c5c8bd6b24b2c6f1819c01db9912993a..5e138edca16b085a6fc60ab78add92fd04dd7cca 100644 (file)
--- a/src/mpdclient.c
+++ b/src/mpdclient.c
return true;
}
-gint
+bool
mpdclient_update(struct mpdclient *c)
{
- gint retval = 0;
+ bool retval;
c->volume = MPD_STATUS_NO_VOLUME;
if (MPD_ERROR(c))
- return -1;
+ return false;
/* free the old status */
if (c->status)
/* retrieve new status */
c->status = mpd_run_status(c->connection);
if (c->status == NULL)
- return mpdclient_handle_error(c);
+ return mpdclient_handle_error(c) == 0;
if (c->updatingdb &&
c->updatingdb != mpd_status_get_update_id(c->status))
/****************************************************************************/
/* update playlist */
-gint
+bool
mpdclient_playlist_update(struct mpdclient *c)
{
struct mpd_entity *entity;
if (MPD_ERROR(c))
- return -1;
+ return false;
playlist_clear(&c->playlist);
/* call playlist updated callbacks */
mpdclient_playlist_callback(c, PLAYLIST_EVENT_UPDATED, NULL);
- return mpdclient_finish_command(c);
+ return mpdclient_finish_command(c) == 0;
}
/* update playlist (plchanges) */
-gint
+bool
mpdclient_playlist_update_changes(struct mpdclient *c)
{
struct mpd_song *song;
guint length;
if (MPD_ERROR(c))
- return -1;
+ return false;
mpd_send_queue_changes_meta(c->connection, c->playlist.id);
mpdclient_playlist_callback(c, PLAYLIST_EVENT_UPDATED, NULL);
- return 0;
+ return mpdclient_finish_command(c) == 0;
}
diff --git a/src/mpdclient.h b/src/mpdclient.h
index fa2f1b61dae81096377a5442dcb84cf2d378716d..e9150ba2d109940e6cc90333d9dda729a1dad2c7 100644 (file)
--- a/src/mpdclient.h
+++ b/src/mpdclient.h
void
mpdclient_disconnect(struct mpdclient *c);
-gint mpdclient_update(struct mpdclient *c);
+bool
+mpdclient_update(struct mpdclient *c);
/*** MPD Commands **********************************************************/
/*** playlist functions **************************************************/
/* update the complete playlist */
-gint mpdclient_playlist_update(struct mpdclient *c);
+bool
+mpdclient_playlist_update(struct mpdclient *c);
/* get playlist changes */
-gint mpdclient_playlist_update_changes(struct mpdclient *c);
+bool
+mpdclient_playlist_update_changes(struct mpdclient *c);
/*** mpdclient playlist callbacks *****************************************/