diff options
| -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 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 @@ -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; |