From 7f5d8f96b1c1f2fcae2c989fbe2782754b79e6de Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Mon, 1 Dec 2003 03:23:43 +0000 Subject: [PATCH] Fix ID3v1 tags --- src/mp3-scanner.c | 159 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) diff --git a/src/mp3-scanner.c b/src/mp3-scanner.c index 68206d03..6563f00c 100644 --- a/src/mp3-scanner.c +++ b/src/mp3-scanner.c @@ -54,6 +54,159 @@ int scan_br_table[] = { 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 */ @@ -178,6 +331,7 @@ int scan_gettags(char *file, MP3FILE *pmp3) { int index; int used; unsigned char *utf8_text; + int genre; pid3file=id3_file_open(file,ID3_FILE_MODE_READONLY); if(!pid3file) { @@ -221,6 +375,11 @@ int scan_gettags(char *file, MP3FILE *pmp3) { used=1; pmp3->genre = 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")) { used=1; pmp3->comment = utf8_text;