diff options
-rw-r--r-- | apps/wps-display.c | 38 | ||||
-rw-r--r-- | apps/wps.c | 4 | ||||
-rw-r--r-- | firmware/export/id3.h | 1 | ||||
-rw-r--r-- | firmware/id3.c | 36 |
4 files changed, 40 insertions, 39 deletions
diff --git a/apps/wps-display.c b/apps/wps-display.c index 8cbf7db75e..44955d0543 100644 --- a/apps/wps-display.c +++ b/apps/wps-display.c | |||
@@ -85,42 +85,6 @@ static int ff_rewind_count; | |||
85 | bool wps_time_countup = true; | 85 | bool wps_time_countup = true; |
86 | static bool wps_loaded = false; | 86 | static bool wps_loaded = false; |
87 | 87 | ||
88 | static const char* const genres[] = { | ||
89 | "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge", | ||
90 | "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", "Other", "Pop", "R&B", | ||
91 | "Rap", "Reggae", "Rock", "Techno", "Industrial", "Alternative", "Ska", | ||
92 | "Death Metal", "Pranks", "Soundtrack", "Euro-Techno", "Ambient", "Trip-Hop", | ||
93 | "Vocal", "Jazz+Funk", "Fusion", "Trance", "Classical", "Instrumental", | ||
94 | "Acid", "House", "Game", "Sound Clip", "Gospel", "Noise", "AlternRock", | ||
95 | "Bass", "Soul", "Punk", "Space", "Meditative", "Instrumental Pop", | ||
96 | "Instrumental Rock", "Ethnic", "Gothic", "Darkwave", "Techno-Industrial", | ||
97 | "Electronic", "Pop-Folk", "Eurodance", "Dream", "Southern Rock", "Comedy", | ||
98 | "Cult", "Gangsta", "Top 40", "Christian Rap", "Pop/Funk", "Jungle", | ||
99 | "Native American", "Cabaret", "New Wave", "Psychadelic", "Rave", | ||
100 | "Showtunes", "Trailer", "Lo-Fi", "Tribal", "Acid Punk", "Acid Jazz", | ||
101 | "Polka", "Retro", "Musical", "Rock & Roll", "Hard Rock", | ||
102 | |||
103 | /* winamp extensions */ | ||
104 | "Folk", "Folk-Rock", "National Folk", "Swing", "Fast Fusion", "Bebob", | ||
105 | "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde", "Gothic Rock", | ||
106 | "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock", | ||
107 | "Big Band", "Chorus", "Easy Listening", "Acoustic", "Humour", "Speech", | ||
108 | "Chanson", "Opera", "Chamber Music", "Sonata", "Symphony", "Booty Bass", | ||
109 | "Primus", "Porn Groove", "Satire", "Slow Jam", "Club", "Tango", "Samba", | ||
110 | "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle", | ||
111 | "Duet", "Punk Rock", "Drum Solo", "A capella", "Euro-House", "Dance Hall" | ||
112 | }; | ||
113 | |||
114 | char* wps_get_genre(struct mp3entry* id3) | ||
115 | { | ||
116 | if( id3->genre_string ) | ||
117 | return id3->genre_string ; | ||
118 | |||
119 | if (id3->genre < sizeof(genres)/sizeof(char*)) | ||
120 | return (char*)genres[id3->genre]; | ||
121 | return NULL; | ||
122 | } | ||
123 | |||
124 | /* Set format string to use for WPS, splitting it into lines */ | 88 | /* Set format string to use for WPS, splitting it into lines */ |
125 | static void wps_format(char* fmt) | 89 | static void wps_format(char* fmt) |
126 | { | 90 | { |
@@ -396,7 +360,7 @@ static char* get_tag(struct mp3entry* cid3, | |||
396 | return NULL; | 360 | return NULL; |
397 | 361 | ||
398 | case 'g': /* genre */ | 362 | case 'g': /* genre */ |
399 | return wps_get_genre(id3); | 363 | return id3_get_genre(id3); |
400 | 364 | ||
401 | case 'v': /* id3 version */ | 365 | case 'v': /* id3 version */ |
402 | switch (id3->id3version) { | 366 | switch (id3->id3version) { |
diff --git a/apps/wps.c b/apps/wps.c index bc09ec5506..f1b0e214a7 100644 --- a/apps/wps.c +++ b/apps/wps.c | |||
@@ -204,8 +204,8 @@ bool browse_id3(void) | |||
204 | case 4: | 204 | case 4: |
205 | lcd_puts(0, 0, str(LANG_ID3_GENRE)); | 205 | lcd_puts(0, 0, str(LANG_ID3_GENRE)); |
206 | lcd_puts_scroll(0, 1, | 206 | lcd_puts_scroll(0, 1, |
207 | wps_get_genre(id3) ? | 207 | id3_get_genre(id3) ? |
208 | wps_get_genre(id3) : | 208 | id3_get_genre(id3) : |
209 | (char*)str(LANG_ID3_NO_INFO)); | 209 | (char*)str(LANG_ID3_NO_INFO)); |
210 | break; | 210 | break; |
211 | 211 | ||
diff --git a/firmware/export/id3.h b/firmware/export/id3.h index 48a56f231a..6e53e4c66c 100644 --- a/firmware/export/id3.h +++ b/firmware/export/id3.h | |||
@@ -75,5 +75,6 @@ enum { | |||
75 | }; | 75 | }; |
76 | 76 | ||
77 | bool mp3info(struct mp3entry *entry, char *filename); | 77 | bool mp3info(struct mp3entry *entry, char *filename); |
78 | char* id3_get_genre(struct mp3entry* id3); | ||
78 | 79 | ||
79 | #endif | 80 | #endif |
diff --git a/firmware/id3.c b/firmware/id3.c index 131eeda82a..d2d2a2d9fe 100644 --- a/firmware/id3.c +++ b/firmware/id3.c | |||
@@ -51,6 +51,42 @@ | |||
51 | ((b2 & 0xFF) << (1*8)) | \ | 51 | ((b2 & 0xFF) << (1*8)) | \ |
52 | ((b3 & 0xFF) << (0*8))) | 52 | ((b3 & 0xFF) << (0*8))) |
53 | 53 | ||
54 | static const char* const genres[] = { | ||
55 | "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge", | ||
56 | "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", "Other", "Pop", "R&B", | ||
57 | "Rap", "Reggae", "Rock", "Techno", "Industrial", "Alternative", "Ska", | ||
58 | "Death Metal", "Pranks", "Soundtrack", "Euro-Techno", "Ambient", "Trip-Hop", | ||
59 | "Vocal", "Jazz+Funk", "Fusion", "Trance", "Classical", "Instrumental", | ||
60 | "Acid", "House", "Game", "Sound Clip", "Gospel", "Noise", "AlternRock", | ||
61 | "Bass", "Soul", "Punk", "Space", "Meditative", "Instrumental Pop", | ||
62 | "Instrumental Rock", "Ethnic", "Gothic", "Darkwave", "Techno-Industrial", | ||
63 | "Electronic", "Pop-Folk", "Eurodance", "Dream", "Southern Rock", "Comedy", | ||
64 | "Cult", "Gangsta", "Top 40", "Christian Rap", "Pop/Funk", "Jungle", | ||
65 | "Native American", "Cabaret", "New Wave", "Psychadelic", "Rave", | ||
66 | "Showtunes", "Trailer", "Lo-Fi", "Tribal", "Acid Punk", "Acid Jazz", | ||
67 | "Polka", "Retro", "Musical", "Rock & Roll", "Hard Rock", | ||
68 | |||
69 | /* winamp extensions */ | ||
70 | "Folk", "Folk-Rock", "National Folk", "Swing", "Fast Fusion", "Bebob", | ||
71 | "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde", "Gothic Rock", | ||
72 | "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock", | ||
73 | "Big Band", "Chorus", "Easy Listening", "Acoustic", "Humour", "Speech", | ||
74 | "Chanson", "Opera", "Chamber Music", "Sonata", "Symphony", "Booty Bass", | ||
75 | "Primus", "Porn Groove", "Satire", "Slow Jam", "Club", "Tango", "Samba", | ||
76 | "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle", | ||
77 | "Duet", "Punk Rock", "Drum Solo", "A capella", "Euro-House", "Dance Hall" | ||
78 | }; | ||
79 | |||
80 | char* id3_get_genre(struct mp3entry* id3) | ||
81 | { | ||
82 | if( id3->genre_string ) | ||
83 | return id3->genre_string ; | ||
84 | |||
85 | if (id3->genre < sizeof(genres)/sizeof(char*)) | ||
86 | return (char*)genres[id3->genre]; | ||
87 | return NULL; | ||
88 | } | ||
89 | |||
54 | /* | 90 | /* |
55 | HOW TO ADD ADDITIONAL ID3 VERSION 2 TAGS | 91 | HOW TO ADD ADDITIONAL ID3 VERSION 2 TAGS |
56 | Code and comments by Thomas Paul Diffenbach | 92 | Code and comments by Thomas Paul Diffenbach |