diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2004-03-28 07:33:46 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2004-03-28 07:33:46 +0000 |
commit | 5483fd0a956318faab5b69a7659f1a0dc7298fae (patch) | |
tree | d4d57bfd16f4b746263b119bc6cded1d1c3fc87a | |
parent | 5e4aa6400918a32108f29ef8ec661930c5702492 (diff) | |
download | rockbox-5483fd0a956318faab5b69a7659f1a0dc7298fae.tar.gz rockbox-5483fd0a956318faab5b69a7659f1a0dc7298fae.zip |
The ID3 browser now shows the correct genre information
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4442 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/wps-display.c | 16 | ||||
-rw-r--r-- | apps/wps-display.h | 2 | ||||
-rw-r--r-- | apps/wps.c | 4 |
3 files changed, 10 insertions, 12 deletions
diff --git a/apps/wps-display.c b/apps/wps-display.c index b9106f5e7e..3e28f7f3e8 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 99330453c0..12eed07c8f 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 104c56250c..858a93c934 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; |