Added volume to client plus other fixes
[stereo.git] / DAAPLib / src / daap / DAAPConstants.java
blobb22102fa0c2ff64aec3905d766f22cb96be2ff5e
1 package daap;
3 import java.util.HashMap;
4 import java.util.Map;
6 public class DAAPConstants {
8 public static final int abal = 1633837420;
9 public static final int abar = 1633837426;
10 public static final int abcp = 1633837936;
11 public static final int abgn = 1633838958;
12 public static final int abpl = 1633841260;
13 public static final int abro = 1633841775;
14 public static final int adbs = 1633968755;
15 public static final int aeAI = 1634025801;
16 public static final int aeCI = 1634026313;
17 public static final int aeCR = 1634026322;
18 public static final int aeEN = 1634026830;
19 public static final int aeES = 1634026835;
20 public static final int aeGD = 1634027332;
21 public static final int aeGE = 1634027333;
22 public static final int aeGH = 1634027336;
23 public static final int aeGI = 1634027337;
24 public static final int aeGR = 1634027346;
25 public static final int aeGU = 1634027349;
26 public static final int aeHV = 1634027606;
27 public static final int aeMK = 1634028875;
28 public static final int aeNN = 1634029134;
29 public static final int aeNV = 1634029142;
30 public static final int aePC = 1634029635;
31 public static final int aePI = 1634029641;
32 public static final int aePP = 1634029648;
33 public static final int aePS = 1634029651;
34 public static final int aeSF = 1634030406;
35 public static final int aeSI = 1634030409;
36 public static final int aeSN = 1634030414;
37 public static final int aeSP = 1634030416;
38 public static final int aeSU = 1634030421;
39 public static final int aeSV = 1634030422;
40 public static final int agrp = 1634169456;
41 public static final int aply = 1634757753;
42 public static final int aprm = 1634759277;
43 public static final int apro = 1634759279;
44 public static final int apsm = 1634759533;
45 public static final int apso = 1634759535;
46 public static final int arif = 1634888038;
47 public static final int arsv = 1634890614;
48 public static final int asaa = 1634951521;
49 public static final int asai = 1634951529;
50 public static final int asal = 1634951532;
51 public static final int asar = 1634951538;
52 public static final int asbk = 1634951787;
53 public static final int asbo = 1634951791;
54 public static final int asbr = 1634951794;
55 public static final int asbt = 1634951796;
56 public static final int ascd = 1634952036;
57 public static final int ascm = 1634952045;
58 public static final int ascn = 1634952046;
59 public static final int asco = 1634952047;
60 public static final int ascp = 1634952048;
61 public static final int ascr = 1634952050;
62 public static final int ascs = 1634952051;
63 public static final int asct = 1634952052;
64 public static final int asda = 1634952289;
65 public static final int asdb = 1634952290;
66 public static final int asdc = 1634952291;
67 public static final int asdk = 1634952299;
68 public static final int asdm = 1634952301;
69 public static final int asdn = 1634952302;
70 public static final int asdp = 1634952304;
71 public static final int asdr = 1634952306;
72 public static final int asdt = 1634952308;
73 public static final int ased = 1634952548;
74 public static final int aseq = 1634952561;
75 public static final int asfm = 1634952813;
76 public static final int asgn = 1634953070;
77 public static final int asgp = 1634953072;
78 public static final int ashp = 1634953328;
79 public static final int asky = 1634954105;
80 public static final int aslc = 1634954339;
81 public static final int aspu = 1634955381;
82 public static final int asrv = 1634955894;
83 public static final int assa = 1634956129;
84 public static final int assc = 1634956131;
85 public static final int assl = 1634956140;
86 public static final int assn = 1634956142;
87 public static final int assp = 1634956144;
88 public static final int assr = 1634956146;
89 public static final int asss = 1634956147;
90 public static final int asst = 1634956148;
91 public static final int assu = 1634956149;
92 public static final int assz = 1634956154;
93 public static final int astc = 1634956387;
94 public static final int astm = 1634956397;
95 public static final int astn = 1634956398;
96 public static final int asul = 1634956652;
97 public static final int asur = 1634956658;
98 public static final int asyr = 1634957682;
99 public static final int ated = 1635018084;
100 public static final int avdb = 1635148898;
101 public static final int mbcl = 1835164524;
102 public static final int mccr = 1835230066;
103 public static final int mcna = 1835232865;
104 public static final int mcnm = 1835232877;
105 public static final int mcon = 1835233134;
106 public static final int mctc = 1835234403;
107 public static final int mcti = 1835234409;
108 public static final int mcty = 1835234425;
109 public static final int mdcl = 1835295596;
110 public static final int miid = 1835624804;
111 public static final int mikd = 1835625316;
112 public static final int mimc = 1835625827;
113 public static final int minm = 1835626093;
114 public static final int mlcl = 1835819884;
115 public static final int mlid = 1835821412;
116 public static final int mlit = 1835821428;
117 public static final int mlog = 1835822951;
118 public static final int mpco = 1836082031;
119 public static final int mper = 1836082546;
120 public static final int mpro = 1836085871;
121 public static final int mrco = 1836213103;
122 public static final int msal = 1836278124;
123 public static final int msas = 1836278131;
124 public static final int msau = 1836278133;
125 public static final int msbr = 1836278386;
126 public static final int msdc = 1836278883;
127 public static final int msed = 1836279140;
128 public static final int msex = 1836279160;
129 public static final int msix = 1836280184;
130 public static final int mslr = 1836280946;
131 public static final int mspi = 1836281961;
132 public static final int msqy = 1836282233;
133 public static final int msrs = 1836282483;
134 public static final int msrv = 1836282486;
135 public static final int mstc = 1836282979;
136 public static final int mstm = 1836282989;
137 public static final int msto = 1836282991;
138 public static final int msts = 1836282995;
139 public static final int mstt = 1836282996;
140 public static final int msup = 1836283248;
141 public static final int mtco = 1836344175;
142 public static final int mudl = 1836409964;
143 public static final int mupd = 1836413028;
144 public static final int musr = 1836413810;
145 public static final int muty = 1836414073;
147 public static final int ITEM_KIND = mikd;
148 public static final int TRACK_ID = miid;
149 public static final int NAME = minm;
150 public static final int ARTIST = asar;
151 public static final int PERSISTENT_ID = mper;
152 public static final int ALBUM = asal;
153 public static final int BITRATE = asbr;
154 public static final int COMPOSER = ascp;
155 public static final int GENRE = asgn;
156 public static final int SONG_TIME = astm;
157 public static final int START_TIME = asst;
158 public static final int STOP_TIME = assp;
160 public static final Map<Integer, String> codeToNameMap
161 = new HashMap<Integer, String>();
162 public static final Map<String, Integer> nameToCodeMap
163 = new HashMap<String, Integer>();
164 public static final Map<Integer, Integer> codeToTypeMap
165 = new HashMap<Integer, Integer>();
167 public static int stringToCode(String code) {
168 return readInteger(code.toCharArray());
171 public static String codeToString(int code) {
172 byte[] bytes = new byte[4];
173 bytes[0] = (byte)((code >> 24) & 255);
174 bytes[1] = (byte)((code >> 16) & 255);
175 bytes[2] = (byte)((code >> 8) & 255);
176 bytes[3] = (byte)(code & 255);
177 return new String(bytes);
180 private static int readInteger(char[] b) {
181 int size = 0;
182 for (int i = 0; i < 4; i++) {
183 size <<= 8;
184 size += b[i] & 255;
186 return size;
189 protected interface CCBuilder {
190 public CCBuilder type(int raw, String shortCode, String longCode, int type);
193 static {
194 CCBuilder b = new CCBuilder() {
195 public CCBuilder type(int raw, String shortCode, String longCode, int type) {
196 codeToNameMap.put(raw, longCode);
197 nameToCodeMap.put(longCode, raw);
198 codeToTypeMap.put(raw, type);
199 return this;
204 while read short type long; do
205 printf ".type(%s, \"%s\", %-43s, %3i)\n" \
206 $short $short \"$long\" $type
207 done < content-codes.txt
211 .type(abal, "abal", "daap.browsealbumlisting" , 12)
212 .type(abar, "abar", "daap.browseartistlisting" , 12)
213 .type(abcp, "abcp", "daap.browsecomposerlisting" , 12)
214 .type(abgn, "abgn", "daap.browsegenrelisting" , 12)
215 .type(abpl, "abpl", "daap.baseplaylist" , 1)
216 .type(abro, "abro", "daap.databasebrowse" , 12)
217 .type(adbs, "adbs", "daap.databasesongs" , 12)
218 .type(aeAI, "aeAI", "com.apple.itunes.itms-artistid" , 5)
219 .type(aeCI, "aeCI", "com.apple.itunes.itms-composerid" , 5)
220 .type(aeCR, "aeCR", "com.apple.itunes.content-rating" , 9)
221 .type(aeEN, "aeEN", "com.apple.itunes.episode-num-str" , 9)
222 .type(aeES, "aeES", "com.apple.itunes.episode-sort" , 5)
223 .type(aeGD, "aeGD", "com.apple.itunes.gapless-enc-dr" , 5)
224 .type(aeGE, "aeGE", "com.apple.itunes.gapless-enc-del" , 5)
225 .type(aeGH, "aeGH", "com.apple.itunes.gapless-heur" , 5)
226 .type(aeGI, "aeGI", "com.apple.itunes.itms-genreid" , 5)
227 .type(aeGR, "aeGR", "com.apple.itunes.gapless-resy" , 7)
228 .type(aeGU, "aeGU", "com.apple.itunes.gapless-dur" , 7)
229 .type(aeHV, "aeHV", "com.apple.itunes.has-video" , 1)
230 .type(aeMK, "aeMK", "com.apple.itunes.mediakind" , 1)
231 .type(aeNN, "aeNN", "com.apple.itunes.network-name" , 9)
232 .type(aeNV, "aeNV", "com.apple.itunes.norm-volume" , 5)
233 .type(aePC, "aePC", "com.apple.itunes.is-podcast" , 1)
234 .type(aePI, "aePI", "com.apple.itunes.itms-playlistid" , 5)
235 .type(aePP, "aePP", "com.apple.itunes.is-podcast-playlist" , 1)
236 .type(aePS, "aePS", "com.apple.itunes.special-playlist" , 1)
237 .type(aeSF, "aeSF", "com.apple.itunes.itms-storefrontid" , 5)
238 .type(aeSI, "aeSI", "com.apple.itunes.itms-songid" , 5)
239 .type(aeSN, "aeSN", "com.apple.itunes.series-name" , 9)
240 .type(aeSP, "aeSP", "com.apple.itunes.smart-playlist" , 1)
241 .type(aeSU, "aeSU", "com.apple.itunes.season-num" , 5)
242 .type(aeSV, "aeSV", "com.apple.itunes.music-sharing-version" , 5)
243 .type(agrp, "agrp", "daap.songgrouping" , 9)
244 .type(aply, "aply", "daap.databaseplaylists" , 12)
245 .type(aprm, "aprm", "daap.playlistrepeatmode" , 1)
246 .type(apro, "apro", "daap.protocolversion" , 11)
247 .type(apsm, "apsm", "daap.playlistshufflemode" , 1)
248 .type(apso, "apso", "daap.playlistsongs" , 12)
249 .type(arif, "arif", "daap.resolveinfo" , 12)
250 .type(arsv, "arsv", "daap.resolve" , 12)
251 .type(asaa, "asaa", "daap.songalbumartist" , 9)
252 .type(asai, "asai", "daap.songalbumid" , 7)
253 .type(asal, "asal", "daap.songalbum" , 9)
254 .type(asar, "asar", "daap.songartist" , 9)
255 .type(asbk, "asbk", "daap.bookmarkable" , 1)
256 .type(asbo, "asbo", "daap.songbookmark" , 5)
257 .type(asbr, "asbr", "daap.songbitrate" , 3)
258 .type(asbt, "asbt", "daap.songbeatsperminute" , 3)
259 .type(ascd, "ascd", "daap.songcodectype" , 5)
260 .type(ascm, "ascm", "daap.songcomment" , 9)
261 .type(ascn, "ascn", "daap.songcontentdescription" , 9)
262 .type(asco, "asco", "daap.songcompilation" , 1)
263 .type(ascp, "ascp", "daap.songcomposer" , 9)
264 .type(ascr, "ascr", "daap.songcontentrating" , 1)
265 .type(ascs, "ascs", "daap.songcodecsubtype" , 5)
266 .type(asct, "asct", "daap.songcategory" , 9)
267 .type(asda, "asda", "daap.songdateadded" , 10)
268 .type(asdb, "asdb", "daap.songdisabled" , 1)
269 .type(asdc, "asdc", "daap.songdisccount" , 3)
270 .type(asdk, "asdk", "daap.songdatakind" , 1)
271 .type(asdm, "asdm", "daap.songdatemodified" , 10)
272 .type(asdn, "asdn", "daap.songdiscnumber" , 3)
273 .type(asdp, "asdp", "daap.songdatepurchased" , 10)
274 .type(asdr, "asdr", "daap.songdatereleased" , 10)
275 .type(asdt, "asdt", "daap.songdescription" , 9)
276 .type(ased, "ased", "daap.songextradata" , 3)
277 .type(aseq, "aseq", "daap.songeqpreset" , 9)
278 .type(asfm, "asfm", "daap.songformat" , 9)
279 .type(asgn, "asgn", "daap.songgenre" , 9)
280 .type(asgp, "asgp", "daap.songgapless" , 1)
281 .type(ashp, "ashp", "daap.songhasbeenplayed" , 1)
282 .type(asky, "asky", "daap.songkeywords" , 9)
283 .type(aslc, "aslc", "daap.songlongcontentdescription" , 9)
284 .type(aspu, "aspu", "daap.songpodcasturl" , 9)
285 .type(asrv, "asrv", "daap.songrelativevolume" , 2)
286 .type(assa, "assa", "daap.sortartist" , 9)
287 .type(assc, "assc", "daap.sortcomposer" , 9)
288 .type(assl, "assl", "daap.sortalbumartist" , 9)
289 .type(assn, "assn", "daap.sortname" , 9)
290 .type(assp, "assp", "daap.songstoptime" , 5)
291 .type(assr, "assr", "daap.songsamplerate" , 5)
292 .type(asss, "asss", "daap.sortseriesname" , 9)
293 .type(asst, "asst", "daap.songstarttime" , 5)
294 .type(assu, "assu", "daap.sortalbum" , 9)
295 .type(assz, "assz", "daap.songsize" , 5)
296 .type(astc, "astc", "daap.songtrackcount" , 3)
297 .type(astm, "astm", "daap.songtime" , 5)
298 .type(astn, "astn", "daap.songtracknumber" , 3)
299 .type(asul, "asul", "daap.songdataurl" , 9)
300 .type(asur, "asur", "daap.songuserrating" , 1)
301 .type(asyr, "asyr", "daap.songyear" , 3)
302 .type(ated, "ated", "daap.supportsextradata" , 3)
303 .type(avdb, "avdb", "daap.serverdatabases" , 12)
304 .type(mbcl, "mbcl", "dmap.bag" , 12)
305 .type(mccr, "mccr", "dmap.contentcodesresponse" , 12)
306 .type(mcna, "mcna", "dmap.contentcodesname" , 9)
307 .type(mcnm, "mcnm", "dmap.contentcodesnumber" , 5)
308 .type(mcon, "mcon", "dmap.container" , 12)
309 .type(mctc, "mctc", "dmap.containercount" , 5)
310 .type(mcti, "mcti", "dmap.containeritemid" , 5)
311 .type(mcty, "mcty", "dmap.contentcodestype" , 3)
312 .type(mdcl, "mdcl", "dmap.dictionary" , 12)
313 .type(miid, "miid", "dmap.itemid" , 5)
314 .type(mikd, "mikd", "dmap.itemkind" , 1)
315 .type(mimc, "mimc", "dmap.itemcount" , 5)
316 .type(minm, "minm", "dmap.itemname" , 9)
317 .type(mlcl, "mlcl", "dmap.listing" , 12)
318 .type(mlid, "mlid", "dmap.sessionid" , 5)
319 .type(mlit, "mlit", "dmap.listingitem" , 12)
320 .type(mlog, "mlog", "dmap.loginresponse" , 12)
321 .type(mpco, "mpco", "dmap.parentcontainerid" , 5)
322 .type(mper, "mper", "dmap.persistentid" , 7)
323 .type(mpro, "mpro", "dmap.protocolversion" , 11)
324 .type(mrco, "mrco", "dmap.returnedcount" , 5)
325 .type(msal, "msal", "dmap.supportsautologout" , 1)
326 .type(msas, "msas", "dmap.authenticationschemes" , 5)
327 .type(msau, "msau", "dmap.authenticationmethod" , 1)
328 .type(msbr, "msbr", "dmap.supportsbrowse" , 1)
329 .type(msdc, "msdc", "dmap.databasescount" , 5)
330 .type(msdc, "msed", "dmap.supportsedit" , 1)
331 .type(msex, "msex", "dmap.supportsextensions" , 1)
332 .type(msix, "msix", "dmap.supportsindex" , 1)
333 .type(mslr, "mslr", "dmap.loginrequired" , 1)
334 .type(mspi, "mspi", "dmap.supportspersistentids" , 1)
335 .type(msqy, "msqy", "dmap.supportsquery" , 1)
336 .type(msrs, "msrs", "dmap.supportsresolve" , 1)
337 .type(msrv, "msrv", "dmap.serverinforesponse" , 12)
338 .type(mstc, "mstc", "dmap.utctime" , 10)
339 .type(mstm, "mstm", "dmap.timeoutinterval" , 5)
340 .type(msto, "msto", "dmap.utcoffset" , 6)
341 .type(msts, "msts", "dmap.statusstring" , 9)
342 .type(mstt, "mstt", "dmap.status" , 5)
343 .type(msup, "msup", "dmap.supportsupdate" , 1)
344 .type(mtco, "mtco", "dmap.specifiedtotalcount" , 5)
345 .type(mudl, "mudl", "dmap.deletedidlisting" , 12)
346 .type(mupd, "mupd", "dmap.updateresponse" , 12)
347 .type(musr, "musr", "dmap.serverrevision" , 5)
348 .type(muty, "muty", "dmap.updatetype" , 1)