diff --git a/src/mpdclient.h b/src/mpdclient.h
index 940b3eb1d256227fc6d6b8991b9905969ecfb7c8..a93db74baf135392acba5ff418bc3f18d2dffc6d 100644 (file)
--- a/src/mpdclient.h
+++ b/src/mpdclient.h
return c->connection != NULL;
}
+G_GNUC_PURE
+static inline bool
+mpdclient_is_playing(const struct mpdclient *c)
+{
+ return c->status != NULL &&
+ (mpd_status_get_state(c->status) == MPD_STATE_PLAY ||
+ mpd_status_get_state(c->status) == MPD_STATE_PAUSE);
+}
+
static inline const struct mpd_song *
mpdclient_get_current_song(const struct mpdclient *c)
{
- return c->song != NULL && c->status != NULL &&
- (mpd_status_get_state(c->status) == MPD_STATE_PLAY ||
- mpd_status_get_state(c->status) == MPD_STATE_PAUSE)
+ return c->song != NULL && mpdclient_is_playing(c)
? c->song
: NULL;
}
bool
mpdclient_cmd_delete_range(struct mpdclient *c, unsigned start, unsigned end);
-bool
-mpdclient_cmd_swap(struct mpdclient *c, gint old_index, gint new_index);
-
bool
mpdclient_cmd_move(struct mpdclient *c, unsigned dest, unsigned src);