Fix problem with genres greater than 148

This commit is contained in:
Ron Pedde 2004-02-09 17:42:57 +00:00
parent cd24d0c5d1
commit d58c2c6ede
1 changed files with 162 additions and 151 deletions

View File

@ -59,157 +59,159 @@ int scan_br_table[] = {
};
char *scan_winamp_genre[] = {
"Blues",
"Blues", // 0
"Classic Rock",
"Country",
"Dance",
"Disco",
"Funk",
"Funk", // 5
"Grunge",
"Hip-Hop",
"Jazz",
"Metal",
"New Age",
"New Age", // 10
"Oldies",
"Other",
"Pop",
"R&B",
"Rap",
"Rap", // 15
"Reggae",
"Rock",
"Techno",
"Industrial",
"Alternative",
"Alternative", // 20
"Ska",
"Death Metal",
"Pranks",
"Soundtrack",
"Euro-Techno",
"Euro-Techno", // 25
"Ambient",
"Trip-Hop",
"Vocal",
"Jazz+Funk",
"Fusion",
"Fusion", // 30
"Trance",
"Classical",
"Instrumental",
"Acid",
"House",
"House", // 35
"Game",
"Sound Clip",
"Gospel",
"Noise",
"AlternRock",
"AlternRock", // 40
"Bass",
"Soul",
"Punk",
"Space",
"Meditative",
"Meditative", // 45
"Instrumental Pop",
"Instrumental Rock",
"Ethnic",
"Gothic",
"Darkwave",
"Darkwave", // 50
"Techno-Industrial",
"Electronic",
"Pop-Folk",
"Eurodance",
"Dream",
"Dream", // 55
"Southern Rock",
"Comedy",
"Cult",
"Gangsta",
"Top 40",
"Top 40", // 60
"Christian Rap",
"Pop/Funk",
"Jungle",
"Native American",
"Cabaret",
"Cabaret", // 65
"New Wave",
"Psychadelic",
"Rave",
"Showtunes",
"Trailer",
"Trailer", // 70
"Lo-Fi",
"Tribal",
"Acid Punk",
"Acid Jazz",
"Polka",
"Polka", // 75
"Retro",
"Musical",
"Rock & Roll",
"Hard Rock",
"Folk",
"Folk", // 80
"Folk/Rock",
"National folk",
"Swing",
"Fast-fusion",
"Bebob",
"Bebob", // 85
"Latin",
"Revival",
"Celtic",
"Bluegrass",
"Avantgarde",
"Avantgarde", // 90
"Gothic Rock",
"Progressive Rock",
"Psychedelic Rock",
"Symphonic Rock",
"Slow Rock",
"Slow Rock", // 95
"Big Band",
"Chorus",
"Easy Listening",
"Acoustic",
"Humour",
"Humour", // 100
"Speech",
"Chanson",
"Opera",
"Chamber Music",
"Sonata",
"Sonata", // 105
"Symphony",
"Booty Bass",
"Primus",
"Porn Groove",
"Satire",
"Satire", // 110
"Slow Jam",
"Club",
"Tango",
"Samba",
"Folklore",
"Folklore", // 115
"Ballad",
"Powder Ballad",
"Rhythmic Soul",
"Freestyle",
"Duet",
"Duet", // 120
"Punk Rock",
"Drum Solo",
"A Capella",
"Euro-House",
"Dance Hall",
"Dance Hall", // 125
"Goa",
"Drum & Bass",
"Club House",
"Hardcore",
"Terror",
"Terror", // 130
"Indie",
"BritPop",
"NegerPunk",
"Polsk Punk",
"Beat",
"Beat", // 135
"Christian Gangsta",
"Heavy Metal",
"Black Metal",
"Crossover",
"Contemporary C",
"Contemporary C", // 140
"Christian Rock",
"Merengue",
"Salsa",
"Thrash Metal",
"Anime",
"Anime", // 145
"JPop",
"SynthPop",
"Unknown"
};
#define WINAMP_GENRE_UNKNOWN 148
/*
* Forwards
@ -455,8 +457,17 @@ int scan_gettags(char *file, MP3FILE *pmp3) {
used=1;
pmp3->genre = utf8_text;
DPRINTF(ERR_DEBUG," Genre: %s\n",utf8_text);
if((pmp3->genre) && (isdigit(pmp3->genre[0]))) {
if(pmp3->genre) {
if(!strlen(pmp3->genre)) {
genre=WINAMP_GENRE_UNKNOWN;
} else if (isdigit(pmp3->genre[0])) {
genre=atoi(pmp3->genre);
} else if ((pmp3->genre[0] == '(') && (isdigit(pmp3->genre[1]))) {
genre=atoi((char*)&pmp3->genre[1]);
}
if((genre < 0) || (genre > WINAMP_GENRE_UNKNOWN))
genre=WINAMP_GENRE_UNKNOWN;
free(pmp3->genre);
pmp3->genre=strdup(scan_winamp_genre[genre]);
}