From 5483fd0a956318faab5b69a7659f1a0dc7298fae Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Sun, 28 Mar 2004 07:33:46 +0000 Subject: The ID3 browser now shows the correct genre information git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4442 a1c6a512-1295-4272-9138-f99709370657 --- apps/wps-display.c | 16 +++++++--------- apps/wps-display.h | 2 +- apps/wps.c | 4 ++-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/apps/wps-display.c b/apps/wps-display.c index b9106f5..3e28f7f 100644 --- a/apps/wps-display.c +++ b/apps/wps-display.c @@ -111,10 +111,13 @@ static const char* const genres[] = { "Duet", "Punk Rock", "Drum Solo", "A capella", "Euro-House", "Dance Hall" }; -char* wps_get_genre(unsigned int genre) +char* wps_get_genre(struct mp3entry* id3) { - if (genre < sizeof(genres)/sizeof(char*)) - return (char*)genres[genre]; + if( id3->genre_string ) + return id3->genre_string ; + + if (id3->genre < sizeof(genres)/sizeof(char*)) + return (char*)genres[id3->genre]; return NULL; } @@ -383,12 +386,7 @@ static char* get_tag(struct mp3entry* id3, return NULL; case 'g': /* genre */ - if( id3->genre_string ) - return id3->genre_string ; - - if (id3->genre < sizeof(genres)/sizeof(char*)) - return (char*)genres[id3->genre]; - return NULL; + return wps_get_genre(id3); case 'v': /* id3 version */ switch (id3->id3version) { diff --git a/apps/wps-display.h b/apps/wps-display.h index 9933045..12eed07 100644 --- a/apps/wps-display.h +++ b/apps/wps-display.h @@ -37,6 +37,6 @@ bool wps_refresh(struct mp3entry* id3, int ffwd_offset, unsigned char refresh_mo bool wps_display(struct mp3entry* id3); bool wps_load(char* file, bool display); void wps_reset(void); -char* wps_get_genre(unsigned int genre); +char* wps_get_genre(struct mp3entry* id3); #endif diff --git a/apps/wps.c b/apps/wps.c index 104c562..858a93c 100644 --- a/apps/wps.c +++ b/apps/wps.c @@ -201,8 +201,8 @@ bool browse_id3(void) case 4: lcd_puts(0, 0, str(LANG_ID3_GENRE)); lcd_puts_scroll(0, 1, - wps_get_genre(id3->genre) ? - wps_get_genre(id3->genre) : + wps_get_genre(id3) ? + wps_get_genre(id3) : (char*)str(LANG_ID3_NO_INFO)); break; -- cgit v1.1