summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/id3.h1
-rw-r--r--firmware/id3.c36
2 files changed, 37 insertions, 0 deletions
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
77bool mp3info(struct mp3entry *entry, char *filename); 77bool mp3info(struct mp3entry *entry, char *filename);
78char* 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
54static 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
80char* 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