summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ae34932)
raw | patch | inline | side by side (parent: ae34932)
author | Patrick Hallen <patrick.hallen@rwth-aachen.de> | |
Sat, 14 Mar 2009 15:08:20 +0000 (16:08 +0100) | ||
committer | Patrick Hallen <patrick.hallen@rwth-aachen.de> | |
Sat, 14 Mar 2009 15:08:20 +0000 (16:08 +0100) |
src/screen_song.c | patch | blob | history |
diff --git a/src/screen_song.c b/src/screen_song.c
index 3af2d8bca0dff66ad307f80d707544f65a13a508..cc4d53801fce2c202aee86ea27954386815039ee 100644 (file)
--- a/src/screen_song.c
+++ b/src/screen_song.c
screen_song_append(labels[GENRE], song->genre, max_label_width);
screen_song_append(labels[COMMENT], song->comment, max_label_width);
screen_song_append(labels[PATH], song->file, max_label_width);
- if (c->status != NULL && c->song != NULL && g_strcmp0(c->song->file, song->file) == 0) {
+ if (c->status != NULL && c->song != NULL &&
+ g_strcmp0(c->song->file, song->file) == 0 &&
+ (c->status->state == MPD_STATUS_STATE_PLAY ||
+ c->status->state == MPD_STATUS_STATE_PAUSE) ) {
char buf[16];
g_snprintf(buf, sizeof(buf), _("%d kbps"), c->status->bitRate);
screen_song_append(labels[BITRATE], buf, max_label_width);
max_label_width = utf8_width(labels[i]);
}
- g_ptr_array_add(current.lines, g_strdup(_("MPD Statistics")) );
+ g_ptr_array_add(current.lines, g_strdup(_("MPD statistics")) );
g_snprintf(buf, sizeof(buf), "%d", mpd_stats->numberOfArtists);
screen_song_append(labels[ARTISTS], buf, max_label_width);
g_snprintf(buf, sizeof(buf), "%d", mpd_stats->numberOfAlbums);
static void
screen_song_update(mpdclient_t *c)
{
- /* if any song changed */
-/* if ((c->song != NULL &&
- (current.played_song == NULL ||
- g_strcmp0(c->song->file, current.played_song->file) != 0) ) ||
- next_song != NULL)
- {*/
+ /* Clear all lines */
for (guint i = 0; i < current.lines->len; ++i)
g_free(g_ptr_array_index(current.lines, i));
g_ptr_array_set_size(current.lines, 0);
- /* if a song was selected before the song screen was opened */
+ /* If a song was selected before the song screen was opened */
if (next_song != NULL) {
assert(current.selected_song == NULL);
current.selected_song = mpd_songDup(next_song);
g_ptr_array_add(current.lines, g_strdup("\0"));
}
- if (c->song != NULL && (c->status->state == MPD_STATUS_STATE_PLAY || c->status->state == MPD_STATUS_STATE_PAUSE) ) {
+ if (c->song != NULL &&
+ (c->status->state == MPD_STATUS_STATE_PLAY ||
+ c->status->state == MPD_STATUS_STATE_PAUSE) ) {
if (current.played_song != NULL) {
mpd_freeSong(current.played_song);
}
screen_song_add_stats(c);
screen_song_repaint();
- //}
}
static bool