Fix ID3v1 tags

This commit is contained in:
Ron Pedde 2003-12-01 03:23:43 +00:00
parent 4a61df3739
commit 7f5d8f96b1

View File

@ -54,6 +54,159 @@ int scan_br_table[] = {
0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,0 0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,0
}; };
char *scan_winamp_genre[] = {
"Blues",
"Classic Rock",
"Country",
"Dance",
"Disco",
"Funk",
"Grunge",
"Hip-Hop",
"Jazz",
"Metal",
"New Age",
"Oldies",
"Other",
"Pop",
"R&B",
"Rap",
"Reggae",
"Rock",
"Techno",
"Industrial",
"Alternative",
"Ska",
"Death Metal",
"Pranks",
"Soundtrack",
"Euro-Techno",
"Ambient",
"Trip-Hop",
"Vocal",
"Jazz+Funk",
"Fusion",
"Trance",
"Classical",
"Instrumental",
"Acid",
"House",
"Game",
"Sound Clip",
"Gospel",
"Noise",
"AlternRock",
"Bass",
"Soul",
"Punk",
"Space",
"Meditative",
"Instrumental Pop",
"Instrumental Rock",
"Ethnic",
"Gothic",
"Darkwave",
"Techno-Industrial",
"Electronic",
"Pop-Folk",
"Eurodance",
"Dream",
"Southern Rock",
"Comedy",
"Cult",
"Gangsta",
"Top 40",
"Christian Rap",
"Pop/Funk",
"Jungle",
"Native American",
"Cabaret",
"New Wave",
"Psychadelic",
"Rave",
"Showtunes",
"Trailer",
"Lo-Fi",
"Tribal",
"Acid Punk",
"Acid Jazz",
"Polka",
"Retro",
"Musical",
"Rock & Roll",
"Hard Rock",
"Folk",
"Folk/Rock",
"National folk",
"Swing",
"Fast-fusion",
"Bebob",
"Latin",
"Revival",
"Celtic",
"Bluegrass",
"Avantgarde",
"Gothic Rock",
"Progressive Rock",
"Psychedelic Rock",
"Symphonic Rock",
"Slow Rock",
"Big Band",
"Chorus",
"Easy Listening",
"Acoustic",
"Humour",
"Speech",
"Chanson",
"Opera",
"Chamber Music",
"Sonata",
"Symphony",
"Booty Bass",
"Primus",
"Porn Groove",
"Satire",
"Slow Jam",
"Club",
"Tango",
"Samba",
"Folklore",
"Ballad",
"Powder Ballad",
"Rhythmic Soul",
"Freestyle",
"Duet",
"Punk Rock",
"Drum Solo",
"A Capella",
"Euro-House",
"Dance Hall",
"Goa",
"Drum & Bass",
"Club House",
"Hardcore",
"Terror",
"Indie",
"BritPop",
"NegerPunk",
"Polsk Punk",
"Beat",
"Christian Gangsta",
"Heavy Metal",
"Black Metal",
"Crossover",
"Contemporary C",
"Christian Rock",
"Merengue",
"Salsa",
"Thrash Metal",
"Anime",
"JPop",
"SynthPop",
"Unknown"
}
/* /*
* Forwards * Forwards
*/ */
@ -178,6 +331,7 @@ int scan_gettags(char *file, MP3FILE *pmp3) {
int index; int index;
int used; int used;
unsigned char *utf8_text; unsigned char *utf8_text;
int genre;
pid3file=id3_file_open(file,ID3_FILE_MODE_READONLY); pid3file=id3_file_open(file,ID3_FILE_MODE_READONLY);
if(!pid3file) { if(!pid3file) {
@ -221,6 +375,11 @@ int scan_gettags(char *file, MP3FILE *pmp3) {
used=1; used=1;
pmp3->genre = utf8_text; pmp3->genre = utf8_text;
DPRINTF(ERR_DEBUG," Genre: %s\n",utf8_text); DPRINTF(ERR_DEBUG," Genre: %s\n",utf8_text);
if(isdigit(pmp3->genre[0])) {
genre=atoi(pmp3->genre);
free(pmp3->genre);
pmp3->genre=strdup(scan_winamp_genre[genre]);
}
} else if(!strcmp(pid3frame->id,"COMM")) { } else if(!strcmp(pid3frame->id,"COMM")) {
used=1; used=1;
pmp3->comment = utf8_text; pmp3->comment = utf8_text;