Source code: org/esau/ptarmigan/util/HelperID3.java
1 /* $Header: /cvsroot/ptarmigan/ptarmigan/src/java/org/esau/ptarmigan/util/HelperID3.java,v 1.1 2002/09/10 06:24:34 reedesau Exp $ */
2
3 package org.esau.ptarmigan.util;
4
5 /**
6 * Common routines for ID3v1 and v2 parsing
7 *
8 * @author Reed Esau
9 * @version $Revision: 1.1 $ $Date: 2002/09/10 06:24:34 $
10 */
11 public final class HelperID3 {
12
13 static final String[] nullsoft_genres = {
14 "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge",
15 "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", "Other", "Pop", "R&B",
16 "Rap", "Reggae", "Rock", "Techno", "Industrial", "Alternative", "Ska",
17 "Death Metal", "Pranks", "Soundtrack", "Euro-Techno", "Ambient",
18 "Trip-Hop", "Vocal", "Jazz+Funk", "Fusion", "Trance", "Classical",
19 "Instrumental", "Acid", "House", "Game", "Sound Clip", "Gospel", "Noise",
20 "AlternRock", "Bass", "Soul", "Punk", "Space", "Meditative",
21 "Instrumental Pop", "Instrumental Rock", "Ethnic", "Gothic", "Darkwave",
22 "Techno-Industrial", "Electronic", "Pop-Folk", "Eurodance", "Dream",
23 "Southern Rock", "Comedy", "Cult", "Gangsta", "Top 40", "Christian Rap",
24 "Pop/Funk", "Jungle", "Native American", "Cabaret", "New Wave",
25 "Psychadelic", "Rave", "Showtunes", "Trailer", "Lo-Fi", "Tribal",
26 "Acid Punk", "Acid Jazz", "Polka", "Retro", "Musical", "Rock & Roll",
27 "Hard Rock", "Folk", "Folk-Rock", "National Folk", "Swing", "Fast Fusion",
28 "Bebob", "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde",
29 "Gothic Rock", "Progressive Rock", "Psychedelic Rock", "Symphonic Rock",
30 "Slow Rock", "Big Band", "Chorus", "Easy Listening", "Acoustic", "Humour",
31 "Speech", "Chanson", "Opera", "Chamber Music", "Sonata", "Symphony",
32 "Booty Brass", "Primus", "Porn Groove", "Satire", "Slow Jam", "Club",
33 "Tango", "Samba", "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul",
34 "Freestyle", "Duet", "Punk Rock", "Drum Solo", "A Capela", "Euro-House",
35 "Dance Hall", "Goa", "Drum & Bass", "Club-House", "Hardcore", "Terror",
36 "Indie", "BritPop", "Negerpunk", "Polsk Punk", "Beat",
37 "Christian Gangsta Rap", "Heavy Metal", "Black Metal", "Crossover",
38 "Contemporary Christian", "Christian Rock", "Merengue", "Salsa",
39 "Thrash Metal", "Anime", "JPop", "SynthPop"
40 };
41
42
43 /**
44 * return the Nullsoft genre string for the specified numeric code.
45 *
46 * @return null if not present or if code is invalid
47 */
48 public static String getNullsoftGenre(int code) {
49 return( 0 <= code && code < nullsoft_genres.length
50 ? nullsoft_genres[code]
51 : null);
52 }
53 }
54 /*
55 PTARMIGAN MODIFIED BSD LICENSE
56
57 Copyright (c) 2002, Reed Esau (reed.esau@pobox.com) All rights reserved.
58
59 Redistribution and use in source and binary forms, with or without
60 modification, are permitted provided that the following conditions are
61 met:
62
63 Redistributions of source code must retain the above copyright notice,
64 this list of conditions and the following disclaimer.
65
66 Redistributions in binary form must reproduce the above copyright notice,
67 this list of conditions and the following disclaimer in the documentation
68 and/or other materials provided with the distribution.
69
70 Neither the name of the Ptarmigan Project
71 (http://ptarmigan.sourceforge.net) nor the names of its contributors may
72 be used to endorse or promote products derived from this software without
73 specific prior written permission.
74
75 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
76 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
77 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
78 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
79 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
80 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
81 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
82 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
83 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
84 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
85 POSSIBILITY OF SUCH DAMAGE.
86 */