From: Jonathan Neuschäfer Date: Mon, 9 Jun 2014 09:17:44 +0000 (+0200) Subject: screen_song: show audio format X-Git-Tag: v0.22~7 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=31cfdb4fa9ec6759389dd201ef38bd8d89a71a20;p=ncmpc.git screen_song: show audio format --- diff --git a/NEWS b/NEWS index cf73d0a..ca5cfd6 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ ncmpc 0.22 - not yet released * patched color line-flags * configuration option "search-format" * remove broken leoslyrics plugin +* show audio format in song screen ncmpc 0.21 - (2013-04-11) diff --git a/src/screen_song.c b/src/screen_song.c index 6d3a034..2a69860 100644 --- a/src/screen_song.c +++ b/src/screen_song.c @@ -38,6 +38,7 @@ enum { LABEL_LENGTH = MPD_TAG_COUNT, LABEL_PATH, LABEL_BITRATE, + LABEL_FORMAT, LABEL_POSITION, }; @@ -56,6 +57,7 @@ static const char *const tag_labels[] = { [MPD_TAG_COMMENT] = N_("Comment"), [LABEL_PATH] = N_("Path"), [LABEL_BITRATE] = N_("Bitrate"), + [LABEL_FORMAT] = N_("Format"), }; static unsigned max_tag_label_width; @@ -320,6 +322,16 @@ screen_song_add_song(const struct mpd_song *song, const struct mpdclient *c) mpd_status_get_kbit_rate(c->status)); screen_song_append(_(tag_labels[LABEL_BITRATE]), buf, max_tag_label_width); + + const struct mpd_audio_format *format = + mpd_status_get_audio_format(c->status); + if (format) { + g_snprintf(buf, sizeof(buf), _("%u:%u:%u"), + format->sample_rate, format->bits, + format->channels); + screen_song_append(_(tag_labels[LABEL_FORMAT]), buf, + max_tag_label_width); + } } }