X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fmpdclient.h;h=a93db74baf135392acba5ff418bc3f18d2dffc6d;hb=b871878b86a7876cd54e30d6be2bfb57f461dbb1;hp=9f22d268cc046e05b1c8279b0459231590e77a23;hpb=4b487197fc27641a7fb984e8bf9823f34f1e4146;p=ncmpc.git diff --git a/src/mpdclient.h b/src/mpdclient.h index 9f22d26..a93db74 100644 --- a/src/mpdclient.h +++ b/src/mpdclient.h @@ -57,12 +57,19 @@ mpdclient_is_connected(const struct mpdclient *c) 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; } @@ -120,7 +127,7 @@ bool mpdclient_cmd_delete_range(struct mpdclient *c, unsigned start, unsigned end); bool -mpdclient_cmd_move(struct mpdclient *c, gint old_index, gint new_index); +mpdclient_cmd_move(struct mpdclient *c, unsigned dest, unsigned src); /*** playlist functions **************************************************/