From: Andreas Obergrusberger Date: Sun, 6 Aug 2006 09:15:42 +0000 (+0000) Subject: fix bug in lyrics screen X-Git-Tag: v0.12_alpha1~381 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=db9a25c6ce2c475cb8b1e1e4d210e0c5793e0047;p=ncmpc.git fix bug in lyrics screen git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4572 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- diff --git a/ChangeLog b/ChangeLog index c429c5f..4140e0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-09-6 Andreas Obergrusberger + * fixed a bug in the lyrics screen that made + the first texte line not show up + 2006-09-5 Andreas Obergrusberger * the 5th of august... it's dark around me... there are still flies constantly shitting diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c index c068a43..598fb0d 100644 --- a/src/screen_lyrics.c +++ b/src/screen_lyrics.c @@ -310,9 +310,12 @@ gpointer get_lyr(void *c) strfsong(artist, MAX_SONGNAME_LENGTH, "%artist%", cur); strfsong(title, MAX_SONGNAME_LENGTH, "%title%", cur); + //write header.. formed_text_init(&lyr_text); add_text_line(&lyr_text, artist, 0); add_text_line(&lyr_text, title, 0); + add_text_line(&lyr_text, "", 0); + add_text_line(&lyr_text, "", 0); //if(get_lyr_hd(artist, title) == 0) return &lyr_text; @@ -370,20 +373,20 @@ list_callback(int index, int *highlight, void *data) int linelen; //i think i'ts fine to write it into the 1st line... - if((index == lyr_text.lines->len && lyr_text.lines->len != 2)|| + if((index == lyr_text.lines->len && lyr_text.lines->len != 3)|| ((lyr_text.lines->len == 0 - ||lyr_text.lines->len == 2) && index == 0)) + ||lyr_text.lines->len == 4) && index == 0)) { *highlight=3; return CREDITS; } - if(index < 2 && lyr_text.lines->len > 2) *highlight=3; - else if(index >= lyr_text.lines->len || index == 2) + if(index < 2 && lyr_text.lines->len > 4) *highlight=3; + else if(index >= lyr_text.lines->len) { return ""; } - if(index >1) index--; + //if(index >1) index--; get_text_line(&lyr_text, index, buf, 512); return buf; } @@ -417,7 +420,7 @@ lyrics_exit(void) static char * lyrics_title(char *str, size_t size) { - if(lyr_text.lines->len == 2){ + if(lyr_text.lines->len == 4){ if(lock == 1 && !(result & 2)) return _("Lyrics [No connection]"); if(lock == 1 && !(result & 4)) return _("Lyrics [Not found]"); if(lock == 2) return _("Lyrics [retrieving]");