diff --git a/src/mpdclient.h b/src/mpdclient.h
index 8309aa3a30519869c3f16af90c7c9bf5879ad219..383634fb78398c2e10726ca88d3acc7f03e4cb19 100644 (file)
--- a/src/mpdclient.h
+++ b/src/mpdclient.h
unsigned update_id;
/**
- * A bit mask of idle events occured since the last update.
+ * A bit mask of idle events occurred since the last update.
*/
enum mpd_idle events;
};
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;
}