~ubuntu-branches/ubuntu/utopic/libjaudiotagger-java/utopic

« back to all changes in this revision

Viewing changes to src/org/jaudiotagger/tag/reference/GenreTypes.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2011-04-28 23:52:43 UTC
  • mfrom: (3.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110428235243-pzalvw6lncis3ukf
Tags: 2.0.3-1
* d/control: Drop Depends on default-jre per Debian Java Policy as its
  a library package.
* d/watch: Fix to directly monitor SVN tags.
* Switch to 3.0 (quilt) format.
* Bump Standards-Version to 3.9.2 (no changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * @author : Paul Taylor
3
 
 * <p/>
4
 
 * Version @version:$Id: GenreTypes.java,v 1.6 2009/11/12 15:43:03 paultaylor Exp $
5
 
 * <p/>
6
 
 * Jaudiotagger Copyright (C)2004,2005
7
 
 * <p/>
8
 
 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser
9
 
 * General Public  License as published by the Free Software Foundation; either version 2.1 of the License,
10
 
 * or (at your option) any later version.
11
 
 * <p/>
12
 
 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
13
 
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
 
 * See the GNU Lesser General Public License for more details.
15
 
 * <p/>
16
 
 * You should have received a copy of the GNU Lesser General Public License ainteger with this library; if not,
17
 
 * you can get a copy from http://www.opensource.org/licenses/lgpl-license.php or write to the Free Software
18
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
 
 * <p/>
20
 
 * Description:
21
 
 */
22
 
package org.jaudiotagger.tag.reference;
23
 
 
24
 
import org.jaudiotagger.tag.datatype.AbstractIntStringValuePair;
25
 
 
26
 
import java.util.LinkedHashMap;
27
 
import java.util.Map;
28
 
 
29
 
/**
30
 
 * Genre list
31
 
 * <p/>
32
 
 * <p>This is the IDv1 list with additional values as defined by Winamp, this list is also used in Mp4
33
 
 * files, note iTunes doesn't understand genres above MAX_STANDARD_GENRE_ID, Winamp does</p>
34
 
 */
35
 
public class GenreTypes extends AbstractIntStringValuePair
36
 
{
37
 
    private static int MAX_STANDARD_GENRE_ID = 125;
38
 
 
39
 
    /**
40
 
     * @return the maximum genreId that is part of the official Standard, genres above this were added by
41
 
     *         winamp later.
42
 
     */
43
 
    public static int getMaxStandardGenreId()
44
 
    {
45
 
        return MAX_STANDARD_GENRE_ID;
46
 
    }
47
 
 
48
 
    private static GenreTypes genreTypes;
49
 
 
50
 
    public static GenreTypes getInstanceOf()
51
 
    {
52
 
        if (genreTypes == null)
53
 
        {
54
 
            genreTypes = new GenreTypes();
55
 
        }
56
 
        return genreTypes;
57
 
    }
58
 
 
59
 
    //This maps the lowercase version to the id, so applications can map from the lowercase value to the id
60
 
    private Map<String, Integer> nameToIdMap;
61
 
 
62
 
 
63
 
    private GenreTypes()
64
 
    {
65
 
        idToValue.put(0, "Blues");
66
 
        idToValue.put(1, "Classic Rock");
67
 
        idToValue.put(2, "Country");
68
 
        idToValue.put(3, "Dance");
69
 
        idToValue.put(4, "Disco");
70
 
        idToValue.put(5, "Funk");
71
 
        idToValue.put(6, "Grunge");
72
 
        idToValue.put(7, "Hip-Hop");
73
 
        idToValue.put(8, "Jazz");
74
 
        idToValue.put(9, "Metal");
75
 
        idToValue.put(10, "New Age");
76
 
        idToValue.put(11, "Oldies");
77
 
        idToValue.put(12, "Other");
78
 
        idToValue.put(13, "Pop");
79
 
        idToValue.put(14, "R&B");
80
 
        idToValue.put(15, "Rap");
81
 
        idToValue.put(16, "Reggae");
82
 
        idToValue.put(17, "Rock");
83
 
        idToValue.put(18, "Techno");
84
 
        idToValue.put(19, "Industrial");
85
 
        idToValue.put(20, "Alternative");
86
 
        idToValue.put(21, "Ska");
87
 
        idToValue.put(22, "Death Metal");
88
 
        idToValue.put(23, "Pranks");
89
 
        idToValue.put(24, "Soundtrack");
90
 
        idToValue.put(25, "Euro-Techno");
91
 
        idToValue.put(26, "Ambient");
92
 
        idToValue.put(27, "Trip-Hop");
93
 
        idToValue.put(28, "Vocal");
94
 
        idToValue.put(29, "Jazz+Funk");
95
 
        idToValue.put(30, "Fusion");
96
 
        idToValue.put(31, "Trance");
97
 
        idToValue.put(32, "Classical");
98
 
        idToValue.put(33, "Instrumental");
99
 
        idToValue.put(34, "Acid");
100
 
        idToValue.put(35, "House");
101
 
        idToValue.put(36, "Game");
102
 
        idToValue.put(37, "Sound Clip");
103
 
        idToValue.put(38, "Gospel");
104
 
        idToValue.put(39, "Noise");
105
 
        idToValue.put(40, "AlternRock");
106
 
        idToValue.put(41, "Bass");
107
 
        idToValue.put(42, "Soul");
108
 
        idToValue.put(43, "Punk");
109
 
        idToValue.put(44, "Space");
110
 
        idToValue.put(45, "Meditative");
111
 
        idToValue.put(46, "Instrumental Pop");
112
 
        idToValue.put(47, "Instrumental Rock");
113
 
        idToValue.put(48, "Ethnic");
114
 
        idToValue.put(49, "Gothic");
115
 
        idToValue.put(50, "Darkwave");
116
 
        idToValue.put(51, "Techno-Industrial");
117
 
        idToValue.put(52, "Electronic");
118
 
        idToValue.put(53, "Pop-Folk");
119
 
        idToValue.put(54, "Eurodance");
120
 
        idToValue.put(55, "Dream");
121
 
        idToValue.put(56, "Southern Rock");
122
 
        idToValue.put(57, "Comedy");
123
 
        idToValue.put(58, "Cult");
124
 
        idToValue.put(59, "Gangsta");
125
 
        idToValue.put(60, "Top 40");
126
 
        idToValue.put(61, "Christian Rap");
127
 
        idToValue.put(62, "Pop/Funk");
128
 
        idToValue.put(63, "Jungle");
129
 
        idToValue.put(64, "Native American");
130
 
        idToValue.put(65, "Cabaret");
131
 
        idToValue.put(66, "New Wave");
132
 
        idToValue.put(67, "Psychadelic");
133
 
        idToValue.put(68, "Rave");
134
 
        idToValue.put(69, "Showtunes");
135
 
        idToValue.put(70, "Trailer");
136
 
        idToValue.put(71, "Lo-Fi");
137
 
        idToValue.put(72, "Tribal");
138
 
        idToValue.put(73, "Acid Punk");
139
 
        idToValue.put(74, "Acid Jazz");
140
 
        idToValue.put(75, "Polka");
141
 
        idToValue.put(76, "Retro");
142
 
        idToValue.put(77, "Musical");
143
 
        idToValue.put(78, "Rock & Roll");
144
 
        idToValue.put(79, "Hard Rock");
145
 
        idToValue.put(80, "Folk");
146
 
        idToValue.put(81, "Folk-Rock");
147
 
        idToValue.put(82, "National Folk");
148
 
        idToValue.put(83, "Swing");
149
 
        idToValue.put(84, "Fast Fusion");
150
 
        idToValue.put(85, "Bebob");
151
 
        idToValue.put(86, "Latin");
152
 
        idToValue.put(87, "Revival");
153
 
        idToValue.put(88, "Celtic");
154
 
        idToValue.put(89, "Bluegrass");
155
 
        idToValue.put(90, "Avantgarde");
156
 
        idToValue.put(91, "Gothic Rock");
157
 
        idToValue.put(92, "Progressive Rock");
158
 
        idToValue.put(93, "Psychedelic Rock");
159
 
        idToValue.put(94, "Symphonic Rock");
160
 
        idToValue.put(95, "Slow Rock");
161
 
        idToValue.put(96, "Big Band");
162
 
        idToValue.put(97, "Chorus");
163
 
        idToValue.put(98, "Easy Listening");
164
 
        idToValue.put(99, "Acoustic");
165
 
        idToValue.put(100, "Humour");
166
 
        idToValue.put(101, "Speech");
167
 
        idToValue.put(102, "Chanson");
168
 
        idToValue.put(103, "Opera");
169
 
        idToValue.put(104, "Chamber Music");
170
 
        idToValue.put(105, "Sonata");
171
 
        idToValue.put(106, "Symphony");
172
 
        idToValue.put(107, "Booty Bass");
173
 
        idToValue.put(108, "Primus");
174
 
        idToValue.put(109, "Porn Groove");
175
 
        idToValue.put(110, "Satire");
176
 
        idToValue.put(111, "Slow Jam");
177
 
        idToValue.put(112, "Club");
178
 
        idToValue.put(113, "Tango");
179
 
        idToValue.put(114, "Samba");
180
 
        idToValue.put(115, "Folklore");
181
 
        idToValue.put(116, "Ballad");
182
 
        idToValue.put(117, "Power Ballad");
183
 
        idToValue.put(118, "Rhythmic Soul");
184
 
        idToValue.put(119, "Freestyle");
185
 
        idToValue.put(120, "Duet");
186
 
        idToValue.put(121, "Punk Rock");
187
 
        idToValue.put(122, "Drum Solo");
188
 
        idToValue.put(123, "Acapella");
189
 
        idToValue.put(124, "Euro-House");
190
 
        idToValue.put(125, "Dance Hall");
191
 
        idToValue.put(126, "Goa");
192
 
        idToValue.put(127, "Drum & Bass");
193
 
        idToValue.put(128, "Club-House");
194
 
        idToValue.put(129, "Hardcore");
195
 
        idToValue.put(130, "Terror");
196
 
        idToValue.put(131, "Indie");
197
 
        idToValue.put(132, "BritPop");
198
 
        idToValue.put(133, "Negerpunk");
199
 
        idToValue.put(134, "Polsk Punk");
200
 
        idToValue.put(135, "Beat");
201
 
        idToValue.put(136, "Christian Gangsta Rap");
202
 
        idToValue.put(137, "Heavy Metal");
203
 
        idToValue.put(138, "Black Metal");
204
 
        idToValue.put(139, "Crossover");
205
 
        idToValue.put(140, "Contemporary Christian");
206
 
        idToValue.put(141, "Christian Rock");
207
 
        idToValue.put(142, "Merengue");
208
 
        idToValue.put(143, "Salsa");
209
 
        idToValue.put(144, "Thrash Metal");
210
 
        idToValue.put(145, "Anime");
211
 
        idToValue.put(146, "JPop");
212
 
        idToValue.put(147, "SynthPop");
213
 
 
214
 
        createMaps();
215
 
 
216
 
        //We now need to map from lowercase version to Id
217
 
        nameToIdMap = new LinkedHashMap<String, Integer>(idToValue.size());
218
 
        for (Map.Entry<Integer, String> entry : idToValue.entrySet())
219
 
        {
220
 
            nameToIdMap.put(entry.getValue().toLowerCase(), entry.getKey());
221
 
        }
222
 
    }
223
 
 
224
 
    /**
225
 
     * Get Id for name, match is not case sensitive
226
 
     * @param name
227
 
     * @return
228
 
     */
229
 
    public Integer getIdForName(String name)
230
 
    {
231
 
        return nameToIdMap.get(name.toLowerCase());
232
 
    }
233
 
}
 
1
/**
 
2
 * @author : Paul Taylor
 
3
 * <p/>
 
4
 * Version @version:$Id: GenreTypes.java 848 2009-11-14 07:46:43Z paultaylor $
 
5
 * <p/>
 
6
 * Jaudiotagger Copyright (C)2004,2005
 
7
 * <p/>
 
8
 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser
 
9
 * General Public  License as published by the Free Software Foundation; either version 2.1 of the License,
 
10
 * or (at your option) any later version.
 
11
 * <p/>
 
12
 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
 
13
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
14
 * See the GNU Lesser General Public License for more details.
 
15
 * <p/>
 
16
 * You should have received a copy of the GNU Lesser General Public License ainteger with this library; if not,
 
17
 * you can get a copy from http://www.opensource.org/licenses/lgpl-license.php or write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
19
 * <p/>
 
20
 * Description:
 
21
 */
 
22
package org.jaudiotagger.tag.reference;
 
23
 
 
24
import org.jaudiotagger.tag.datatype.AbstractIntStringValuePair;
 
25
 
 
26
import java.util.LinkedHashMap;
 
27
import java.util.Map;
 
28
 
 
29
/**
 
30
 * Genre list
 
31
 * <p/>
 
32
 * <p>This is the IDv1 list with additional values as defined by Winamp, this list is also used in Mp4
 
33
 * files, note iTunes doesn't understand genres above MAX_STANDARD_GENRE_ID, Winamp does</p>
 
34
 */
 
35
public class GenreTypes extends AbstractIntStringValuePair
 
36
{
 
37
    private static int MAX_STANDARD_GENRE_ID = 125;
 
38
 
 
39
    /**
 
40
     * @return the maximum genreId that is part of the official Standard, genres above this were added by
 
41
     *         Winamp later.
 
42
     */
 
43
    public static int getMaxStandardGenreId()
 
44
    {
 
45
        return MAX_STANDARD_GENRE_ID;
 
46
    }
 
47
 
 
48
    private static GenreTypes genreTypes;
 
49
 
 
50
    public static GenreTypes getInstanceOf()
 
51
    {
 
52
        if (genreTypes == null)
 
53
        {
 
54
            genreTypes = new GenreTypes();
 
55
        }
 
56
        return genreTypes;
 
57
    }
 
58
 
 
59
    //This maps the lowercase version to the id, so applications can map from the lowercase value to the id
 
60
    private Map<String, Integer> nameToIdMap;
 
61
 
 
62
 
 
63
    private GenreTypes()
 
64
    {
 
65
        idToValue.put(0, "Blues");
 
66
        idToValue.put(1, "Classic Rock");
 
67
        idToValue.put(2, "Country");
 
68
        idToValue.put(3, "Dance");
 
69
        idToValue.put(4, "Disco");
 
70
        idToValue.put(5, "Funk");
 
71
        idToValue.put(6, "Grunge");
 
72
        idToValue.put(7, "Hip-Hop");
 
73
        idToValue.put(8, "Jazz");
 
74
        idToValue.put(9, "Metal");
 
75
        idToValue.put(10, "New Age");
 
76
        idToValue.put(11, "Oldies");
 
77
        idToValue.put(12, "Other");
 
78
        idToValue.put(13, "Pop");
 
79
        idToValue.put(14, "R&B");
 
80
        idToValue.put(15, "Rap");
 
81
        idToValue.put(16, "Reggae");
 
82
        idToValue.put(17, "Rock");
 
83
        idToValue.put(18, "Techno");
 
84
        idToValue.put(19, "Industrial");
 
85
        idToValue.put(20, "Alternative");
 
86
        idToValue.put(21, "Ska");
 
87
        idToValue.put(22, "Death Metal");
 
88
        idToValue.put(23, "Pranks");
 
89
        idToValue.put(24, "Soundtrack");
 
90
        idToValue.put(25, "Euro-Techno");
 
91
        idToValue.put(26, "Ambient");
 
92
        idToValue.put(27, "Trip-Hop");
 
93
        idToValue.put(28, "Vocal");
 
94
        idToValue.put(29, "Jazz+Funk");
 
95
        idToValue.put(30, "Fusion");
 
96
        idToValue.put(31, "Trance");
 
97
        idToValue.put(32, "Classical");
 
98
        idToValue.put(33, "Instrumental");
 
99
        idToValue.put(34, "Acid");
 
100
        idToValue.put(35, "House");
 
101
        idToValue.put(36, "Game");
 
102
        idToValue.put(37, "Sound Clip");
 
103
        idToValue.put(38, "Gospel");
 
104
        idToValue.put(39, "Noise");
 
105
        idToValue.put(40, "AlternRock");
 
106
        idToValue.put(41, "Bass");
 
107
        idToValue.put(42, "Soul");
 
108
        idToValue.put(43, "Punk");
 
109
        idToValue.put(44, "Space");
 
110
        idToValue.put(45, "Meditative");
 
111
        idToValue.put(46, "Instrumental Pop");
 
112
        idToValue.put(47, "Instrumental Rock");
 
113
        idToValue.put(48, "Ethnic");
 
114
        idToValue.put(49, "Gothic");
 
115
        idToValue.put(50, "Darkwave");
 
116
        idToValue.put(51, "Techno-Industrial");
 
117
        idToValue.put(52, "Electronic");
 
118
        idToValue.put(53, "Pop-Folk");
 
119
        idToValue.put(54, "Eurodance");
 
120
        idToValue.put(55, "Dream");
 
121
        idToValue.put(56, "Southern Rock");
 
122
        idToValue.put(57, "Comedy");
 
123
        idToValue.put(58, "Cult");
 
124
        idToValue.put(59, "Gangsta");
 
125
        idToValue.put(60, "Top 40");
 
126
        idToValue.put(61, "Christian Rap");
 
127
        idToValue.put(62, "Pop/Funk");
 
128
        idToValue.put(63, "Jungle");
 
129
        idToValue.put(64, "Native American");
 
130
        idToValue.put(65, "Cabaret");
 
131
        idToValue.put(66, "New Wave");
 
132
        idToValue.put(67, "Psychadelic");
 
133
        idToValue.put(68, "Rave");
 
134
        idToValue.put(69, "Showtunes");
 
135
        idToValue.put(70, "Trailer");
 
136
        idToValue.put(71, "Lo-Fi");
 
137
        idToValue.put(72, "Tribal");
 
138
        idToValue.put(73, "Acid Punk");
 
139
        idToValue.put(74, "Acid Jazz");
 
140
        idToValue.put(75, "Polka");
 
141
        idToValue.put(76, "Retro");
 
142
        idToValue.put(77, "Musical");
 
143
        idToValue.put(78, "Rock & Roll");
 
144
        idToValue.put(79, "Hard Rock");
 
145
        idToValue.put(80, "Folk");
 
146
        idToValue.put(81, "Folk-Rock");
 
147
        idToValue.put(82, "National Folk");
 
148
        idToValue.put(83, "Swing");
 
149
        idToValue.put(84, "Fast Fusion");
 
150
        idToValue.put(85, "Bebob");
 
151
        idToValue.put(86, "Latin");
 
152
        idToValue.put(87, "Revival");
 
153
        idToValue.put(88, "Celtic");
 
154
        idToValue.put(89, "Bluegrass");
 
155
        idToValue.put(90, "Avantgarde");
 
156
        idToValue.put(91, "Gothic Rock");
 
157
        idToValue.put(92, "Progressive Rock");
 
158
        idToValue.put(93, "Psychedelic Rock");
 
159
        idToValue.put(94, "Symphonic Rock");
 
160
        idToValue.put(95, "Slow Rock");
 
161
        idToValue.put(96, "Big Band");
 
162
        idToValue.put(97, "Chorus");
 
163
        idToValue.put(98, "Easy Listening");
 
164
        idToValue.put(99, "Acoustic");
 
165
        idToValue.put(100, "Humour");
 
166
        idToValue.put(101, "Speech");
 
167
        idToValue.put(102, "Chanson");
 
168
        idToValue.put(103, "Opera");
 
169
        idToValue.put(104, "Chamber Music");
 
170
        idToValue.put(105, "Sonata");
 
171
        idToValue.put(106, "Symphony");
 
172
        idToValue.put(107, "Booty Bass");
 
173
        idToValue.put(108, "Primus");
 
174
        idToValue.put(109, "Porn Groove");
 
175
        idToValue.put(110, "Satire");
 
176
        idToValue.put(111, "Slow Jam");
 
177
        idToValue.put(112, "Club");
 
178
        idToValue.put(113, "Tango");
 
179
        idToValue.put(114, "Samba");
 
180
        idToValue.put(115, "Folklore");
 
181
        idToValue.put(116, "Ballad");
 
182
        idToValue.put(117, "Power Ballad");
 
183
        idToValue.put(118, "Rhythmic Soul");
 
184
        idToValue.put(119, "Freestyle");
 
185
        idToValue.put(120, "Duet");
 
186
        idToValue.put(121, "Punk Rock");
 
187
        idToValue.put(122, "Drum Solo");
 
188
        idToValue.put(123, "Acapella");
 
189
        idToValue.put(124, "Euro-House");
 
190
        idToValue.put(125, "Dance Hall");
 
191
        idToValue.put(126, "Goa");
 
192
        idToValue.put(127, "Drum & Bass");
 
193
        idToValue.put(128, "Club-House");
 
194
        idToValue.put(129, "Hardcore");
 
195
        idToValue.put(130, "Terror");
 
196
        idToValue.put(131, "Indie");
 
197
        idToValue.put(132, "BritPop");
 
198
        idToValue.put(133, "Negerpunk");
 
199
        idToValue.put(134, "Polsk Punk");
 
200
        idToValue.put(135, "Beat");
 
201
        idToValue.put(136, "Christian Gangsta Rap");
 
202
        idToValue.put(137, "Heavy Metal");
 
203
        idToValue.put(138, "Black Metal");
 
204
        idToValue.put(139, "Crossover");
 
205
        idToValue.put(140, "Contemporary Christian");
 
206
        idToValue.put(141, "Christian Rock");
 
207
        idToValue.put(142, "Merengue");
 
208
        idToValue.put(143, "Salsa");
 
209
        idToValue.put(144, "Thrash Metal");
 
210
        idToValue.put(145, "Anime");
 
211
        idToValue.put(146, "JPop");
 
212
        idToValue.put(147, "SynthPop");
 
213
 
 
214
        createMaps();
 
215
 
 
216
        //We now need to map from lowercase version to Id
 
217
        nameToIdMap = new LinkedHashMap<String, Integer>(idToValue.size());
 
218
        for (Map.Entry<Integer, String> entry : idToValue.entrySet())
 
219
        {
 
220
            nameToIdMap.put(entry.getValue().toLowerCase(), entry.getKey());
 
221
        }
 
222
    }
 
223
 
 
224
    /**
 
225
     * Get Id for name, match is not case sensitive
 
226
     * @param name
 
227
     * @return
 
228
     */
 
229
    public Integer getIdForName(String name)
 
230
    {
 
231
        return nameToIdMap.get(name.toLowerCase());
 
232
    }
 
233
}