Merge lp:~hile/mixxx/hidscripts into lp:~mixxxdevelopers/mixxx/trunk

Proposed by Ilkka Tuohela
Status: Merged
Merged at revision: 3292
Proposed branch: lp:~hile/mixxx/hidscripts
Merge into: lp:~mixxxdevelopers/mixxx/trunk
Diff against target: 5929 lines (+2487/-1723)
56 files modified
mixxx/res/controllers/Akai MPD24.midi.xml (+3/-0)
mixxx/res/controllers/American Audio RADIUS 2000 CH1.midi.xml (+2/-42)
mixxx/res/controllers/American Audio RADIUS 2000 CH2.midi.xml (+2/-42)
mixxx/res/controllers/Behringer BCD2000.midi.xml (+2/-49)
mixxx/res/controllers/Behringer BCD3000.midi.xml (+3/-0)
mixxx/res/controllers/DJ-Tech CDJ-101.midi.xml (+2/-2)
mixxx/res/controllers/DJ-Tech DJM-101.midi.xml (+2/-2)
mixxx/res/controllers/DJ-Tech i-Mix Reload.midi.xml (+3/-0)
mixxx/res/controllers/DJTechTools MIDI Fighter.midi.xml (+1/-1)
mixxx/res/controllers/Denon MC3000.midi.xml (+1/-1)
mixxx/res/controllers/EKS Otus.cntrlr.xml (+1/-1)
mixxx/res/controllers/EKS-Otus.js (+37/-21)
mixxx/res/controllers/Evolution_Xsession.midi.xml (+2/-2)
mixxx/res/controllers/FaderFoxDJ2.midi.xml (+4/-4)
mixxx/res/controllers/HID Keyboard.cntrlr.xml.example (+1/-1)
mixxx/res/controllers/HID Trackpad.cntrlr.xml.example (+1/-1)
mixxx/res/controllers/Hercules DJ Console 4-Mx.midi.xml (+2/-1)
mixxx/res/controllers/Hercules DJ Console Mac Edition.midi.xml (+2/-2)
mixxx/res/controllers/Hercules DJ Console Mk2.cntrlr.xml (+1/-1)
mixxx/res/controllers/Hercules DJ Console Mk4.midi.xml (+0/-45)
mixxx/res/controllers/Hercules DJ Control AIR.midi.xml (+2/-1)
mixxx/res/controllers/Hercules DJ Control MP3 e2.midi.xml (+0/-64)
mixxx/res/controllers/M-Audio_Xponent.midi.xml (+113/-113)
mixxx/res/controllers/M-Audio_Xsession_pro.midi.xml (+2/-2)
mixxx/res/controllers/Midi-Keyboard.midi.xml (+2/-2)
mixxx/res/controllers/MidiTech-MidiControl.midi.xml (+2/-2)
mixxx/res/controllers/Mixman DM2 (OS X).midi.xml (+2/-0)
mixxx/res/controllers/Mixman DM2 (Windows).midi.xml (+2/-2)
mixxx/res/controllers/Nintendo Wiimote.cntrlr.xml (+1/-2)
mixxx/res/controllers/Novation Launchpad.midi.xml (+2/-2)
mixxx/res/controllers/Numark DJ2Go.midi.xml (+1/-14)
mixxx/res/controllers/Numark MIXTRACK.midi.xml (+0/-13)
mixxx/res/controllers/Numark Mixtrack Pro.midi.xml (+2/-1)
mixxx/res/controllers/Numark N4.midi.xml (+2/-1)
mixxx/res/controllers/Numark NS7.midi.xml (+1/-1)
mixxx/res/controllers/Pioneer CDJ HID.cntrlr.xml (+1/-1)
mixxx/res/controllers/Pioneer CDJ-2000.midi.xml (+1/-1)
mixxx/res/controllers/Pioneer CDJ-850.midi.xml (+1/-1)
mixxx/res/controllers/Pioneer-CDJ-HID.js (+279/-193)
mixxx/res/controllers/Reloop TerminalMix4.midi.xml (+3/-3)
mixxx/res/controllers/Sony SixxAxis.cntrlr.xml (+1/-1)
mixxx/res/controllers/Stanton SCS.1d.midi.xml (+1/-1)
mixxx/res/controllers/Stanton SCS.1m.midi.xml (+1/-1)
mixxx/res/controllers/Stanton SCS.3d.midi.xml (+204/-190)
mixxx/res/controllers/Stanton SCS.3m.midi.xml (+1/-1)
mixxx/res/controllers/TrakProDJ iPad.midi.xml (+1/-1)
mixxx/res/controllers/Traktor Kontrol F1 Samplers.cntrlr.xml (+0/-18)
mixxx/res/controllers/Traktor Kontrol F1.cntrlr.xml (+18/-0)
mixxx/res/controllers/Traktor Kontrol X1.midi.xml (+1/-3)
mixxx/res/controllers/Traktor-Kontrol-F1-Samplers.js (+0/-578)
mixxx/res/controllers/Traktor-Kontrol-F1-scripts.js (+788/-0)
mixxx/res/controllers/Traktor-Kontrol-X1.js (+252/-276)
mixxx/res/controllers/Vestax VCI-100-hile.midi.xml (+102/-0)
mixxx/res/controllers/Vestax VCI-100.midi.xml (+0/-6)
mixxx/res/controllers/Vestax-VCI-100-hile.js (+539/-0)
mixxx/res/controllers/common-hid-packet-parser.js (+87/-10)
To merge this branch: bzr merge lp:~hile/mixxx/hidscripts
Reviewer Review Type Date Requested Status
Mixxx Development Team Pending
Review via email: mp+118291@code.launchpad.net

Description of the change

Again, updated HID controllers to latest versions. This now includes:

- very usable and functional Pioneer CDJ controlller (I used it on a gig already :)
- traktor X1 controller fixes (more sensible button layout)
- traktor F1 controller now can control both decks and samplers (press quant/capture)
- EKS Otus HID mapping fine tuning
- minor fixes to HIDController prototype

In addition, this patch includes changes to MIDI controller XML files. The fixes include:

- Comment out unsupported info elements
- Remove duplicate control and output declarations
- Add at least a dummy description to all files
- Fix Zestoi's MIDI mappings to use MixxxMIDIController instead of the HID XML mode

To post a comment you must log in.
lp:~hile/mixxx/hidscripts updated
3201. By Ilkka Tuohela

Remove unnecessary debug prints from X1

3202. By Ilkka Tuohela

Fixed XML file authors and descriptions based on information from Jus

3203. By Ilkka Tuohela

Fixed XML errors to validate against DTD

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mixxx/res/controllers/Akai MPD24.midi.xml'
2--- mixxx/res/controllers/Akai MPD24.midi.xml 2012-04-29 04:31:26 +0000
3+++ mixxx/res/controllers/Akai MPD24.midi.xml 2012-08-08 11:20:30 +0000
4@@ -2,6 +2,9 @@
5 <MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.6.2+">
6 <info>
7 <name>Akai MPD24</name>
8+ <author>klico</author>
9+ <description>MIDI mapping for Akai MPD24</description>
10+ <forums>http://mixxx.org/forums/viewtopic.php?f=7&amp;t=39</forums>
11 </info>
12 <controller id="Akai MPD24 MIDI 1">
13 <controls>
14
15=== modified file 'mixxx/res/controllers/American Audio RADIUS 2000 CH1.midi.xml'
16--- mixxx/res/controllers/American Audio RADIUS 2000 CH1.midi.xml 2012-04-29 04:31:26 +0000
17+++ mixxx/res/controllers/American Audio RADIUS 2000 CH1.midi.xml 2012-08-08 11:20:30 +0000
18@@ -1,6 +1,8 @@
19 <MixxxMIDIPreset mixxxVersion="1.10.0-beta1+" schemaVersion="1">
20 <info>
21 <name>American Audio Radius 2000 CH1</name>
22+ <author>Markus Steinbauer</author>
23+ <description>American Audio Radius 2000 mapping for Deck 1</description>
24 </info>
25 <controller id="Radius 2000 MIDI 1">
26 <scriptfiles>
27@@ -12,7 +14,6 @@
28 <midino>0x38</midino>
29 <group>[Playlist]</group>
30 <key>RADIUS2000.trackSearch</key>
31- <description></description>
32 <options>
33 <Script-Binding/>
34 </options>
35@@ -22,7 +23,6 @@
36 <midino>0x36</midino>
37 <group>[Playlist]</group>
38 <key>RADIUS2000.menuSearch</key>
39- <description></description>
40 <options>
41 <Script-Binding/>
42 </options>
43@@ -32,7 +32,6 @@
44 <midino>0x30</midino>
45 <group>[Channel1]</group>
46 <key>RADIUS2000.cue</key>
47- <description></description>
48 <options>
49 <Script-Binding/>
50 </options>
51@@ -42,7 +41,6 @@
52 <midino>0x26</midino>
53 <group>[Channel1]</group>
54 <key>RADIUS2000.wheelTouch</key>
55- <description></description>
56 <options>
57 <Script-Binding/>
58 </options>
59@@ -52,7 +50,6 @@
60 <midino>0x35</midino>
61 <group>[Channel1]</group>
62 <key>RADIUS2000.wheelTurn</key>
63- <description></description>
64 <options>
65 <Script-Binding/>
66 </options>
67@@ -62,17 +59,6 @@
68 <midino>0x2a</midino>
69 <group>[Channel1]</group>
70 <key>RADIUS2000.play</key>
71- <description></description>
72- <options>
73- <Script-Binding/>
74- </options>
75- </control>
76- <control>
77- <status>0x90</status>
78- <midino>0x2a</midino>
79- <group>[Channel1]</group>
80- <key>RADIUS2000.play</key>
81- <description></description>
82 <options>
83 <Script-Binding/>
84 </options>
85@@ -82,7 +68,6 @@
86 <midino>0x06</midino>
87 <group>[Channel1]</group>
88 <key>RADIUS2000.keylock</key>
89- <description></description>
90 <options>
91 <Script-Binding/>
92 </options>
93@@ -92,7 +77,6 @@
94 <midino>0x0C</midino>
95 <group>[Channel1]</group>
96 <key>RADIUS2000.pitchRateRange</key>
97- <description></description>
98 <options>
99 <Script-Binding/>
100 </options>
101@@ -102,7 +86,6 @@
102 <midino>0x01</midino>
103 <group>[Channel1]</group>
104 <key>RADIUS2000.pitchRate</key>
105- <description></description>
106 <options>
107 <Script-Binding/>
108 </options>
109@@ -112,7 +95,6 @@
110 <midino>0x2D</midino>
111 <group>[Channel1]</group>
112 <key>RADIUS2000.flanger</key>
113- <description></description>
114 <options>
115 <Script-Binding/>
116 </options>
117@@ -122,7 +104,6 @@
118 <midino>0x18</midino>
119 <group>[Channel1]</group>
120 <key>RADIUS2000.flangerDelay</key>
121- <description></description>
122 <options>
123 <Script-Binding/>
124 </options>
125@@ -132,7 +113,6 @@
126 <midino>0x07</midino>
127 <group>[Channel1]</group>
128 <key>rate_temp_down</key>
129- <description></description>
130 <options>
131 <normal/>
132 </options>
133@@ -142,7 +122,6 @@
134 <midino>0x0D</midino>
135 <group>[Channel1]</group>
136 <key>rate_temp_up</key>
137- <description></description>
138 <options>
139 <normal/>
140 </options>
141@@ -152,7 +131,6 @@
142 <midino>0x2</midino>
143 <group>[Channel1]</group>
144 <key>beatloop_4</key>
145- <description></description>
146 <options>
147 <normal/>
148 </options>
149@@ -162,7 +140,6 @@
150 <midino>0x4</midino>
151 <group>[Channel1]</group>
152 <key>reverse</key>
153- <description></description>
154 <options>
155 <normal/>
156 </options>
157@@ -172,7 +149,6 @@
158 <midino>0x5</midino>
159 <group>[Channel1]</group>
160 <key>loop_out</key>
161- <description></description>
162 <options>
163 <normal/>
164 </options>
165@@ -182,7 +158,6 @@
166 <midino>0x8</midino>
167 <group>[Channel1]</group>
168 <key>loop_double</key>
169- <description></description>
170 <options>
171 <normal/>
172 </options>
173@@ -192,7 +167,6 @@
174 <midino>0x1F</midino>
175 <group>[Channel1]</group>
176 <key>LoadSelectedTrack</key>
177- <description></description>
178 <options>
179 <normal/>
180 </options>
181@@ -202,7 +176,6 @@
182 <midino>0xa</midino>
183 <group>[Channel1]</group>
184 <key>hotcue_3_activate</key>
185- <description></description>
186 <options>
187 <normal/>
188 </options>
189@@ -212,7 +185,6 @@
190 <midino>0xb</midino>
191 <group>[Channel1]</group>
192 <key>loop_in</key>
193- <description></description>
194 <options>
195 <normal/>
196 </options>
197@@ -222,7 +194,6 @@
198 <midino>0x46</midino>
199 <group>[Channel1]</group>
200 <key>rate</key>
201- <description></description>
202 <options>
203 <normal/>
204 </options>
205@@ -232,7 +203,6 @@
206 <midino>0xe</midino>
207 <group>[Channel1]</group>
208 <key>loop_halve</key>
209- <description></description>
210 <options>
211 <normal/>
212 </options>
213@@ -242,7 +212,6 @@
214 <midino>0x10</midino>
215 <group>[Channel1]</group>
216 <key>hotcue_2_activate</key>
217- <description></description>
218 <options>
219 <normal/>
220 </options>
221@@ -252,7 +221,6 @@
222 <midino>0x11</midino>
223 <group>[Channel1]</group>
224 <key>back</key>
225- <description></description>
226 <options>
227 <normal/>
228 </options>
229@@ -262,7 +230,6 @@
230 <midino>0x12</midino>
231 <group>[Channel1]</group>
232 <key>beatsync</key>
233- <description></description>
234 <options>
235 <normal/>
236 </options>
237@@ -272,7 +239,6 @@
238 <midino>0x13</midino>
239 <group>[Channel1]</group>
240 <key>LoadSelectedTrack</key>
241- <description></description>
242 <options>
243 <normal/>
244 </options>
245@@ -282,7 +248,6 @@
246 <midino>0x16</midino>
247 <group>[Channel1]</group>
248 <key>hotcue_1_activate</key>
249- <description></description>
250 <options>
251 <normal/>
252 </options>
253@@ -292,7 +257,6 @@
254 <midino>0x17</midino>
255 <group>[Channel1]</group>
256 <key>reloop_exit</key>
257- <description></description>
258 <options>
259 <normal/>
260 </options>
261@@ -302,7 +266,6 @@
262 <midino>0x1d</midino>
263 <group>[Playlist]</group>
264 <key>SelectNextTrack</key>
265- <description></description>
266 <options>
267 <normal/>
268 </options>
269@@ -312,7 +275,6 @@
270 <midino>0x22</midino>
271 <group>[Channel1]</group>
272 <key>hotcue_4_activate</key>
273- <description></description>
274 <options>
275 <normal/>
276 </options>
277@@ -322,7 +284,6 @@
278 <midino>0x23</midino>
279 <group>[Channel1]</group>
280 <key>fwd</key>
281- <description></description>
282 <options>
283 <normal/>
284 </options>
285@@ -332,7 +293,6 @@
286 <midino>0x29</midino>
287 <group>[Playlist]</group>
288 <key>SelectPrevTrack</key>
289- <description></description>
290 <options>
291 <normal/>
292 </options>
293
294=== modified file 'mixxx/res/controllers/American Audio RADIUS 2000 CH2.midi.xml'
295--- mixxx/res/controllers/American Audio RADIUS 2000 CH2.midi.xml 2012-04-29 04:31:26 +0000
296+++ mixxx/res/controllers/American Audio RADIUS 2000 CH2.midi.xml 2012-08-08 11:20:30 +0000
297@@ -1,6 +1,8 @@
298 <MixxxMIDIPreset mixxxVersion="1.10.0-beta1+" schemaVersion="1">
299 <info>
300 <name>American Audio Radius 2000 CH2</name>
301+ <author>Markus Steinbauer</author>
302+ <description>American Audio Radius 2000 mapping for Deck 2</description>
303 </info>
304 <controller id="Radius 2000 MIDI 1">
305 <scriptfiles>
306@@ -12,7 +14,6 @@
307 <midino>0x38</midino>
308 <group>[Playlist]</group>
309 <key>RADIUS2000.trackSearch</key>
310- <description></description>
311 <options>
312 <Script-Binding/>
313 </options>
314@@ -22,7 +23,6 @@
315 <midino>0x36</midino>
316 <group>[Playlist]</group>
317 <key>RADIUS2000.menuSearch</key>
318- <description></description>
319 <options>
320 <Script-Binding/>
321 </options>
322@@ -32,7 +32,6 @@
323 <midino>0x30</midino>
324 <group>[Channel2]</group>
325 <key>RADIUS2000.cue</key>
326- <description></description>
327 <options>
328 <Script-Binding/>
329 </options>
330@@ -42,7 +41,6 @@
331 <midino>0x26</midino>
332 <group>[Channel2]</group>
333 <key>RADIUS2000.wheelTouch</key>
334- <description></description>
335 <options>
336 <Script-Binding/>
337 </options>
338@@ -52,7 +50,6 @@
339 <midino>0x35</midino>
340 <group>[Channel2]</group>
341 <key>RADIUS2000.wheelTurn</key>
342- <description></description>
343 <options>
344 <Script-Binding/>
345 </options>
346@@ -62,17 +59,6 @@
347 <midino>0x2a</midino>
348 <group>[Channel2]</group>
349 <key>RADIUS2000.play</key>
350- <description></description>
351- <options>
352- <Script-Binding/>
353- </options>
354- </control>
355- <control>
356- <status>0x90</status>
357- <midino>0x2a</midino>
358- <group>[Channel2]</group>
359- <key>RADIUS2000.play</key>
360- <description></description>
361 <options>
362 <Script-Binding/>
363 </options>
364@@ -82,7 +68,6 @@
365 <midino>0x06</midino>
366 <group>[Channel2]</group>
367 <key>RADIUS2000.keylock</key>
368- <description></description>
369 <options>
370 <Script-Binding/>
371 </options>
372@@ -92,7 +77,6 @@
373 <midino>0x0C</midino>
374 <group>[Channel2]</group>
375 <key>RADIUS2000.pitchRateRange</key>
376- <description></description>
377 <options>
378 <Script-Binding/>
379 </options>
380@@ -102,7 +86,6 @@
381 <midino>0x01</midino>
382 <group>[Channel2]</group>
383 <key>RADIUS2000.pitchRate</key>
384- <description></description>
385 <options>
386 <Script-Binding/>
387 </options>
388@@ -112,7 +95,6 @@
389 <midino>0x2D</midino>
390 <group>[Channel2]</group>
391 <key>RADIUS2000.flanger</key>
392- <description></description>
393 <options>
394 <Script-Binding/>
395 </options>
396@@ -122,7 +104,6 @@
397 <midino>0x18</midino>
398 <group>[Channel2]</group>
399 <key>RADIUS2000.flangerDelay</key>
400- <description></description>
401 <options>
402 <Script-Binding/>
403 </options>
404@@ -132,7 +113,6 @@
405 <midino>0x07</midino>
406 <group>[Channel2]</group>
407 <key>rate_temp_down</key>
408- <description></description>
409 <options>
410 <normal/>
411 </options>
412@@ -142,7 +122,6 @@
413 <midino>0x0D</midino>
414 <group>[Channel2]</group>
415 <key>rate_temp_up</key>
416- <description></description>
417 <options>
418 <normal/>
419 </options>
420@@ -152,7 +131,6 @@
421 <midino>0x2</midino>
422 <group>[Channel2]</group>
423 <key>beatloop_4</key>
424- <description></description>
425 <options>
426 <normal/>
427 </options>
428@@ -162,7 +140,6 @@
429 <midino>0x4</midino>
430 <group>[Channel2]</group>
431 <key>reverse</key>
432- <description></description>
433 <options>
434 <normal/>
435 </options>
436@@ -172,7 +149,6 @@
437 <midino>0x5</midino>
438 <group>[Channel2]</group>
439 <key>loop_out</key>
440- <description></description>
441 <options>
442 <normal/>
443 </options>
444@@ -182,7 +158,6 @@
445 <midino>0x8</midino>
446 <group>[Channel2]</group>
447 <key>loop_double</key>
448- <description></description>
449 <options>
450 <normal/>
451 </options>
452@@ -192,7 +167,6 @@
453 <midino>0x1F</midino>
454 <group>[Channel2]</group>
455 <key>LoadSelectedTrack</key>
456- <description></description>
457 <options>
458 <normal/>
459 </options>
460@@ -202,7 +176,6 @@
461 <midino>0xa</midino>
462 <group>[Channel2]</group>
463 <key>hotcue_3_activate</key>
464- <description></description>
465 <options>
466 <normal/>
467 </options>
468@@ -212,7 +185,6 @@
469 <midino>0xb</midino>
470 <group>[Channel2]</group>
471 <key>loop_in</key>
472- <description></description>
473 <options>
474 <normal/>
475 </options>
476@@ -222,7 +194,6 @@
477 <midino>0x46</midino>
478 <group>[Channel2]</group>
479 <key>rate</key>
480- <description></description>
481 <options>
482 <normal/>
483 </options>
484@@ -232,7 +203,6 @@
485 <midino>0xe</midino>
486 <group>[Channel2]</group>
487 <key>loop_halve</key>
488- <description></description>
489 <options>
490 <normal/>
491 </options>
492@@ -242,7 +212,6 @@
493 <midino>0x10</midino>
494 <group>[Channel2]</group>
495 <key>hotcue_2_activate</key>
496- <description></description>
497 <options>
498 <normal/>
499 </options>
500@@ -252,7 +221,6 @@
501 <midino>0x11</midino>
502 <group>[Channel2]</group>
503 <key>back</key>
504- <description></description>
505 <options>
506 <normal/>
507 </options>
508@@ -262,7 +230,6 @@
509 <midino>0x12</midino>
510 <group>[Channel2]</group>
511 <key>beatsync</key>
512- <description></description>
513 <options>
514 <normal/>
515 </options>
516@@ -272,7 +239,6 @@
517 <midino>0x13</midino>
518 <group>[Channel2]</group>
519 <key>LoadSelectedTrack</key>
520- <description></description>
521 <options>
522 <normal/>
523 </options>
524@@ -282,7 +248,6 @@
525 <midino>0x16</midino>
526 <group>[Channel2]</group>
527 <key>hotcue_1_activate</key>
528- <description></description>
529 <options>
530 <normal/>
531 </options>
532@@ -292,7 +257,6 @@
533 <midino>0x17</midino>
534 <group>[Channel2]</group>
535 <key>reloop_exit</key>
536- <description></description>
537 <options>
538 <normal/>
539 </options>
540@@ -302,7 +266,6 @@
541 <midino>0x1d</midino>
542 <group>[Playlist]</group>
543 <key>SelectNextTrack</key>
544- <description></description>
545 <options>
546 <normal/>
547 </options>
548@@ -312,7 +275,6 @@
549 <midino>0x22</midino>
550 <group>[Channel2]</group>
551 <key>hotcue_4_activate</key>
552- <description></description>
553 <options>
554 <normal/>
555 </options>
556@@ -322,7 +284,6 @@
557 <midino>0x23</midino>
558 <group>[Channel2]</group>
559 <key>fwd</key>
560- <description></description>
561 <options>
562 <normal/>
563 </options>
564@@ -332,7 +293,6 @@
565 <midino>0x29</midino>
566 <group>[Playlist]</group>
567 <key>SelectPrevTrack</key>
568- <description></description>
569 <options>
570 <normal/>
571 </options>
572
573=== modified file 'mixxx/res/controllers/Behringer BCD2000.midi.xml'
574--- mixxx/res/controllers/Behringer BCD2000.midi.xml 2012-07-06 06:58:20 +0000
575+++ mixxx/res/controllers/Behringer BCD2000.midi.xml 2012-08-08 11:20:30 +0000
576@@ -1,7 +1,8 @@
577 <MixxxMIDIPreset mixxxVersion="1.8.0+" schemaVersion="1">
578 <info>
579+ <name>Behringer BCD2000</name>
580 <author>Golzo</author>
581- <name>Behringer BCD2000</name>
582+ <description>MIDI mapping for Behringer BCD2000 mixer</description>
583 <forums>http://www.mixxx.org/forums/viewtopic.php?f=7&amp;t=3563</forums>
584 </info>
585 <controller id="BCD2000 MIDI 1">
586@@ -483,9 +484,6 @@
587 <output>
588 <group>[Channel2]</group>
589 <key>filterLowKill</key>
590- <options>
591- <normal/>
592- </options>
593 <minimum>0.5</minimum>
594 <maximum>1</maximum>
595 <status>0xb0</status>
596@@ -496,9 +494,6 @@
597 <output>
598 <group>[Channel1]</group>
599 <key>filterHighKill</key>
600- <options>
601- <normal/>
602- </options>
603 <minimum>0.5</minimum>
604 <maximum>1</maximum>
605 <status>0xb0</status>
606@@ -509,9 +504,6 @@
607 <output>
608 <group>[Channel2]</group>
609 <key>loop_enabled</key>
610- <options>
611- <normal/>
612- </options>
613 <minimum>0.5</minimum>
614 <maximum>1</maximum>
615 <status>0xb0</status>
616@@ -522,9 +514,6 @@
617 <output>
618 <group>[Channel1]</group>
619 <key>filterMidKill</key>
620- <options>
621- <normal/>
622- </options>
623 <minimum>0.5</minimum>
624 <maximum>1</maximum>
625 <status>0xb0</status>
626@@ -535,9 +524,6 @@
627 <output>
628 <group>[Channel1]</group>
629 <key>pfl</key>
630- <options>
631- <normal/>
632- </options>
633 <minimum>0.5</minimum>
634 <maximum>1</maximum>
635 <status>0xb0</status>
636@@ -548,9 +534,6 @@
637 <output>
638 <group>[Channel1]</group>
639 <key>cue_default</key>
640- <options>
641- <normal/>
642- </options>
643 <minimum>0.5</minimum>
644 <maximum>1</maximum>
645 <status>0xb0</status>
646@@ -561,9 +544,6 @@
647 <output>
648 <group>[Channel2]</group>
649 <key>pfl</key>
650- <options>
651- <normal/>
652- </options>
653 <minimum>0.5</minimum>
654 <maximum>1</maximum>
655 <status>0xb0</status>
656@@ -574,9 +554,6 @@
657 <output>
658 <group>[Channel2]</group>
659 <key>filterMidKill</key>
660- <options>
661- <normal/>
662- </options>
663 <minimum>0.5</minimum>
664 <maximum>1</maximum>
665 <status>0xb0</status>
666@@ -587,9 +564,6 @@
667 <output>
668 <group>[Channel2]</group>
669 <key>filterHighKill</key>
670- <options>
671- <normal/>
672- </options>
673 <minimum>0.5</minimum>
674 <maximum>1</maximum>
675 <status>0xb0</status>
676@@ -600,9 +574,6 @@
677 <output>
678 <group>[Channel2]</group>
679 <key>cue_default</key>
680- <options>
681- <normal/>
682- </options>
683 <minimum>0.5</minimum>
684 <maximum>1</maximum>
685 <status>0xb0</status>
686@@ -613,9 +584,6 @@
687 <output>
688 <group>[Channel2]</group>
689 <key>play</key>
690- <options>
691- <normal/>
692- </options>
693 <minimum>0.5</minimum>
694 <maximum>1</maximum>
695 <status>0xb0</status>
696@@ -626,9 +594,6 @@
697 <output>
698 <group>[Channel1]</group>
699 <key>filterLowKill</key>
700- <options>
701- <normal/>
702- </options>
703 <minimum>0.5</minimum>
704 <maximum>1</maximum>
705 <status>0xb0</status>
706@@ -639,9 +604,6 @@
707 <output>
708 <group>[Channel2]</group>
709 <key>flanger</key>
710- <options>
711- <normal/>
712- </options>
713 <minimum>0.5</minimum>
714 <maximum>1</maximum>
715 <status>0xb0</status>
716@@ -652,9 +614,6 @@
717 <output>
718 <group>[Channel1]</group>
719 <key>play</key>
720- <options>
721- <normal/>
722- </options>
723 <minimum>0.5</minimum>
724 <maximum>1</maximum>
725 <status>0xb0</status>
726@@ -665,9 +624,6 @@
727 <output>
728 <group>[Channel1]</group>
729 <key>loop_enabled</key>
730- <options>
731- <normal/>
732- </options>
733 <minimum>0.5</minimum>
734 <maximum>1</maximum>
735 <status>0xb0</status>
736@@ -678,9 +634,6 @@
737 <output>
738 <group>[Channel1]</group>
739 <key>flanger</key>
740- <options>
741- <normal/>
742- </options>
743 <minimum>0.5</minimum>
744 <maximum>1</maximum>
745 <status>0xb0</status>
746
747=== modified file 'mixxx/res/controllers/Behringer BCD3000.midi.xml'
748--- mixxx/res/controllers/Behringer BCD3000.midi.xml 2012-04-29 04:31:26 +0000
749+++ mixxx/res/controllers/Behringer BCD3000.midi.xml 2012-08-08 11:20:30 +0000
750@@ -1,6 +1,9 @@
751 <MixxxMIDIPreset mixxxVersion="1.8.0+" schemaVersion="1">
752 <info>
753 <name>Behringer BCD3000</name>
754+ <author>Aposto</author>
755+ <description>MIDI Mapping for Behringer BCD3000</description>
756+ <forums>http://mixxx.org/forums/viewtopic.php?f=3&amp;t=845</forums>
757 </info>
758 <controller id="BCD3000 MIDI 1">
759 <scriptfiles>
760
761=== modified file 'mixxx/res/controllers/DJ-Tech CDJ-101.midi.xml'
762--- mixxx/res/controllers/DJ-Tech CDJ-101.midi.xml 2012-05-23 06:13:23 +0000
763+++ mixxx/res/controllers/DJ-Tech CDJ-101.midi.xml 2012-08-08 11:20:30 +0000
764@@ -1,5 +1,5 @@
765 <?xml version='1.0' encoding='utf-8'?>
766-<MixxxControllerPreset schemaVersion="1">
767+<MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.11+">
768 <info>
769 <name>DJTech CDJ 101</name>
770 <author>zestoi</author>
771@@ -193,4 +193,4 @@
772 </controls>
773
774 </controller>
775-</MixxxControllerPreset>
776+</MixxxMIDIPreset>
777
778=== modified file 'mixxx/res/controllers/DJ-Tech DJM-101.midi.xml'
779--- mixxx/res/controllers/DJ-Tech DJM-101.midi.xml 2012-05-23 06:13:23 +0000
780+++ mixxx/res/controllers/DJ-Tech DJM-101.midi.xml 2012-08-08 11:20:30 +0000
781@@ -1,5 +1,5 @@
782 <?xml version='1.0' encoding='utf-8'?>
783-<MixxxControllerPreset schemaVersion="1">
784+<MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.11+">
785 <info>
786 <name>DJTech DJM 101</name>
787 <author>zestoi</author>
788@@ -201,4 +201,4 @@
789 </controls>
790 <outputs/>
791 </controller>
792-</MixxxControllerPreset>
793+</MixxxMIDIPreset>
794
795=== modified file 'mixxx/res/controllers/DJ-Tech i-Mix Reload.midi.xml'
796--- mixxx/res/controllers/DJ-Tech i-Mix Reload.midi.xml 2012-04-29 04:31:26 +0000
797+++ mixxx/res/controllers/DJ-Tech i-Mix Reload.midi.xml 2012-08-08 11:20:30 +0000
798@@ -1,6 +1,9 @@
799 <MixxxMIDIPreset mixxxVersion="1.8.0+" schemaVersion="1">
800 <info>
801 <name>DJ-Tech i-Mix Reload</name>
802+ <author>vininim</author>
803+ <description>MIDI mapping for DJ-Tech i-Mix Reload</description>
804+ <forums>http://mixxx.org/forums/viewtopic.php?f=7&amp;t=1637</forums>
805 </info>
806 <controller id="DJ-Tech i-Mix Reload">
807 <scriptfiles>
808
809=== modified file 'mixxx/res/controllers/DJTechTools MIDI Fighter.midi.xml'
810--- mixxx/res/controllers/DJTechTools MIDI Fighter.midi.xml 2012-05-05 12:59:57 +0000
811+++ mixxx/res/controllers/DJTechTools MIDI Fighter.midi.xml 2012-08-08 11:20:30 +0000
812@@ -3,7 +3,7 @@
813 <info>
814 <name>DJTechTools MIDIFighter</name>
815 <author>RJ Ryan</author>
816- <description></description>
817+ <description>Mapping for DJTechTools MIDIFighter Controller</description>
818 </info>
819 <controller id="DJTechTools MIDIFighter" port="">
820 <scriptfiles>
821
822=== modified file 'mixxx/res/controllers/Denon MC3000.midi.xml'
823--- mixxx/res/controllers/Denon MC3000.midi.xml 2012-06-02 17:16:41 +0000
824+++ mixxx/res/controllers/Denon MC3000.midi.xml 2012-08-08 11:20:30 +0000
825@@ -1030,7 +1030,7 @@
826 </options>
827 </control>
828
829- // AUTOLOOP BT
830+ <!-- AUTOLOOP BT -->
831 <control>
832 <status>0x90</status>
833 <midino>29</midino>
834
835=== modified file 'mixxx/res/controllers/EKS Otus.cntrlr.xml'
836--- mixxx/res/controllers/EKS Otus.cntrlr.xml 2012-07-21 02:05:08 +0000
837+++ mixxx/res/controllers/EKS Otus.cntrlr.xml 2012-08-08 11:20:30 +0000
838@@ -1,5 +1,5 @@
839 <?xml version="1.0" encoding="utf-8"?>
840-<MixxxControllerPreset schemaVersion="1">
841+<MixxxControllerPreset schemaVersion="1" mixxxVersion="1.11+">
842 <info>
843 <name>EKS Otus HID</name>
844 <author>Ilkka Tuohela</author>
845
846=== modified file 'mixxx/res/controllers/EKS-Otus.js'
847--- mixxx/res/controllers/EKS-Otus.js 2012-07-21 02:05:08 +0000
848+++ mixxx/res/controllers/EKS-Otus.js 2012-08-08 11:20:30 +0000
849@@ -29,7 +29,7 @@
850
851 packet = new HIDPacket("control",[0x0,0x35],64);
852 packet.addControl("hid","wheel_position",2,"H");
853- packet.addControl("hid","jog_wheel",4,"h");
854+ packet.addControl("hid","wheel_speed",4,"h");
855 packet.addControl("hid","timestamp",6,"I");
856 packet.addControl("hid","slider_value",10,"H");
857 packet.addControl("hid","slider_position",12,"H");
858@@ -85,7 +85,6 @@
859 packet.addControl("hid","touch_trackpad",46,"I",0x80000000);
860 packet.addControl("hid","packet_number",51,"B");
861 packet.addControl("hid","deck_status",52,"B");
862- packet.setMinDelta("hid","jog_wheel",4);
863 this.controller.registerInputPacket(packet);
864
865 packet = new HIDPacket("firmware_version",[0xa,0x4],64);
866@@ -124,9 +123,9 @@
867 packet.addOutput("hid","eject_left",offset++,"B");
868 packet.addOutput("hid","stop",offset++,"B");
869 packet.addOutput("hid","play",offset++,"B");
870+ packet.addOutput("hid","reverse",offset++,"B");
871+ packet.addOutput("hid","cue",offset++,"B");
872 packet.addOutput("hid","brake",offset++,"B");
873- packet.addOutput("hid","cue",offset++,"B");
874- packet.addOutput("hid","reverse",offset++,"B");
875 packet.addOutput("hid","fastforward",offset++,"B");
876 this.controller.registerOutputPacket(packet);
877
878@@ -319,6 +318,9 @@
879
880 EksOtus.deckSwitchClicked = false;
881
882+ // Wheel absolute position value
883+ EksOtus.wheelPosition = undefined;
884+
885 // Wheel spin animation details
886 EksOtus.activeTrackDuration = undefined;
887 // Group registered to update spinning platter details
888@@ -336,13 +338,13 @@
889 controller.setPacketCallback("trackpad_mode",EksOtus.TrackpadModeWrapper);
890
891 controller.ignoredControlChanges = [
892- "mask","timestamp","packet_number","deck_status", "wheel_position",
893+ "mask","timestamp","packet_number","deck_status", "wheel_speed",
894 // These return the Otus slider position scaled by the 'slider scale'
895 "slider_pos_1","slider_pos_2", "slider_value"
896 ];
897
898 // Scratch parameters
899- controller.scratchintervalsPerRev = 512;
900+ controller.scratchintervalsPerRev = 1024;
901 controller.scratchAlpha = 1.0/8;
902 controller.rampedScratchEnable = true;
903
904@@ -433,11 +435,10 @@
905
906 controller.linkControl("hid","play","deck","play");
907 controller.linkControl("hid","cue","deck","cue_default");
908+ controller.linkControl("hid","reverse","deck","reverse");
909 controller.linkControl("hid","eject_left","deck","pfl");
910 controller.linkControl("hid","jog_touch","deck","jog_touch");
911- controller.setScaler("jog",EksOtus.jogScaler);
912- controller.setScaler("jog_scratch",EksOtus.jogScratchScaler);
913- controller.linkControl("hid","jog_wheel","deck","jog_wheel");
914+ controller.linkControl("hid","wheel_position","deck","jog_wheel");
915
916 controller.linkControl("hid","jog_se_button","deck","LoadSelectedTrack");
917 controller.linkControl("hid","jog_se","[Playlist]","SelectTrackKnob");
918@@ -451,6 +452,9 @@
919 controller.linkControl("hid","eq_mid_2","deck2","filterMid");
920 controller.linkControl("hid","eq_low_1","deck1","filterLow");
921 controller.linkControl("hid","eq_low_2","deck2","filterLow");
922+
923+ controller.setScaler("jog",EksOtus.jogScaler);
924+ controller.setScaler("jog_scratch",EksOtus.wheelScaler);
925 controller.setScaler("crossfader",EksOtus.plusMinus1Scaler);
926 controller.setScaler("pregain",EksOtus.eqScaler);
927 controller.setScaler("filterHigh",EksOtus.eqScaler);
928@@ -492,24 +496,36 @@
929 controller.linkOutput("hid","reloop_exit","deck","reloop_exit",EksOtus.outputCallback);
930 controller.linkOutput("hid","eject_left","deck","pfl",EksOtus.outputCallback);
931 controller.linkOutput("hid","play","deck","play",EksOtus.outputCallback);
932+ controller.linkOutput("hid","reverse","deck","reverse",EksOtus.outputCallback);
933 controller.linkOutput("hid","cue","deck","cue_default",EksOtus.outputCallback);
934
935 }
936
937 // Default scaler for jog values
938+EksOtus.wheelScaler = function(group,name,value) {
939+ if (EksOtus.wheelPosition==undefined) {
940+ EksOtus.wheelPosition = value;
941+ return 0;
942+ }
943+ var delta = EksOtus.wheelPosition - value;
944+ if (delta>32768)
945+ return 0;
946+ EksOtus.wheelPosition = value;
947+ if (delta>-8 && delta<8)
948+ return -delta/4;
949+ return -delta/16;
950+}
951+
952 EksOtus.jogScaler = function(group,name,value) {
953- return value/256;
954-}
955-
956-// Jog wheel scratch event scaler
957-EksOtus.jogScratchScaler = function(group,name,value) {
958- var ticks = undefined;
959- if (value<8)
960- return value<0 ? -1 : 1;
961- if (value>128)
962- return value/64;
963- else
964- return value/32;
965+ if (EksOtus.wheelPosition==undefined) {
966+ EksOtus.wheelPosition = value;
967+ return 0;
968+ }
969+ var delta = EksOtus.wheelPosition - value;
970+ if (delta>32768)
971+ return 0;
972+ EksOtus.wheelPosition = value;
973+ return -delta/64;
974 }
975
976 // Deck rate adjustment with top corner wheels
977
978=== modified file 'mixxx/res/controllers/Evolution_Xsession.midi.xml'
979--- mixxx/res/controllers/Evolution_Xsession.midi.xml 2012-04-29 04:31:26 +0000
980+++ mixxx/res/controllers/Evolution_Xsession.midi.xml 2012-08-08 11:20:30 +0000
981@@ -2,8 +2,8 @@
982 <MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.6.2+">
983 <info>
984 <name>Evolution X-Session</name>
985- <author>Auto-converted by madjesta's PHP script</author>
986- <description>Automatic conversion of the file Evolution_Xsession.midi.xml for Mixxx 1.6.2</description>
987+ <author>Amias Channer</author>
988+ <description>MIDI Mapping for Evolution X-Session</description>
989 </info>
990 <controller id="Evolution Xsession" port="Port">
991 <controls>
992
993=== modified file 'mixxx/res/controllers/FaderFoxDJ2.midi.xml'
994--- mixxx/res/controllers/FaderFoxDJ2.midi.xml 2012-04-29 04:31:26 +0000
995+++ mixxx/res/controllers/FaderFoxDJ2.midi.xml 2012-08-08 11:20:30 +0000
996@@ -2,8 +2,8 @@
997 <MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.6.2+">
998 <info>
999 <name>FaderFox DJ2</name>
1000- <author>Auto-converted by madjesta's PHP script</author>
1001- <description>Automatic conversion of the file FaderFoxDJ2.midi.xml for Mixxx 1.6.2</description>
1002+ <author>Sacha Berger</author>
1003+ <description>MIDI Mapping for FaderFoxDJ2</description>
1004 </info>
1005 <controller id="FaderFoxDJ2" port="Port">
1006 <controls>
1007@@ -57,7 +57,7 @@
1008 <options>
1009
1010 </options>
1011- <sensitivity>700</sensitivity>
1012+ <!-- Not a valid mixxx 1.11 control <sensitivity>700</sensitivity> -->
1013 </control>
1014 <control>
1015 <group>[Channel1]</group>
1016@@ -241,7 +241,7 @@
1017 <options>
1018
1019 </options>
1020- <sensitivity>700</sensitivity>
1021+ <!-- Not a valid mixxx 1.11 control <sensitivity>700</sensitivity> -->
1022 </control>
1023 <control>
1024 <group>[Channel2]</group>
1025
1026=== modified file 'mixxx/res/controllers/HID Keyboard.cntrlr.xml.example'
1027--- mixxx/res/controllers/HID Keyboard.cntrlr.xml.example 2012-07-21 02:05:08 +0000
1028+++ mixxx/res/controllers/HID Keyboard.cntrlr.xml.example 2012-08-08 11:20:30 +0000
1029@@ -1,5 +1,5 @@
1030 <?xml version="1.0" encoding="utf-8"?>
1031-<MixxxControllerPreset schemaVersion="1">
1032+<MixxxControllerPreset schemaVersion="1" mixxxVersion="1.11+">
1033 <info>
1034 <name>Apple Bluetooth Keyboard</name>
1035 <author>Ilkka Tuohela</author>
1036
1037=== modified file 'mixxx/res/controllers/HID Trackpad.cntrlr.xml.example'
1038--- mixxx/res/controllers/HID Trackpad.cntrlr.xml.example 2012-07-21 02:05:08 +0000
1039+++ mixxx/res/controllers/HID Trackpad.cntrlr.xml.example 2012-08-08 11:20:30 +0000
1040@@ -1,5 +1,5 @@
1041 <?xml version="1.0" encoding="utf-8"?>
1042-<MixxxControllerPreset schemaVersion="1">
1043+<MixxxControllerPreset schemaVersion="1" mixxxVersion="1.11+">
1044 <info>
1045 <name>Apple Bluetooth Trackpad</name>
1046 <author>Ilkka Tuohela</author>
1047
1048=== modified file 'mixxx/res/controllers/Hercules DJ Console 4-Mx.midi.xml'
1049--- mixxx/res/controllers/Hercules DJ Console 4-Mx.midi.xml 2012-06-02 17:29:27 +0000
1050+++ mixxx/res/controllers/Hercules DJ Console 4-Mx.midi.xml 2012-08-08 11:20:30 +0000
1051@@ -1,7 +1,8 @@
1052 <MixxxMIDIPreset mixxxVersion="1.10.0+" schemaVersion="1">
1053 <info>
1054+ <name>Hercules DJ Console 4-Mx</name>
1055 <author>deusdiabolus</author>
1056- <name>Hercules DJ Console 4-Mx</name>
1057+ <description>Mapping for Hercules DJ Console 4-Mx</description>
1058 </info>
1059 <controller id="DJ Console 4-Mx MIDI">
1060 <scriptfiles>
1061
1062=== modified file 'mixxx/res/controllers/Hercules DJ Console Mac Edition.midi.xml'
1063--- mixxx/res/controllers/Hercules DJ Console Mac Edition.midi.xml 2012-04-29 04:31:26 +0000
1064+++ mixxx/res/controllers/Hercules DJ Console Mac Edition.midi.xml 2012-08-08 11:20:30 +0000
1065@@ -2,8 +2,8 @@
1066 <MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.6.2+">
1067 <info>
1068 <name>Hercules DJ Console Mac Edition</name>
1069- <author>Auto-converted by madjesta's PHP script</author>
1070- <description>Automatic conversion of the file Hercules DJ Console Mac Edition.midi.xml for Mixxx 1.6.2</description>
1071+ <author>Daniel Svensson</author>
1072+ <description>MIDI Mapping for Hercules DJ Console (Mac Edition)</description>
1073 </info>
1074 <controller id="Hercules DJ Console Mac Edition" port="Port">
1075 <controls>
1076
1077=== modified file 'mixxx/res/controllers/Hercules DJ Console Mk2.cntrlr.xml'
1078--- mixxx/res/controllers/Hercules DJ Console Mk2.cntrlr.xml 2012-05-23 06:13:23 +0000
1079+++ mixxx/res/controllers/Hercules DJ Console Mk2.cntrlr.xml 2012-08-08 11:20:30 +0000
1080@@ -1,5 +1,5 @@
1081 <?xml version="1.0" encoding="utf-8"?>
1082-<MixxxControllerPreset schemaVersion="1">
1083+<MixxxControllerPreset schemaVersion="1" mixxxVersion="1.11+">
1084 <info>
1085 <name>Hercules DJ Console MK2 HID</name>
1086 <author>zestoi</author>
1087
1088=== modified file 'mixxx/res/controllers/Hercules DJ Console Mk4.midi.xml'
1089--- mixxx/res/controllers/Hercules DJ Console Mk4.midi.xml 2011-11-19 20:16:57 +0000
1090+++ mixxx/res/controllers/Hercules DJ Console Mk4.midi.xml 2012-08-08 11:20:30 +0000
1091@@ -317,15 +317,6 @@
1092 </options>
1093 </control>
1094 <control>
1095- <status>0x90</status>
1096- <midino>0xf</midino>
1097- <group>[Channel1]</group>
1098- <key>play</key>
1099- <options>
1100- <Button/>
1101- </options>
1102- </control>
1103- <control>
1104 <status>0xb0</status>
1105 <midino>0x38</midino>
1106 <group>[Master]</group>
1107@@ -390,24 +381,6 @@
1108 </control>
1109 <control>
1110 <status>0x90</status>
1111- <midino>0xd</midino>
1112- <group>[Channel1]</group>
1113- <key>fwd</key>
1114- <options>
1115- <Button/>
1116- </options>
1117- </control>
1118- <control>
1119- <status>0x90</status>
1120- <midino>0x0E</midino>
1121- <group>[Channel1]</group>
1122- <key>HerculesMk4.cue</key>
1123- <options>
1124- <Script-Binding/>
1125- </options>
1126- </control>
1127- <control>
1128- <status>0x90</status>
1129 <midino>0x22</midino>
1130 <group>[Channel2]</group>
1131 <key>HerculesMk4.cue</key>
1132@@ -498,24 +471,6 @@
1133 </control>
1134 <control>
1135 <status>0x90</status>
1136- <midino>0x21</midino>
1137- <group>[Channel2]</group>
1138- <key>fwd</key>
1139- <options>
1140- <Button/>
1141- </options>
1142- </control>
1143- <control>
1144- <status>0x90</status>
1145- <midino>0x23</midino>
1146- <group>[Channel2]</group>
1147- <key>play</key>
1148- <options>
1149- <Button/>
1150- </options>
1151- </control>
1152- <control>
1153- <status>0x90</status>
1154 <midino>0x24</midino>
1155 <group>[Channel2]</group>
1156 <key>HerculesMk4.pfl</key>
1157
1158=== modified file 'mixxx/res/controllers/Hercules DJ Control AIR.midi.xml'
1159--- mixxx/res/controllers/Hercules DJ Control AIR.midi.xml 2012-07-06 06:58:20 +0000
1160+++ mixxx/res/controllers/Hercules DJ Control AIR.midi.xml 2012-08-08 11:20:30 +0000
1161@@ -1,7 +1,8 @@
1162 <MixxxMIDIPreset mixxxVersion="1.10.0+" schemaVersion="1">
1163 <info>
1164+ <name>Hercules DJ Control AIR</name>
1165 <author>rojaro</author>
1166- <name>Hercules DJ Control AIR</name>
1167+ <description>Mapping for Hercules DJ Control AIR</description>
1168 <forums>http://www.mixxx.org/forums/viewtopic.php?f=7&amp;t=3263</forums>
1169 </info>
1170 <controller id="DJ Control Air">
1171
1172=== modified file 'mixxx/res/controllers/Hercules DJ Control MP3 e2.midi.xml'
1173--- mixxx/res/controllers/Hercules DJ Control MP3 e2.midi.xml 2012-06-22 04:32:53 +0000
1174+++ mixxx/res/controllers/Hercules DJ Control MP3 e2.midi.xml 2012-08-08 11:20:30 +0000
1175@@ -281,15 +281,6 @@
1176 </options>
1177 </control>
1178 <control>
1179- <status>0x90</status>
1180- <midino>0xd</midino>
1181- <group>[Channel1]</group>
1182- <key>fwd</key>
1183- <options>
1184- <Button/>
1185- </options>
1186- </control>
1187- <control>
1188 <status>0xb0</status>
1189 <midino>0x36</midino>
1190 <group>[Channel1]</group>
1191@@ -335,15 +326,6 @@
1192 </options>
1193 </control>
1194 <control>
1195- <status>0x90</status>
1196- <midino>0x10</midino>
1197- <group>[Channel1]</group>
1198- <key>pfl</key>
1199- <options>
1200- <Button/>
1201- </options>
1202- </control>
1203- <control>
1204 <status>0xb0</status>
1205 <midino>0x39</midino>
1206 <group>[Channel2]</group>
1207@@ -399,15 +381,6 @@
1208 </control>
1209 <control>
1210 <status>0x90</status>
1211- <midino>0x0E</midino>
1212- <group>[Channel1]</group>
1213- <key>HerculesMP3e2.cue</key>
1214- <options>
1215- <Script-Binding/>
1216- </options>
1217- </control>
1218- <control>
1219- <status>0x90</status>
1220 <midino>0x22</midino>
1221 <group>[Channel2]</group>
1222 <key>HerculesMP3e2.cue</key>
1223@@ -435,15 +408,6 @@
1224 </control>
1225 <control>
1226 <status>0x90</status>
1227- <midino>0xf</midino>
1228- <group>[Channel1]</group>
1229- <key>play</key>
1230- <options>
1231- <Button/>
1232- </options>
1233- </control>
1234- <control>
1235- <status>0x90</status>
1236 <midino>0x10</midino>
1237 <group>[Channel1]</group>
1238 <key>pfl</key>
1239@@ -489,33 +453,6 @@
1240 </control>
1241 <control>
1242 <status>0x90</status>
1243- <midino>0x21</midino>
1244- <group>[Channel2]</group>
1245- <key>fwd</key>
1246- <options>
1247- <Button/>
1248- </options>
1249- </control>
1250- <control>
1251- <status>0x90</status>
1252- <midino>0x23</midino>
1253- <group>[Channel2]</group>
1254- <key>play</key>
1255- <options>
1256- <Button/>
1257- </options>
1258- </control>
1259- <control>
1260- <status>0x90</status>
1261- <midino>0x24</midino>
1262- <group>[Channel2]</group>
1263- <key>pfl</key>
1264- <options>
1265- <Button/>
1266- </options>
1267- </control>
1268- <control>
1269- <status>0x90</status>
1270 <midino>0x20</midino>
1271 <group>[Channel2]</group>
1272 <key>back</key>
1273@@ -541,7 +478,6 @@
1274 <Button/>
1275 </options>
1276 </control>
1277-
1278 <control>
1279 <status>0x90</status>
1280 <midino>0x24</midino>
1281
1282=== modified file 'mixxx/res/controllers/M-Audio_Xponent.midi.xml'
1283--- mixxx/res/controllers/M-Audio_Xponent.midi.xml 2012-04-29 04:31:26 +0000
1284+++ mixxx/res/controllers/M-Audio_Xponent.midi.xml 2012-08-08 11:20:30 +0000
1285@@ -1,11 +1,11 @@
1286 <?xml version="1.0" encoding="utf-8"?>
1287 <MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.8+">
1288-<info><!-- Optional - information about the preset file -->
1289- <name>M-Audio Xponent</name>
1290- <author>Luca Franceschini, Juan Pedro Bolívar Puente</author>
1291- <description>This is a midi present of Xponent.</description>
1292- <deviceid>Xponent Port 1</deviceid>
1293- <deviceid>Xponent Port 2</deviceid>
1294+<info>
1295+ <name>M-Audio Xponent</name>
1296+ <author>Luca Franceschini, Juan Pedro Bolívar Puente</author>
1297+ <description>This is a midi present of Xponent.</description>
1298+ <!-- These comments are not suppported by mixxx hile 2012-08-06 -->
1299+ <!-- <deviceid>Xponent Port 1</deviceid><deviceid>Xponent Port 2</deviceid> -->
1300 </info>
1301 <controller id="Xponent Port 1">
1302 <scriptfiles>
1303@@ -17,14 +17,14 @@
1304 <key>crossfader</key>
1305 <status>0xB2</status>
1306 <midino>7</midino>
1307- <controltype>fader</controltype>
1308+ <description>fader</description>
1309 </control>
1310 <control>
1311 <group>[Master]</group>
1312 <key>headMix</key>
1313 <status>0xB2</status>
1314 <midino>13</midino>
1315- <controltype>fader</controltype>
1316+ <description>fader</description>
1317 </control>
1318 <control>
1319 <group>[Channel1]</group>
1320@@ -58,7 +58,7 @@
1321 <key>play</key>
1322 <status>0x80</status>
1323 <midino>36</midino>
1324- <controltype>button</controltype>
1325+ <description>button</description>
1326 </control>
1327 <control>
1328 <group>[Channel1]</group>
1329@@ -128,7 +128,7 @@
1330 <key>volume</key>
1331 <status>0xB0</status>
1332 <midino>7</midino>
1333- <controltype>fader</controltype>
1334+ <description>fader</description>
1335 </control>
1336 <control>
1337 <group>[Channel1]</group>
1338@@ -180,28 +180,28 @@
1339 <key>pregain</key>
1340 <status>0xB0</status>
1341 <midino>11</midino>
1342- <controltype>fader</controltype>
1343+ <description>fader</description>
1344 </control>
1345 <control>
1346 <group>[Channel1]</group>
1347 <key>filterLow</key>
1348 <status>0xB0</status>
1349 <midino>8</midino>
1350- <controltype>fader</controltype>
1351+ <description>fader</description>
1352 </control>
1353 <control>
1354 <group>[Channel1]</group>
1355 <key>filterMid</key>
1356 <status>0xB0</status>
1357 <midino>9</midino>
1358- <controltype>fader</controltype>
1359+ <description>fader</description>
1360 </control>
1361 <control>
1362 <group>[Channel1]</group>
1363 <key>filterHigh</key>
1364 <status>0xB0</status>
1365 <midino>10</midino>
1366- <controltype>fader</controltype>
1367+ <description>fader</description>
1368 </control>
1369 <control>
1370 <group>[Channel1]</group>
1371@@ -217,7 +217,7 @@
1372 <key>filterLowKill</key>
1373 <status>0x80</status>
1374 <midino>8</midino>
1375- <controltype>button</controltype>
1376+ <description>button</description>
1377 </control>
1378 <control>
1379 <group>[Channel1]</group>
1380@@ -233,7 +233,7 @@
1381 <key>filterMidKill</key>
1382 <status>0x80</status>
1383 <midino>9</midino>
1384- <controltype>button</controltype>
1385+ <description>button</description>
1386 </control>
1387 <control>
1388 <group>[Channel1]</group>
1389@@ -249,49 +249,49 @@
1390 <key>filterHighKill</key>
1391 <status>0x80</status>
1392 <midino>10</midino>
1393- <controltype>button</controltype>
1394- </control>
1395- <control>
1396- <group>[Channel1]</group>
1397- <key>rate_temp_up</key>
1398- <status>0x90</status>
1399- <midino>16</midino>
1400- <controltype>button</controltype>
1401- </control>
1402- <control>
1403- <group>[Channel1]</group>
1404- <key>rate_temp_up</key>
1405- <status>0x80</status>
1406- <midino>16</midino>
1407- <controltype>button</controltype>
1408- </control>
1409- <control>
1410- <group>[Channel1]</group>
1411- <key>rate_temp_down</key>
1412- <status>0x90</status>
1413- <midino>17</midino>
1414- <controltype>button</controltype>
1415- </control>
1416- <control>
1417- <group>[Channel1]</group>
1418- <key>rate_temp_down</key>
1419- <status>0x80</status>
1420- <midino>17</midino>
1421- <controltype>button</controltype>
1422- </control>
1423- <control>
1424- <group>[Channel1]</group>
1425- <key>beatsync</key>
1426- <status>0x90</status>
1427- <midino>2</midino>
1428- <controltype>button</controltype>
1429- </control>
1430- <control>
1431- <group>[Channel1]</group>
1432- <key>beatsync</key>
1433- <status>0x80</status>
1434- <midino>2</midino>
1435- <controltype>button</controltype>
1436+ <description>button</description>
1437+ </control>
1438+ <control>
1439+ <group>[Channel1]</group>
1440+ <key>rate_temp_up</key>
1441+ <status>0x90</status>
1442+ <midino>16</midino>
1443+ <description>button</description>
1444+ </control>
1445+ <control>
1446+ <group>[Channel1]</group>
1447+ <key>rate_temp_up</key>
1448+ <status>0x80</status>
1449+ <midino>16</midino>
1450+ <description>button</description>
1451+ </control>
1452+ <control>
1453+ <group>[Channel1]</group>
1454+ <key>rate_temp_down</key>
1455+ <status>0x90</status>
1456+ <midino>17</midino>
1457+ <description>button</description>
1458+ </control>
1459+ <control>
1460+ <group>[Channel1]</group>
1461+ <key>rate_temp_down</key>
1462+ <status>0x80</status>
1463+ <midino>17</midino>
1464+ <description>button</description>
1465+ </control>
1466+ <control>
1467+ <group>[Channel1]</group>
1468+ <key>beatsync</key>
1469+ <status>0x90</status>
1470+ <midino>2</midino>
1471+ <description>button</description>
1472+ </control>
1473+ <control>
1474+ <group>[Channel1]</group>
1475+ <key>beatsync</key>
1476+ <status>0x80</status>
1477+ <midino>2</midino>
1478+ <description>button</description>
1479 </control>
1480 <control>
1481 <group>[Channel1]</group>
1482@@ -532,7 +532,7 @@
1483 <key>play</key>
1484 <status>0x81</status>
1485 <midino>36</midino>
1486- <controltype>button</controltype>
1487+ <description>button</description>
1488 </control>
1489 <control>
1490 <group>[Channel2]</group>
1491@@ -602,7 +602,7 @@
1492 <key>volume</key>
1493 <status>0xB1</status>
1494 <midino>7</midino>
1495- <controltype>fader</controltype>
1496+ <description>fader</description>
1497 </control>
1498 <control>
1499 <group>[Channel2]</group>
1500@@ -654,28 +654,28 @@
1501 <key>pregain</key>
1502 <status>0xB1</status>
1503 <midino>11</midino>
1504- <controltype>fader</controltype>
1505+ <description>fader</description>
1506 </control>
1507 <control>
1508 <group>[Channel2]</group>
1509 <key>filterLow</key>
1510 <status>0xB1</status>
1511 <midino>8</midino>
1512- <controltype>fader</controltype>
1513+ <description>fader</description>
1514 </control>
1515 <control>
1516 <group>[Channel2]</group>
1517 <key>filterMid</key>
1518 <status>0xB1</status>
1519 <midino>9</midino>
1520- <controltype>fader</controltype>
1521+ <description>fader</description>
1522 </control>
1523 <control>
1524 <group>[Channel2]</group>
1525 <key>filterHigh</key>
1526 <status>0xB1</status>
1527 <midino>10</midino>
1528- <controltype>fader</controltype>
1529+ <description>fader</description>
1530 </control>
1531 <control>
1532 <group>[Channel2]</group>
1533@@ -691,7 +691,7 @@
1534 <key>filterLowKill</key>
1535 <status>0x81</status>
1536 <midino>8</midino>
1537- <controltype>button</controltype>
1538+ <description>button</description>
1539 </control>
1540 <control>
1541 <group>[Channel2]</group>
1542@@ -707,7 +707,7 @@
1543 <key>filterMidKill</key>
1544 <status>0x81</status>
1545 <midino>9</midino>
1546- <controltype>button</controltype>
1547+ <description>button</description>
1548 </control>
1549 <control>
1550 <group>[Channel2]</group>
1551@@ -723,49 +723,49 @@
1552 <key>filterHighKill</key>
1553 <status>0x81</status>
1554 <midino>10</midino>
1555- <controltype>button</controltype>
1556- </control>
1557- <control>
1558- <group>[Channel2]</group>
1559- <key>rate_temp_up</key>
1560- <status>0x91</status>
1561- <midino>16</midino>
1562- <controltype>button</controltype>
1563- </control>
1564- <control>
1565- <group>[Channel2]</group>
1566- <key>rate_temp_up</key>
1567- <status>0x81</status>
1568- <midino>16</midino>
1569- <controltype>button</controltype>
1570- </control>
1571- <control>
1572- <group>[Channel2]</group>
1573- <key>rate_temp_down</key>
1574- <status>0x91</status>
1575- <midino>17</midino>
1576- <controltype>button</controltype>
1577- </control>
1578- <control>
1579- <group>[Channel2]</group>
1580- <key>rate_temp_down</key>
1581- <status>0x81</status>
1582- <midino>17</midino>
1583- <controltype>button</controltype>
1584- </control>
1585- <control>
1586- <group>[Channel2]</group>
1587- <key>beatsync</key>
1588- <status>0x91</status>
1589- <midino>2</midino>
1590- <controltype>button</controltype>
1591- </control>
1592- <control>
1593- <group>[Channel2]</group>
1594- <key>beatsync</key>
1595- <status>0x81</status>
1596- <midino>2</midino>
1597- <controltype>button</controltype>
1598+ <description>button</description>
1599+ </control>
1600+ <control>
1601+ <group>[Channel2]</group>
1602+ <key>rate_temp_up</key>
1603+ <status>0x91</status>
1604+ <midino>16</midino>
1605+ <description>button</description>
1606+ </control>
1607+ <control>
1608+ <group>[Channel2]</group>
1609+ <key>rate_temp_up</key>
1610+ <status>0x81</status>
1611+ <midino>16</midino>
1612+ <description>button</description>
1613+ </control>
1614+ <control>
1615+ <group>[Channel2]</group>
1616+ <key>rate_temp_down</key>
1617+ <status>0x91</status>
1618+ <midino>17</midino>
1619+ <description>button</description>
1620+ </control>
1621+ <control>
1622+ <group>[Channel2]</group>
1623+ <key>rate_temp_down</key>
1624+ <status>0x81</status>
1625+ <midino>17</midino>
1626+ <description>button</description>
1627+ </control>
1628+ <control>
1629+ <group>[Channel2]</group>
1630+ <key>beatsync</key>
1631+ <status>0x91</status>
1632+ <midino>2</midino>
1633+ <description>button</description>
1634+ </control>
1635+ <control>
1636+ <group>[Channel2]</group>
1637+ <key>beatsync</key>
1638+ <status>0x81</status>
1639+ <midino>2</midino>
1640+ <description>button</description>
1641 </control>
1642 <control>
1643 <group>[Channel2]</group>
1644@@ -880,21 +880,21 @@
1645 <key>lfoDepth</key>
1646 <status>0xB1</status>
1647 <midino>12</midino>
1648- <controltype>fader</controltype>
1649+ <description>fader</description>
1650 </control>
1651 <control>
1652 <group>[Flanger]</group>
1653 <key>lfoDelay</key>
1654 <status>0xB1</status>
1655 <midino>13</midino>
1656- <controltype>fader</controltype>
1657+ <description>fader</description>
1658 </control>
1659 <control>
1660 <group>[Flanger]</group>
1661 <key>lfoPeriod</key>
1662 <status>0xB1</status>
1663 <midino>14</midino>
1664- <controltype>fader</controltype>
1665+ <description>fader</description>
1666 </control>
1667 <control>
1668 <group>[Channel2]</group>
1669
1670=== modified file 'mixxx/res/controllers/M-Audio_Xsession_pro.midi.xml'
1671--- mixxx/res/controllers/M-Audio_Xsession_pro.midi.xml 2012-04-29 04:31:26 +0000
1672+++ mixxx/res/controllers/M-Audio_Xsession_pro.midi.xml 2012-08-08 11:20:30 +0000
1673@@ -2,8 +2,8 @@
1674 <MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.6.2+">
1675 <info>
1676 <name>M-Audio X-Session Pro</name>
1677- <author>Auto-converted by madjesta's PHP script</author>
1678- <description>Automatic conversion of the file M-Audio_Xsession_pro.midi.xml for Mixxx 1.6.2</description>
1679+ <author>Karli</author>
1680+ <description>MIDI Mapping for M-Audio X-Session Pro</description>
1681 </info>
1682 <controller id="M-Audio Xsession pro" port="Port">
1683 <controls>
1684
1685=== modified file 'mixxx/res/controllers/Midi-Keyboard.midi.xml'
1686--- mixxx/res/controllers/Midi-Keyboard.midi.xml 2012-04-29 04:31:26 +0000
1687+++ mixxx/res/controllers/Midi-Keyboard.midi.xml 2012-08-08 11:20:30 +0000
1688@@ -2,8 +2,8 @@
1689 <MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.6.2+">
1690 <info>
1691 <name>MIDI Keyboard</name>
1692- <author>Auto-converted by madjesta's PHP script</author>
1693- <description>Automatic conversion of the file Midi-Keyboard.midi.xml for Mixxx 1.6.2</description>
1694+ <author></author>
1695+ <description>Generic MIDI Keyboard Mapping</description>
1696 </info>
1697 <controller id="Midi-Keyboard" port="Port">
1698 <controls>
1699
1700=== modified file 'mixxx/res/controllers/MidiTech-MidiControl.midi.xml'
1701--- mixxx/res/controllers/MidiTech-MidiControl.midi.xml 2012-04-29 04:31:26 +0000
1702+++ mixxx/res/controllers/MidiTech-MidiControl.midi.xml 2012-08-08 11:20:30 +0000
1703@@ -2,8 +2,8 @@
1704 <MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.6.2+">
1705 <info>
1706 <name>MidiTech MidiControl</name>
1707- <author>Auto-converted by madjesta's PHP script</author>
1708- <description>Automatic conversion of the file MidiTech-MidiControl.midi.xml for Mixxx 1.6.2</description>
1709+ <author></author>
1710+ <description>MIDI Mapping for MidiTech MidiControl</description>
1711 </info>
1712 <controller id="MidiTech-MidiControl" port="Port">
1713 <controls>
1714
1715=== modified file 'mixxx/res/controllers/Mixman DM2 (OS X).midi.xml'
1716--- mixxx/res/controllers/Mixman DM2 (OS X).midi.xml 2012-04-29 04:31:26 +0000
1717+++ mixxx/res/controllers/Mixman DM2 (OS X).midi.xml 2012-08-08 11:20:30 +0000
1718@@ -1,6 +1,8 @@
1719 <MixxxMIDIPreset mixxxVersion="1.7.0-beta1+" schemaVersion="1" >
1720 <info>
1721 <name>Mixman DM2 (OS X)</name>
1722+ <author>Joe M.</author>
1723+ <description>MIDI Mapping for Mixman DM2 (OS/X Version)</description>
1724 </info>
1725 <controller id="Mixman DM2" >
1726 <scriptfiles>
1727
1728=== modified file 'mixxx/res/controllers/Mixman DM2 (Windows).midi.xml'
1729--- mixxx/res/controllers/Mixman DM2 (Windows).midi.xml 2012-04-29 04:31:26 +0000
1730+++ mixxx/res/controllers/Mixman DM2 (Windows).midi.xml 2012-08-08 11:20:30 +0000
1731@@ -2,8 +2,8 @@
1732 <MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.6.2+">
1733 <info>
1734 <name>Mixman DM2 (Windows)</name>
1735- <author>Auto-converted by madjesta's PHP script</author>
1736- <description>Automatic conversion of the file Mixman DM2 (Windows).midi.xml for Mixxx 1.6.2</description>
1737+ <author>Joe M.</author>
1738+ <description>MIDI Mapping for Mixman DM2 (Windows)</description>
1739 </info>
1740 <controller id="Mixman DM2 (Windows)" port="Port">
1741 <controls>
1742
1743=== modified file 'mixxx/res/controllers/Nintendo Wiimote.cntrlr.xml'
1744--- mixxx/res/controllers/Nintendo Wiimote.cntrlr.xml 2012-07-23 16:38:18 +0000
1745+++ mixxx/res/controllers/Nintendo Wiimote.cntrlr.xml 2012-08-08 11:20:30 +0000
1746@@ -1,5 +1,4 @@
1747-<?xml version="1.0" encoding="utf-8"?>
1748-<MixxxControllerPreset schemaVersion="1">
1749+<MixxxControllerPreset schemaVersion="1" mixxxVersion="1.11+">
1750 <info>
1751 <name>Nintendo Wii Remote</name>
1752 <author>Ilkka Tuohela</author>
1753
1754=== modified file 'mixxx/res/controllers/Novation Launchpad.midi.xml'
1755--- mixxx/res/controllers/Novation Launchpad.midi.xml 2012-05-31 06:38:14 +0000
1756+++ mixxx/res/controllers/Novation Launchpad.midi.xml 2012-08-08 11:20:30 +0000
1757@@ -1,5 +1,5 @@
1758 <?xml version='1.0' encoding='utf-8'?>
1759-<MixxxControllerPreset schemaVersion="1">
1760+<MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.11+">
1761 <info>
1762 <name>Novation Launchpad</name>
1763 <author>zestoi</author>
1764@@ -733,4 +733,4 @@
1765 </controls>
1766 <outputs/>
1767 </controller>
1768-</MixxxControllerPreset>
1769+</MixxxMIDIPreset>
1770
1771=== modified file 'mixxx/res/controllers/Numark DJ2Go.midi.xml'
1772--- mixxx/res/controllers/Numark DJ2Go.midi.xml 2012-06-02 17:46:53 +0000
1773+++ mixxx/res/controllers/Numark DJ2Go.midi.xml 2012-08-08 11:20:30 +0000
1774@@ -3,8 +3,8 @@
1775 <MixxxMIDIPreset mixxxVersion="1.8.1+" schemaVersion="1">
1776 <info>
1777 <name>Numark DJ2Go</name>
1778- <version>0.1</version>
1779 <author>Jeff Mission (beatfixstudios@gmail.com)</author>
1780+ <description>MIDI mapping for Numark DJ2Go Controller</description>
1781 </info>
1782 <controller id="Numark DJ2Go MIDI 1">
1783 <scriptfiles>
1784@@ -375,19 +375,6 @@
1785 <on>0x0</on>
1786 <off>0x64</off>
1787 </output>
1788- <output>
1789- <group>[Channel1]</group>
1790- <key>filterLowKill</key>
1791- <options>
1792- <normal/>
1793- </options>
1794- <minimum>0</minimum>
1795- <maximum>0.1</maximum>
1796- <status>0x90</status>
1797- <midino>0x5a</midino>
1798- <on>0x0</on>
1799- <off>0x64</off>
1800- </output>
1801
1802 <output>
1803 <group>[Channel1]</group>
1804
1805=== modified file 'mixxx/res/controllers/Numark MIXTRACK.midi.xml'
1806--- mixxx/res/controllers/Numark MIXTRACK.midi.xml 2012-06-02 17:43:21 +0000
1807+++ mixxx/res/controllers/Numark MIXTRACK.midi.xml 2012-08-08 11:20:30 +0000
1808@@ -657,19 +657,6 @@
1809 </output>
1810 <output>
1811 <group>[Channel1]</group>
1812- <key>filterLowKill</key>
1813- <options>
1814- <normal/>
1815- </options>
1816- <minimum>0</minimum>
1817- <maximum>0.1</maximum>
1818- <status>0x90</status>
1819- <midino>0x5a</midino>
1820- <on>0x0</on>
1821- <off>0x64</off>
1822- </output>
1823- <output>
1824- <group>[Channel1]</group>
1825 <key>filterMidKill</key>
1826 <options>
1827 <normal/>
1828
1829=== modified file 'mixxx/res/controllers/Numark Mixtrack Pro.midi.xml'
1830--- mixxx/res/controllers/Numark Mixtrack Pro.midi.xml 2012-06-02 17:24:19 +0000
1831+++ mixxx/res/controllers/Numark Mixtrack Pro.midi.xml 2012-08-08 11:20:30 +0000
1832@@ -4,6 +4,7 @@
1833 <info>
1834 <name>Numark MixTrack Pro</name>
1835 <author>Matteo (matteo@magm3.com), James Ralston, and Darío José Freije</author>
1836+ <description>MIDI Mapping for Numark MixTrack Pro</description>
1837 </info>
1838 <controller id="Numark Mix Track Pro MIDI 1">
1839 <scriptfiles>
1840@@ -581,7 +582,7 @@
1841 <options>
1842 <script-binding/>
1843 </options>
1844- </control>-
1845+ </control>
1846 <control>
1847 <status>0x90</status>
1848 <midino>0x4D</midino>
1849
1850=== modified file 'mixxx/res/controllers/Numark N4.midi.xml'
1851--- mixxx/res/controllers/Numark N4.midi.xml 2012-06-22 04:16:39 +0000
1852+++ mixxx/res/controllers/Numark N4.midi.xml 2012-08-08 11:20:30 +0000
1853@@ -1,7 +1,8 @@
1854 <MixxxMIDIPreset mixxxVersion="1.10.0+" schemaVersion="1">
1855 <info>
1856+ <name>Numark N4</name>
1857 <author>dj.stuartbrand</author>
1858- <name>Numark N4</name>
1859+ <description>MIDI Mapping for Numark N4</description>
1860 <forums>http://www.mixxx.org/forums/viewtopic.php?f=7&amp;t=3450</forums>
1861 </info>
1862 <controller id="N4 MIDI 1">
1863
1864=== modified file 'mixxx/res/controllers/Numark NS7.midi.xml'
1865--- mixxx/res/controllers/Numark NS7.midi.xml 2011-11-19 20:16:57 +0000
1866+++ mixxx/res/controllers/Numark NS7.midi.xml 2012-08-08 11:20:30 +0000
1867@@ -1,5 +1,5 @@
1868 <?xml version="1.0" encoding="utf-8"?>
1869-<MixxxMIDIPreset vschemaVersion="1" mixxxVersion="1.9.0">
1870+<MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.9.0">
1871 <info>
1872 <name>Numark NS7</name>
1873 <author>Anders Gunnarsson</author>
1874
1875=== modified file 'mixxx/res/controllers/Pioneer CDJ HID.cntrlr.xml'
1876--- mixxx/res/controllers/Pioneer CDJ HID.cntrlr.xml 2012-07-21 02:05:08 +0000
1877+++ mixxx/res/controllers/Pioneer CDJ HID.cntrlr.xml 2012-08-08 11:20:30 +0000
1878@@ -1,5 +1,5 @@
1879 <?xml version="1.0" encoding="utf-8"?>
1880-<MixxxControllerPreset schemaVersion="1">
1881+<MixxxControllerPreset schemaVersion="1" mixxxVersion="1.11+">
1882 <info>
1883 <name>Pioneer CDJ HID</name>
1884 <author>Ilkka Tuohela</author>
1885
1886=== modified file 'mixxx/res/controllers/Pioneer CDJ-2000.midi.xml'
1887--- mixxx/res/controllers/Pioneer CDJ-2000.midi.xml 2012-04-29 04:31:26 +0000
1888+++ mixxx/res/controllers/Pioneer CDJ-2000.midi.xml 2012-08-08 11:20:30 +0000
1889@@ -1,5 +1,5 @@
1890 <?xml version='1.0' encoding='utf-8'?>
1891-<MixxxMIDIPreset schemaversion="1" mixxxVersion="1.10.0+">
1892+<MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.10.0+">
1893 <info>
1894 <name>Pioneer CDJ-2000</name>
1895 <author>Ilkka Tuohela &lt;hile@iki.fi&gt;</author>
1896
1897=== modified file 'mixxx/res/controllers/Pioneer CDJ-850.midi.xml'
1898--- mixxx/res/controllers/Pioneer CDJ-850.midi.xml 2012-04-29 04:31:26 +0000
1899+++ mixxx/res/controllers/Pioneer CDJ-850.midi.xml 2012-08-08 11:20:30 +0000
1900@@ -1,5 +1,5 @@
1901 <?xml version='1.0' encoding='utf-8'?>
1902-<MixxxMIDIPreset schemaversion="1" mixxxVersion="1.10.0+">
1903+<MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.10.0+">
1904 <info>
1905 <name>Pioneer CDJ-850</name>
1906 <author>Ilkka Tuohela &lt;hile@iki.fi&gt;</author>
1907
1908=== modified file 'mixxx/res/controllers/Pioneer-CDJ-HID.js'
1909--- mixxx/res/controllers/Pioneer-CDJ-HID.js 2012-07-21 02:05:08 +0000
1910+++ mixxx/res/controllers/Pioneer-CDJ-HID.js 2012-08-08 11:20:30 +0000
1911@@ -56,7 +56,6 @@
1912 packet.addControl("hid","browse_knob",10,"H",undefined,true);
1913 packet.addControl("hid","pitch_slider",12,"h");
1914 packet.addControl("hid","jog_wheel",14,"h",undefined,true);
1915- //packet.addControl("hid","jog_ticks",16,"h");
1916 packet.addControl("hid","needle_search",18,"h");
1917 this.controller.registerInputPacket(packet);
1918
1919@@ -72,7 +71,7 @@
1920 // TODO - Sean: this is just example, fill in correct packet
1921 // size, header bytes control field offesets but bits to make
1922 // it work.
1923- packet = new HIDPacket("button_leds", [0x1],36);
1924+ packet = new HIDPacket("lights", [0x1],36);
1925 packet.addOutput("hid","screen_acue",4,"B",0x1);
1926 packet.addOutput("hid","remain",4,"B",0x2);
1927 packet.addOutput("hid","reloop_exit",4,"B",0x8);
1928@@ -103,7 +102,7 @@
1929 packet.addOutput("hid","time_frames",14,"B");
1930 packet.addOutput("hid","tracknumber",18,"B");
1931 packet.addOutput("hid","bpm",20,"H");
1932- packet.addOutput("hid","rate",22,"H");
1933+ packet.addOutput("hid","rate",22,"h");
1934 this.controller.registerOutputPacket(packet);
1935
1936 // Control packet to initialize HID mode on CDJ.
1937@@ -150,7 +149,12 @@
1938 this.jogScaler = function(group,name,value) { return value/12; }
1939
1940 // Jog wheel scratch event (ticks) scaler
1941- this.jogPositionDelta = function(group,name,value) { return value/3; }
1942+ this.jogPositionDelta = function(group,name,value) {
1943+ // We sometimes receive invalid events with value > 32000, ignore those
1944+ if (value>=8192)
1945+ return 0;
1946+ return value/3;
1947+ }
1948
1949 // Pitch on CDJ sends -1000 to 1000, reset at 0, swap direction
1950 this.pitchScaler = function(gruop,name,value) { return -(value/1000); }
1951@@ -175,40 +179,42 @@
1952 this.registerOutputPackets();
1953 var packet = controller.OutputPackets["request_hid_mode"];
1954 if (packet!=undefined) {
1955- HIDDebug("Sending HID mode init packet");
1956 packet.send();
1957 }
1958
1959 // Set this value permanently to 0xc0
1960 controller.setOutput("hid","set_time_mode",0xc0);
1961+ controller.setOutput("hid","jog_vinyl_logo",1);
1962 }
1963
1964 }
1965
1966 PioneerCDJHID = new PioneerCDJController();
1967
1968-
1969 // Initialize device state
1970 PioneerCDJHID.init = function(id) {
1971 PioneerCDJHID.id = id;
1972
1973 var controller = PioneerCDJHID.controller;
1974-
1975+ controller.activeDeck = 1;
1976+
1977 // Map beatloop sizes to actual mixxx values
1978 PioneerCDJHID.beatLoopSizeMap = {
1979- beatloop_2: "16", beatloop_2_shift: "1",
1980- beatloop_4: "8", beatloop_4_shift: "0.5",
1981- beatloop_8: "4", beatloop_8_shift: "0.25",
1982- beatloop_16: "2", beatloop_16_shift: "0.125"
1983+ beatloop_2: "16", beatloop_2_shift: "1", beatloop_2_hotcue: "4",
1984+ beatloop_4: "8", beatloop_4_shift: "0.5", beatloop_4_hotcue: "3",
1985+ beatloop_8: "4", beatloop_8_shift: "0.25", beatloop_8_hotcue: "2",
1986+ beatloop_16: "2", beatloop_16_shift: "0.125", beatloop_16_hotcue: "1",
1987 }
1988
1989- controller.activeDeck = 1;
1990-
1991 // Call the HID packet parser initializers
1992 PioneerCDJHID.initializeHIDController();
1993 // Link controls and register callbacks
1994 PioneerCDJHID.registerCallbacks();
1995-
1996+
1997+ // Offset of play position, when 'previous track' will seek to beginning
1998+ // of track instead of jumping to previous track
1999+ PioneerCDJHID.previousJumpStartSeconds = 0;
2000+
2001 // Scratch parameters
2002 controller.scratchintervalsPerRev = 2048;
2003 controller.scratchAlpha = 1.0/8;
2004@@ -220,11 +226,11 @@
2005 engine.softTakeover("[Channel1]","pregain",true);
2006 engine.softTakeover("[Channel2]","pregain",true);
2007
2008- // Set initial deck number
2009- controller.setOutput("hid","tracknumber",controller.activeDeck);
2010- PioneerCDJHID.connectDeckControls();
2011+ // Set deck switch local callbacks
2012+ controller.disconnectDeck = PioneerCDJHID.disconnectDeck;
2013+ controller.connectDeck = PioneerCDJHID.connectDeck;
2014+ PioneerCDJHID.connectDeck();
2015
2016- controller.getOutputPacket("button_leds").send();
2017 HIDDebug("Pioneer CDJ Deck "+PioneerCDJHID.id+" initialized");
2018 }
2019
2020@@ -232,40 +238,16 @@
2021 PioneerCDJHID.shutdown = function() {
2022 }
2023
2024+// Scaling of pregain (0-0xff) to gain value
2025+PioneerCDJHID.pregainScaler = function (group,name,value) {
2026+ return script.absoluteNonLin(value,0,1,4,0,0xff);
2027+}
2028+
2029 // Mandatory default handler for incoming packets
2030 PioneerCDJHID.incomingData = function(data,length) {
2031 PioneerCDJHID.controller.parsePacket(data,length);
2032 }
2033
2034-PioneerCDJHID.disconnectDeckControls = function() {
2035- var controller = PioneerCDJHID.controller;
2036- var group = controller.resolveDeckGroup(controller.activeDeck);
2037- if (!engine.connectControl(group,"duration",PioneerCDJHID.updateTrackLength,true))
2038- HIDDebug("Error disconnecting duration from group " + group);
2039- if (!engine.connectControl(group,"playposition",PioneerCDJHID.updateTime,true))
2040- HIDDebug("Error disconnecting playposition from group " + group);
2041-}
2042-
2043-PioneerCDJHID.connectDeckControls = function() {
2044- var controller = PioneerCDJHID.controller;
2045- engine.connectControl("[Channel1]","duration",PioneerCDJHID.updateTrackLength);
2046- engine.connectControl("[Channel2]","duration",PioneerCDJHID.updateTrackLength);
2047- engine.connectControl("[Channel1]","playposition",PioneerCDJHID.updateTime);
2048- engine.connectControl("[Channel2]","playposition",PioneerCDJHID.updateTime);
2049-
2050- var group = controller.resolveDeckGroup(controller.activeDeck);
2051- PioneerCDJHID.updateTrackLength(engine.getValue(group,"duration"));
2052-
2053- if (PioneerCDJHID.remain_mode)
2054- PioneerCDJHID.controller.setOutput("hid","remain",1);
2055- else
2056- PioneerCDJHID.controller.setOutput("hid","remain",0);
2057- PioneerCDJHID.updateBPM();
2058- //PioneerCDJHID.updateRate();
2059- PioneerCDJHID.updateTime();
2060-
2061-}
2062-
2063 // Link virtual HID naming of input and Output controls to mixxx
2064 // Note: HID specification has more fields than we map here.
2065 PioneerCDJHID.registerCallbacks = function() {
2066@@ -283,8 +265,8 @@
2067 // Seek buttons top of play/cue
2068 controller.linkControl("hid","seek_back","deck","back");
2069 controller.linkControl("hid","seek_forward","deck","fwd");
2070- controller.linkControl("hid","previous_track","[Playlist]","SelectPrevTrack");
2071- controller.linkControl("hid","next_track","[Playlist]","SelectNextTrack");
2072+ controller.setCallback("control","hid","previous_track",PioneerCDJHID.track);
2073+ controller.setCallback("control","hid","next_track",PioneerCDJHID.track);
2074
2075 // Knob to browse tracks right of screen
2076 controller.linkControl("hid","browse_press","deck","LoadSelectedTrack");
2077@@ -301,24 +283,25 @@
2078
2079 // Handle beatloop buttons with modifier + callback
2080 controller.linkModifier("hid","beat_select","beatloop_size");
2081+ controller.linkModifier("hid","cue_memory","hotcue_set");
2082+ controller.linkModifier("hid","cue_delete","hotcue_delete");
2083 controller.setCallback("control","hid","beatloop_16",PioneerCDJHID.beatloop);
2084 controller.setCallback("control","hid","beatloop_8",PioneerCDJHID.beatloop);
2085 controller.setCallback("control","hid","beatloop_4",PioneerCDJHID.beatloop);
2086 controller.setCallback("control","hid","beatloop_2",PioneerCDJHID.beatloop);
2087- controller.setCallback("control","hid","time_mode",PioneerCDJHID.toggleTimeDisplayMode);
2088+ controller.setCallback("control","hid","time_mode",PioneerCDJHID.timeMode);
2089
2090 // Link normal jog touch and delta to HIDController default jog
2091 // and scratch functions. CDJ reports more than these fields from job,
2092 // we ignore the other input fields for jog control. Feel free to adopt.
2093 controller.linkControl("hid","jog_touch","deck","jog_touch");
2094 controller.linkControl("hid","jog_wheel","deck","jog_wheel");
2095-
2096+
2097 // Standard HIDController scalers for jog functionality.
2098 // Not related to field specifications names above!
2099 controller.setScaler("jog",PioneerCDJHID.jogScaler);
2100 controller.setScaler("jog_scratch",PioneerCDJHID.jogPositionDelta);
2101
2102- // TODO Fix these if we want to actually follow CDJ controls strictly.
2103 // Misuse some buttons for something more useful in mixxx
2104 controller.linkControl("hid","cue_previous","deck","loop_halve");
2105 controller.linkControl("hid","cue_next","deck","loop_double");
2106@@ -326,56 +309,131 @@
2107 controller.linkControl("hid","tempo_range","deck","beats_translate_curpos");
2108 controller.linkControl("hid","jog_mode","deck","pfl");
2109
2110- // Use 'eject' button for deck switching
2111- controller.setCallback("control","hid","eject",PioneerCDJHID.switchDeck);
2112-
2113 // Use vinyl speed adjustment for pregain
2114 controller.linkControl("hid","vinyl_speed_knob","deck","pregain");
2115 controller.setScaler("pregain",PioneerCDJHID.pregainScaler);
2116-
2117- // Unused, useful buttons to map - MAP to something!
2118+
2119+ // Unused buttons
2120 // controller.linkControl("hid","menu_back","deck","");
2121 // controller.linkControl("hid","tag_track","deck","");
2122
2123- controller.linkOutput("hid","play","deck","play",PioneerCDJHID.updateOutput);
2124- controller.linkOutput("hid","cue","deck","cue_default",PioneerCDJHID.updateOutput);
2125- controller.linkOutput("hid","reverse","deck","reverse",PioneerCDJHID.updateOutput);
2126- controller.linkOutput("hid","cue_in","deck","loop_in",PioneerCDJHID.updateOutput);
2127- controller.linkOutput("hid","cue_out","deck","loop_out",PioneerCDJHID.updateOutput);
2128- controller.linkOutput("hid","bpm","deck","bpm",PioneerCDJHID.updateBPM);
2129- //controller.linkOutput("hid","rate","deck","rate",PioneerCDJHID.updateRate);
2130-
2131- HIDDebug("Registering controls and callbacks finished");
2132-}
2133-
2134-PioneerCDJHID.updateTrackLength = function(value,group,key) {
2135- PioneerCDJHID.track_length = value;
2136- // This should be triggered automatically, but since it doesn't ...
2137- PioneerCDJHID.updateBPM();
2138- //PioneerCDJHID.updateRate();
2139-}
2140-
2141-PioneerCDJHID.toggleTimeDisplayMode = function(field) {
2142+ controller.linkOutput("hid","play","deck","play","PioneerCDJHID.updateLED");
2143+ controller.linkOutput("hid","cue","deck","cue_default","PioneerCDJHID.updateLED");
2144+ controller.linkOutput("hid","reverse","deck","reverse","PioneerCDJHID.updateLED");
2145+ controller.linkOutput("hid","cue_in","deck","loop_in","PioneerCDJHID.updateLED");
2146+ controller.linkOutput("hid","cue_out","deck","loop_out","PioneerCDJHID.updateLED");
2147+ controller.linkOutput("hid","bpm","deck","bpm","PioneerCDJHID.bpmCallback");
2148+ controller.linkOutput("hid","rate","deck","rate","PioneerCDJHID.rateCallback");
2149+
2150+ // Use 'eject' button for deck switching
2151+ controller.setCallback("control","hid","eject",PioneerCDJHID.switchDeck);
2152+
2153+ HIDDebug("CDJ Controls And Callbacks Registered");
2154+}
2155+
2156+// Callback to update LEDs from engine.connectControl
2157+PioneerCDJHID.updateLED = function(value,group,key) {
2158+ var controller = PioneerCDJHID.controller;
2159+ if (value==1)
2160+ controller.setOutput("deck",key,controller.LEDColors.on,true);
2161+ else
2162+ controller.setOutput("deck",key,controller.LEDColors.off,true);
2163+}
2164+
2165+// Switch active deck between 1 and 2
2166+PioneerCDJHID.switchDeck = function(field) {
2167+ var controller = PioneerCDJHID.controller;
2168+ if (field.value==controller.buttonStates.released)
2169+ return;
2170+ controller.switchDeck();
2171+ HIDDebug("Active CDJ deck now " + controller.activeDeck);
2172+}
2173+
2174+// Disconnect controls before deck during deck switching
2175+PioneerCDJHID.disconnectDeck = function() {
2176+ var controller = PioneerCDJHID.controller;
2177+ var group = controller.resolveDeckGroup(controller.activeDeck);
2178+ engine.connectControl(group,"duration","PioneerCDJHID.durationCallback",true);
2179+ engine.connectControl(group,"playposition","PioneerCDJHID.positionCallback",true);
2180+}
2181+
2182+// Connect controls during init and after deck during deck switching
2183+PioneerCDJHID.connectDeck = function() {
2184+ var controller = PioneerCDJHID.controller;
2185+ var group = controller.resolveDeckGroup(controller.activeDeck);
2186+ var output_packet = controller.getOutputPacket("lights");
2187+
2188+ engine.connectControl(group,"duration","PioneerCDJHID.durationCallback");
2189+ engine.connectControl(group,"playposition","PioneerCDJHID.positionCallback");
2190+
2191+ if (PioneerCDJHID.remain_mode)
2192+ controller.setOutput("hid","remain",1);
2193+ else
2194+ controller.setOutput("hid","remain",0);
2195+
2196+ PioneerCDJHID.setBPM();
2197+ PioneerCDJHID.setRate();
2198+ PioneerCDJHID.setDuration();
2199+ PioneerCDJHID.setTime();
2200+ controller.setOutput("hid","tracknumber",controller.activeDeck);
2201+ output_packet.send();
2202+}
2203+
2204+// Toggle CDJ 'remain/elapsed' track display mode
2205+PioneerCDJHID.timeMode = function(field) {
2206 var controller = PioneerCDJHID.controller;
2207 if (field.value==controller.buttonStates.released)
2208 return;
2209 PioneerCDJHID.remain_mode = (PioneerCDJHID.remain_mode!=true) ? true : false;
2210 if (PioneerCDJHID.remain_mode) {
2211- PioneerCDJHID.controller.setOutput("hid","remain",1);
2212+ controller.setOutput("hid","remain",1);
2213 } else {
2214- PioneerCDJHID.controller.setOutput("hid","remain",0);
2215+ controller.setOutput("hid","remain",0);
2216 }
2217 }
2218
2219-PioneerCDJHID.updateTime = function(value,group,key) {
2220- var controller = PioneerCDJHID.controller;
2221- if (controller.resolveDeck(group)!=controller.activeDeck)
2222- return;
2223- var position;
2224- var output_packet = controller.getOutputPacket("button_leds");
2225+// Set internal track duration variable
2226+PioneerCDJHID.setDuration = function(value) {
2227+ var controller = PioneerCDJHID.controller;
2228+ if (value==undefined)
2229+ PioneerCDJHID.track_length = engine.getValue(
2230+ controller.resolveDeckGroup(controller.activeDeck),
2231+ "duration"
2232+ );
2233+ else
2234+ PioneerCDJHID.track_length = value;
2235+}
2236+
2237+// Set current bpm to packet
2238+PioneerCDJHID.setBPM = function(value) {
2239+ var controller = PioneerCDJHID.controller;
2240+ controller.setOutput("deck","bpm", Math.floor(engine.getValue(
2241+ controller.resolveDeckGroup(controller.activeDeck), "bpm"
2242+ )));
2243+}
2244+
2245+// Set current rate to packet
2246+PioneerCDJHID.setRate = function(value) {
2247+ var controller = PioneerCDJHID.controller;
2248+ var group = controller.resolveDeckGroup(controller.activeDeck);
2249+ var range = Math.floor(100*engine.getValue(group,"rateRange"));
2250+
2251+ // We still need to multiply actual rate with 100
2252+ controller.setOutput("hid","rate",
2253+ 100 * range * engine.getValue(group,"rate_dir") * engine.getValue(group,"rate")
2254+ );
2255+}
2256+
2257+// Set current time value to packet
2258+PioneerCDJHID.setTime = function(value) {
2259+ var controller = PioneerCDJHID.controller;
2260+ if (value==undefined)
2261+ value = engine.getValue(
2262+ controller.resolveDeckGroup(controller.activeDeck),
2263+ "playposition"
2264+ );
2265 if (PioneerCDJHID.remain_mode==true) {
2266- // This is some weird reverse engineered bit magic: don't ask
2267- if (value==undefined || value==1) {
2268+ if (value>=1) {
2269 controller.setOutput("hid","time_minutes",0x76);
2270 controller.setOutput("hid","time_seconds",0x8d);
2271 controller.setOutput("hid","time_frames",0x79);
2272@@ -388,7 +446,7 @@
2273 );
2274 }
2275 } else {
2276- if (value==undefined || value<=0) {
2277+ if (value<=0) {
2278 controller.setOutput("hid","time_minutes",0);
2279 controller.setOutput("hid","time_seconds",0);
2280 controller.setOutput("hid","time_frames",0);
2281@@ -401,115 +459,143 @@
2282 );
2283 }
2284 }
2285- output_packet.send();
2286-}
2287-
2288-PioneerCDJHID.updateBPM = function() {
2289- var controller = PioneerCDJHID.controller;
2290- if (controller.activeDeck==undefined)
2291- return;
2292- var value = engine.getValue(
2293- controller.resolveDeckGroup(controller.activeDeck),
2294- "bpm"
2295- );
2296- HIDDebug("DECK " + controller.activeDeck + " BPM " + Math.floor(value));
2297- PioneerCDJHID.controller.setOutput("deck","bpm",Math.floor(value));
2298-}
2299-
2300-PioneerCDJHID.updateRate = function() {
2301- var controller = PioneerCDJHID.controller;
2302- if (controller.activeDeck==undefined)
2303- return;
2304- var value = engine.getValue(
2305- controller.resolveDeckGroup(controller.activeDeck),
2306- "rate"
2307- );
2308- HIDDebug("DECK " + controller.activeDeck + " RATE " + Math.floor(value));
2309- PioneerCDJHID.controller.setOutput("deck","rate",Math.floor(value));
2310-}
2311-
2312-// Callback to update Outputs from engine.connectControl
2313-PioneerCDJHID.updateOutput = function(value,group,key) {
2314- var controller = PioneerCDJHID.controller;
2315- if (controller.activeDeck==undefined)
2316- return;
2317- if (value==1)
2318- PioneerCDJHID.controller.setOutput("deck",key,controller.LEDColors.on,true);
2319- else
2320- PioneerCDJHID.controller.setOutput("deck",key,controller.LEDColors.off,true);
2321-}
2322-
2323-// Scaling of pregain (0-0xff) to gain value
2324-PioneerCDJHID.pregainScaler = function (group,name,value) {
2325- return script.absoluteLin(value, 0, 4, 0, 0xff);
2326-}
2327-
2328-PioneerCDJHID.reloop_exit = function(field) {
2329- var controller = PioneerCDJHID.controller;
2330- var active_group = controller.resolveDeckGroup(controller.activeDeck);
2331- var output_packet = controller.getOutputPacket("button_leds");
2332-
2333- controller.setOutput("hid","beatloop_16",controller.LEDColors.off);
2334- controller.setOutput("hid","beatloop_8",controller.LEDColors.off);
2335- controller.setOutput("hid","beatloop_4",controller.LEDColors.off);
2336- controller.setOutput("hid","beatloop_2",controller.LEDColors.off);
2337- output_packet.send();
2338- engine.setValue(active_group,"reloop_exit",field.value);
2339-}
2340-
2341-// Hotcues activated with normal press, cleared with shift
2342-PioneerCDJHID.beatloop = function (field) {
2343- var controller = PioneerCDJHID.controller;
2344- var command;
2345- if (field.value==controller.buttonStates.released)
2346- return;
2347- if (controller.activeDeck==undefined)
2348- return;
2349- var active_group = controller.resolveGroup("deck");
2350- if (controller.modifiers.get("beatloop_size")) {
2351+}
2352+
2353+// Control callback when track duration changes (new track is loaded)
2354+// Update all other outputs as side effect, because track changed
2355+PioneerCDJHID.durationCallback = function(value,group,key) {
2356+ var output_packet = PioneerCDJHID.controller.getOutputPacket("lights");
2357+ PioneerCDJHID.setDuration(value);
2358+ PioneerCDJHID.setBPM();
2359+ PioneerCDJHID.setRate();
2360+ PioneerCDJHID.setTime();
2361+ output_packet.send();
2362+}
2363+
2364+// Update current track location on CDJ display
2365+PioneerCDJHID.positionCallback = function(value,group,key) {
2366+ var output_packet = PioneerCDJHID.controller.getOutputPacket("lights");
2367+ PioneerCDJHID.setTime(value);
2368+ output_packet.send();
2369+}
2370+
2371+// Control callback to update track BPM value
2372+PioneerCDJHID.bpmCallback = function(value) {
2373+ var output_packet = PioneerCDJHID.controller.getOutputPacket("lights");
2374+ PioneerCDJHID.setBPM(value);
2375+ output_packet.send();
2376+}
2377+
2378+// Control callback to update track BPM value
2379+PioneerCDJHID.rateCallback = function(value) {
2380+ var output_packet = PioneerCDJHID.controller.getOutputPacket("lights");
2381+ PioneerCDJHID.setRate(value);
2382+ output_packet.send();
2383+}
2384+
2385+// HID callback for previous/next track buttons.
2386+PioneerCDJHID.track = function(field) {
2387+ var controller = PioneerCDJHID.controller;
2388+ var group = controller.resolveDeckGroup(controller.activeDeck);
2389+
2390+ if (field.value==controller.buttonStates.released)
2391+ return;
2392+
2393+ if (field.name=='previous_track') {
2394+ var position = PioneerCDJHID.track_length -
2395+ PioneerCDJHID.track_length * engine.getValue(group,"playposition");
2396+ if (position<PioneerCDJHID.previousJumpStartSeconds) {
2397+ // Move to beginning of track if play position was far enough
2398+ // TODO - implement this with timer so that multiple presses
2399+ // still jump to previous track.
2400+ // Currently just disabled by setting the previousJumpStartSeconds
2401+ // value to 0
2402+ engine.setValue(group,"playposition",0);
2403+ } else {
2404+ // Jump to previous track
2405+ engine.setValue("[Playlist]","SelectPrevTrack",true);
2406+ // Disable until audio bug with noise when we do this is fixed
2407+ //engine.setValue(group,"stop",true);
2408+ //engine.setValue(group,"eject",true);
2409+ engine.setValue(group,"LoadSelectedTrack",true);
2410+ }
2411+ } else if (field.name=='next_track') {
2412+ // Jump to next track
2413+ engine.setValue("[Playlist]","SelectNextTrack",true);
2414+ // Disable until audio bug with noise when we do this is fixed
2415+ //engine.setValue(group,"stop",true);
2416+ //engine.setValue(group,"eject",true);
2417+ engine.setValue(group,"LoadSelectedTrack",true);
2418+ } else {
2419+ HIDDebug("track: Unknown track control field " + field.id);
2420+ return;
2421+ }
2422+}
2423+
2424+// Set given size beatloop or a hotcue, light LED for beatloop
2425+PioneerCDJHID.beatloop = function(field) {
2426+ var controller = PioneerCDJHID.controller;
2427+ var group = controller.resolveDeckGroup(controller.activeDeck);
2428+ var size;
2429+
2430+ if (field.value==controller.buttonStates.released)
2431+ return;
2432+
2433+ if (controller.modifiers.get("hotcue_set")) {
2434+ size = PioneerCDJHID.beatLoopSizeMap[field.name+"_hotcue"];
2435+ control = "hotcue_" + size + "_activate";
2436+ } else if (controller.modifiers.get("hotcue_delete")) {
2437+ size = PioneerCDJHID.beatLoopSizeMap[field.name+"_hotcue"];
2438+ control = "hotcue_" + size + "_clear";
2439+ } else if (controller.modifiers.get("beatloop_size")) {
2440 size = PioneerCDJHID.beatLoopSizeMap[field.name+"_shift"] ;
2441+ control = "beatloop_" + size + "_activate";
2442+ engine.setValue(group,control,true);
2443 } else {
2444 size = PioneerCDJHID.beatLoopSizeMap[field.name];
2445- }
2446- var output_packet = controller.getOutputPacket("button_leds");
2447- controller.setOutput("hid","beatloop_16",controller.LEDColors.off);
2448- controller.setOutput("hid","beatloop_8",controller.LEDColors.off);
2449- controller.setOutput("hid","beatloop_4",controller.LEDColors.off);
2450- controller.setOutput("hid","beatloop_2",controller.LEDColors.off);
2451- controller.setOutput("hid",field.name,controller.LEDColors.on);
2452- output_packet.send();
2453-
2454- var command = "beatloop_" + size + "_toggle";
2455- engine.setValue(active_group,command,true);
2456-}
2457-
2458-// Use pregain if modifier shift is active, volume otherwise
2459-// NOTE: right now no shift button is registered so this is always
2460-// pregain
2461+ control = "beatloop_" + size + "_activate";
2462+ }
2463+ engine.setValue(group,control,true);
2464+
2465+ var output_packet = controller.getOutputPacket("lights");
2466+ controller.setOutput("hid","beatloop_16",controller.LEDColors.off);
2467+ controller.setOutput("hid","beatloop_8",controller.LEDColors.off);
2468+ controller.setOutput("hid","beatloop_4",controller.LEDColors.off);
2469+ controller.setOutput("hid","beatloop_2",controller.LEDColors.off);
2470+ controller.setOutput("hid",field.name,controller.LEDColors.on);
2471+ output_packet.send();
2472+
2473+}
2474+
2475+// Exit current beatloop or manual loop, reset beatloop LEDs
2476+PioneerCDJHID.reloop_exit = function(field) {
2477+ var controller = PioneerCDJHID.controller;
2478+ if (field.value==controller.buttonStates.released) {
2479+ controller.setOutput("hid",field.name,controller.LEDColors.off);
2480+ return;
2481+ }
2482+
2483+ engine.setValue(
2484+ controller.resolveDeckGroup(controller.activeDeck),
2485+ "reloop_exit",
2486+ true
2487+ );
2488+ var output_packet = controller.getOutputPacket("lights");
2489+ controller.setOutput("hid","beatloop_16",controller.LEDColors.off);
2490+ controller.setOutput("hid","beatloop_8",controller.LEDColors.off);
2491+ controller.setOutput("hid","beatloop_4",controller.LEDColors.off);
2492+ controller.setOutput("hid","beatloop_2",controller.LEDColors.off);
2493+ controller.setOutput("hid",field.name,controller.LEDColors.on);
2494+ output_packet.send();
2495+}
2496+
2497+// Adjust pregain with deck mode knob
2498 PioneerCDJHID.pregain = function (field) {
2499 var controller = PioneerCDJHID.controller;
2500- if (controller.activeDeck==undefined)
2501- return;
2502- var active_group = controller.resolveGroup(field.group);
2503- var value;
2504- if (controller.modifiers.get("shift")) {
2505- value = script.absoluteNonLin(field.value, 0, 1, 5, 0, 65536);
2506- engine.setValue(active_group,"pregain",value);
2507- } else {
2508- value = field.value / 65536;
2509- engine.setValue(active_group,"volume",value);
2510- }
2511-}
2512-
2513-// Function called when the special 'Deck Switch' button is pressed
2514-PioneerCDJHID.switchDeck = function(field) {
2515- var controller = PioneerCDJHID.controller;
2516- if (field.value==controller.buttonStates.released)
2517- return;
2518- controller.switchDeck();
2519- controller.setOutput("hid","tracknumber",controller.activeDeck);
2520- controller.getOutputPacket("button_leds").send();
2521- HIDDebug("Active CDJ deck now " + controller.activeDeck);
2522-}
2523-
2524+ engine.setValue(
2525+ controller.resolveDeckGroup(controller.activeDeck),
2526+ "pregain",
2527+ script.absoluteNonLin(field.value, 0, 1, 5, 0, 65536)
2528+ );
2529+}
2530
2531
2532=== modified file 'mixxx/res/controllers/Reloop TerminalMix4.midi.xml'
2533--- mixxx/res/controllers/Reloop TerminalMix4.midi.xml 2012-06-25 22:40:47 +0000
2534+++ mixxx/res/controllers/Reloop TerminalMix4.midi.xml 2012-08-08 11:20:30 +0000
2535@@ -1,10 +1,10 @@
2536 <?xml version='1.0' encoding='utf-8'?>
2537-<MixxxControllerPreset mixxxVersion="1.11.0" schemaVersion="1">
2538+<MixxxMIDIPreset mixxxVersion="1.11.0" schemaVersion="1">
2539 <info>
2540 <name>Reloop TerminalMix4</name>
2541 <author>Sean M. Pappalardo</author>
2542+ <description>A complete 4-deck preset for a single Reloop TerminalMix4. Uses scripting.</description>
2543 <wiki>http://mixxx.org/wiki/doku.php/reloop_terminal_mix4</wiki>
2544- <description>A complete 4-deck preset for a single Reloop TerminalMix4. Uses scripting.</description>
2545 </info>
2546 <controller id="TerminalMix4">
2547 <scriptfiles>
2548@@ -3598,4 +3598,4 @@
2549 </output>
2550 </outputs>
2551 </controller>
2552-</MixxxControllerPreset>
2553+</MixxxMIDIPreset>
2554
2555=== modified file 'mixxx/res/controllers/Sony SixxAxis.cntrlr.xml'
2556--- mixxx/res/controllers/Sony SixxAxis.cntrlr.xml 2012-07-23 16:38:18 +0000
2557+++ mixxx/res/controllers/Sony SixxAxis.cntrlr.xml 2012-08-08 11:20:30 +0000
2558@@ -1,5 +1,5 @@
2559 <?xml version="1.0" encoding="utf-8"?>
2560-<MixxxControllerPreset schemaVersion="1">
2561+<MixxxControllerPreset schemaVersion="1" mixxxVersion="1.11+">
2562 <info>
2563 <name>Sony SixxAxis</name>
2564 <author>Ilkka Tuohela</author>
2565
2566=== modified file 'mixxx/res/controllers/Stanton SCS.1d.midi.xml'
2567--- mixxx/res/controllers/Stanton SCS.1d.midi.xml 2012-06-25 22:44:46 +0000
2568+++ mixxx/res/controllers/Stanton SCS.1d.midi.xml 2012-08-08 11:20:30 +0000
2569@@ -3,8 +3,8 @@
2570 <info>
2571 <name>Stanton SCS.1d (unfinished)</name>
2572 <author>Sean M. Pappalardo</author>
2573+ <description>This is a complete mapping for a single Stanton SCS.1d turntable controller. Requires scripting and native HSS1394 support.</description>
2574 <wiki>http://mixxx.org/wiki/doku.php/stanton_scs.1d</wiki>
2575- <description>This is a complete mapping for a single Stanton SCS.1d turntable controller. Requires scripting and native HSS1394 support.</description>
2576 </info>
2577 <controller id="Stanton SCS.1d">
2578 <scriptfiles>
2579
2580=== modified file 'mixxx/res/controllers/Stanton SCS.1m.midi.xml'
2581--- mixxx/res/controllers/Stanton SCS.1m.midi.xml 2012-06-25 22:44:46 +0000
2582+++ mixxx/res/controllers/Stanton SCS.1m.midi.xml 2012-08-08 11:20:30 +0000
2583@@ -3,8 +3,8 @@
2584 <info>
2585 <name>Stanton SCS.1m</name>
2586 <author>Sean M. Pappalardo</author>
2587+ <description>This is a complete mapping for a single Stanton SCS.1m mixer controller. Requires scripting.</description>
2588 <wiki>http://mixxx.org/wiki/doku.php/stanton_scs.1m</wiki>
2589- <description>This is a complete mapping for a single Stanton SCS.1m mixer controller. Requires scripting.</description>
2590 </info>
2591 <controller id="Stanton SCS.1m" port="">
2592 <scriptfiles>
2593
2594=== modified file 'mixxx/res/controllers/Stanton SCS.3d.midi.xml'
2595--- mixxx/res/controllers/Stanton SCS.3d.midi.xml 2012-06-25 22:44:46 +0000
2596+++ mixxx/res/controllers/Stanton SCS.3d.midi.xml 2012-08-08 11:20:30 +0000
2597@@ -3,8 +3,8 @@
2598 <info>
2599 <name>Stanton SCS.3d</name>
2600 <author>Sean M. Pappalardo</author>
2601+ <description>This is a complete mapping for a single Stanton SCS.3d touch controller controlling two virtual decks. Requires scripting.</description>
2602 <wiki>http://mixxx.org/wiki/doku.php/stanton_scs.3d</wiki>
2603- <description>This is a complete mapping for a single Stanton SCS.3d touch controller controlling two virtual decks. Requires scripting.</description>
2604 </info>
2605 <controller id="Stanton SCS.3d" port="">
2606 <scriptfiles>
2607@@ -12,7 +12,8 @@
2608 </scriptfiles>
2609
2610 <controls>
2611- <control> <!-- Device status inquiry response -->
2612+ <control>
2613+ <description>Device status inquiry response</description>
2614 <status>0xf0</status>
2615 <group>[Master]</group>
2616 <key>StantonSCS3d.statusResponse</key>
2617@@ -20,7 +21,8 @@
2618 <Script-Binding/>
2619 </options>
2620 </control>
2621- <control> <!-- Gain slider -->
2622+ <control>
2623+ <description>Gain slider</description>
2624 <group>[Master]</group>
2625 <key>StantonSCS3d.gain</key>
2626 <status>0xB0</status>
2627@@ -29,7 +31,8 @@
2628 <Script-Binding/>
2629 </options>
2630 </control>
2631- <control> <!-- Gain slider relative mode -->
2632+ <control>
2633+ <description>Gain slider relative mode</description>
2634 <group>[Master]</group>
2635 <key>StantonSCS3d.gainRelative</key>
2636 <status>0xB0</status>
2637@@ -38,204 +41,215 @@
2638 <Script-Binding/>
2639 </options>
2640 </control>
2641- <control> <!-- Pitch slider -->
2642+ <control>
2643+ <description>Pitch slider</description>
2644 <group>[Master]</group>
2645 <key>StantonSCS3d.pitch</key>
2646 <status>0xB0</status>
2647 <midino>4</midino>
2648- <controltype>fader</controltype>
2649 <options>
2650 <Script-Binding/>
2651 </options>
2652 </control>
2653- <control> <!-- Pitch absolute -->
2654+ <control>
2655+ <description>Pitch absolute</description>
2656 <group>[Master]</group>
2657 <key>StantonSCS3d.pitchAbsolute</key>
2658 <status>0xB0</status>
2659 <midino>3</midino>
2660- <controltype>fader</controltype>
2661- <options>
2662- <Script-Binding/>
2663- </options>
2664- </control>
2665- <control> <!-- Pitch touch -->
2666- <group>[Master]</group>
2667- <key>StantonSCS3d.pitchTouch</key>
2668- <status>0x90</status>
2669- <midino>3</midino>
2670- <options>
2671- <Script-Binding/>
2672- </options>
2673- </control>
2674- <control> <!-- Pitch touch -->
2675- <group>[Master]</group>
2676- <key>StantonSCS3d.pitchTouch</key>
2677- <status>0x80</status>
2678- <midino>3</midino>
2679- <options>
2680- <Script-Binding/>
2681- </options>
2682- </control>
2683- <control> <!-- FX -->
2684- <!--<group>[Channel1]</group>-->
2685-<!-- <key>flanger</key> -->
2686- <group>[Master]</group>
2687- <key>StantonSCS3d.FX</key>
2688- <status>0x90</status>
2689- <midino>0x20</midino>
2690-<!-- <controltype>button</controltype> -->
2691- <options>
2692- <Script-Binding/>
2693- </options>
2694- </control>
2695- <control> <!-- FX -->
2696- <!--<group>[Channel1]</group>-->
2697-<!-- <key>flanger</key> -->
2698- <group>[Master]</group>
2699- <key>StantonSCS3d.FX</key>
2700- <status>0x80</status>
2701- <midino>0x20</midino>
2702-<!-- <controltype>button</controltype> -->
2703- <options>
2704- <Script-Binding/>
2705- </options>
2706- </control>
2707- <control> <!-- EQ -->
2708- <group>[Master]</group>
2709- <key>StantonSCS3d.EQ</key>
2710- <status>0x90</status>
2711- <midino>0x26</midino>
2712- <options>
2713- <Script-Binding/>
2714- </options>
2715- </control>
2716- <control> <!-- EQ -->
2717- <group>[Master]</group>
2718- <key>StantonSCS3d.EQ</key>
2719- <status>0x80</status>
2720- <midino>0x26</midino>
2721- <options>
2722- <Script-Binding/>
2723- </options>
2724- </control>
2725- <control> <!-- Loop -->
2726- <group>[Master]</group>
2727- <key>StantonSCS3d.Loop</key>
2728- <status>0x90</status>
2729- <midino>0x22</midino>
2730- <options>
2731- <Script-Binding/>
2732- </options>
2733- </control>
2734- <control> <!-- Loop -->
2735- <group>[Master]</group>
2736- <key>StantonSCS3d.Loop</key>
2737- <status>0x80</status>
2738- <midino>0x22</midino>
2739- <options>
2740- <Script-Binding/>
2741- </options>
2742- </control>
2743- <control> <!-- Trig -->
2744- <group>[Master]</group>
2745- <key>StantonSCS3d.Trig</key>
2746- <status>0x90</status>
2747- <midino>0x28</midino>
2748- <options>
2749- <Script-Binding/>
2750- </options>
2751- </control>
2752- <control> <!-- Trig -->
2753- <group>[Master]</group>
2754- <key>StantonSCS3d.Trig</key>
2755- <status>0x80</status>
2756- <midino>0x28</midino>
2757- <options>
2758- <Script-Binding/>
2759- </options>
2760- </control>
2761- <control> <!-- Vinyl -->
2762-<!-- <group>[Channel1]</group> -->
2763-<!-- <key>reverse</key> -->
2764- <group>[Master]</group>
2765- <key>StantonSCS3d.Vinyl</key>
2766- <status>0x90</status>
2767- <midino>0x24</midino>
2768-<!-- <controltype>button</controltype> -->
2769- <options>
2770- <Script-Binding/>
2771- </options>
2772- </control>
2773- <control> <!-- Vinyl -->
2774-<!-- <group>[Channel1]</group> -->
2775-<!-- <key>reverse</key> -->
2776- <group>[Master]</group>
2777- <key>StantonSCS3d.Vinyl</key>
2778- <status>0x80</status>
2779- <midino>0x24</midino>
2780-<!-- <controltype>button</controltype> -->
2781- <options>
2782- <Script-Binding/>
2783- </options>
2784- </control>
2785- <control> <!-- Deck -->
2786- <group>[Master]</group>
2787- <key>StantonSCS3d.DeckButton</key>
2788- <status>0x90</status>
2789- <midino>0x2A</midino>
2790- <options>
2791- <Script-Binding/>
2792- </options>
2793- </control>
2794- <control> <!-- Deck -->
2795- <group>[Master]</group>
2796- <key>StantonSCS3d.DeckButton</key>
2797- <status>0x80</status>
2798- <midino>0x2A</midino>
2799- <options>
2800- <Script-Binding/>
2801- </options>
2802- </control>
2803- <control> <!-- B11 headphone cue -->
2804- <group>[Master]</group>
2805- <key>StantonSCS3d.B11</key>
2806- <status>0x90</status>
2807- <midino>0x2C</midino>
2808-<!-- <controltype>button</controltype> -->
2809- <options>
2810- <Script-Binding/>
2811- </options>
2812- </control>
2813- <control> <!-- B11 headphone cue -->
2814- <group>[Master]</group>
2815- <key>StantonSCS3d.B11</key>
2816- <status>0x80</status>
2817- <midino>0x2C</midino>
2818-<!-- <controltype>button</controltype> -->
2819- <options>
2820- <Script-Binding/>
2821- </options>
2822- </control>
2823- <control> <!-- B12 -->
2824-<!-- <group>[Channel1]</group> -->
2825-<!-- <key>rateRange</key> -->
2826- <group>[Master]</group>
2827- <key>StantonSCS3d.B12</key>
2828- <status>0x90</status>
2829- <midino>0x2E</midino>
2830-<!-- <controltype>button</controltype> -->
2831- <options>
2832- <Script-Binding/>
2833- </options>
2834- </control>
2835- <control> <!-- B12 -->
2836-<!-- <group>[Channel1]</group> -->
2837-<!-- <key>rateRange</key> -->
2838- <group>[Master]</group>
2839- <key>StantonSCS3d.B12</key>
2840- <status>0x80</status>
2841- <midino>0x2E</midino>
2842-<!-- <controltype>button</controltype> -->
2843+ <options>
2844+ <Script-Binding/>
2845+ </options>
2846+ </control>
2847+ <control>
2848+ <description>Pitch touch</description>
2849+ <group>[Master]</group>
2850+ <key>StantonSCS3d.pitchTouch</key>
2851+ <status>0x90</status>
2852+ <midino>3</midino>
2853+ <options>
2854+ <Script-Binding/>
2855+ </options>
2856+ </control>
2857+ <control>
2858+ <description>Pitch touch</description>
2859+ <group>[Master]</group>
2860+ <key>StantonSCS3d.pitchTouch</key>
2861+ <status>0x80</status>
2862+ <midino>3</midino>
2863+ <options>
2864+ <Script-Binding/>
2865+ </options>
2866+ </control>
2867+ <control>
2868+ <description>FX</description>
2869+ <!--<group>[Channel1]</group>-->
2870+ <!--<key>flanger</key> -->
2871+ <group>[Master]</group>
2872+ <key>StantonSCS3d.FX</key>
2873+ <status>0x90</status>
2874+ <midino>0x20</midino>
2875+ <options>
2876+ <Script-Binding/>
2877+ </options>
2878+ </control>
2879+ <control>
2880+ <description>FX</description>
2881+ <!--<group>[Channel1]</group>-->
2882+ <!--<key>flanger</key> -->
2883+ <group>[Master]</group>
2884+ <key>StantonSCS3d.FX</key>
2885+ <status>0x80</status>
2886+ <midino>0x20</midino>
2887+ <!-- <controltype>button</controltype> -->
2888+ <options>
2889+ <Script-Binding/>
2890+ </options>
2891+ </control>
2892+ <control>
2893+ <description>EQ</description>
2894+ <group>[Master]</group>
2895+ <key>StantonSCS3d.EQ</key>
2896+ <status>0x90</status>
2897+ <midino>0x26</midino>
2898+ <options>
2899+ <Script-Binding/>
2900+ </options>
2901+ </control>
2902+ <control>
2903+ <description>EQ</description>
2904+ <group>[Master]</group>
2905+ <key>StantonSCS3d.EQ</key>
2906+ <status>0x80</status>
2907+ <midino>0x26</midino>
2908+ <options>
2909+ <Script-Binding/>
2910+ </options>
2911+ </control>
2912+ <control>
2913+ <description>Loop</description>
2914+ <group>[Master]</group>
2915+ <key>StantonSCS3d.Loop</key>
2916+ <status>0x90</status>
2917+ <midino>0x22</midino>
2918+ <options>
2919+ <Script-Binding/>
2920+ </options>
2921+ </control>
2922+ <control>
2923+ <description>Loop</description>
2924+ <group>[Master]</group>
2925+ <key>StantonSCS3d.Loop</key>
2926+ <status>0x80</status>
2927+ <midino>0x22</midino>
2928+ <options>
2929+ <Script-Binding/>
2930+ </options>
2931+ </control>
2932+ <control>
2933+ <description>Trig</description>
2934+ <group>[Master]</group>
2935+ <key>StantonSCS3d.Trig</key>
2936+ <status>0x90</status>
2937+ <midino>0x28</midino>
2938+ <options>
2939+ <Script-Binding/>
2940+ </options>
2941+ </control>
2942+ <control>
2943+ <description>Trig</description>
2944+ <group>[Master]</group>
2945+ <key>StantonSCS3d.Trig</key>
2946+ <status>0x80</status>
2947+ <midino>0x28</midino>
2948+ <options>
2949+ <Script-Binding/>
2950+ </options>
2951+ </control>
2952+ <control>
2953+ <description>Vinyl</description>
2954+ <!-- <group>[Channel1]</group> -->
2955+ <!-- <key>reverse</key> -->
2956+ <group>[Master]</group>
2957+ <key>StantonSCS3d.Vinyl</key>
2958+ <status>0x90</status>
2959+ <midino>0x24</midino>
2960+ <options>
2961+ <Script-Binding/>
2962+ </options>
2963+ </control>
2964+ <control>
2965+ <description>Vinyl</description>
2966+ <!-- <group>[Channel1]</group> -->
2967+ <!-- <key>reverse</key> -->
2968+ <group>[Master]</group>
2969+ <key>StantonSCS3d.Vinyl</key>
2970+ <status>0x80</status>
2971+ <midino>0x24</midino>
2972+ <options>
2973+ <Script-Binding/>
2974+ </options>
2975+ </control>
2976+ <control>
2977+ <description>Deck</description>
2978+ <group>[Master]</group>
2979+ <key>StantonSCS3d.DeckButton</key>
2980+ <status>0x90</status>
2981+ <midino>0x2A</midino>
2982+ <options>
2983+ <Script-Binding/>
2984+ </options>
2985+ </control>
2986+ <control>
2987+ <description>Deck</description>
2988+ <group>[Master]</group>
2989+ <key>StantonSCS3d.DeckButton</key>
2990+ <status>0x80</status>
2991+ <midino>0x2A</midino>
2992+ <options>
2993+ <Script-Binding/>
2994+ </options>
2995+ </control>
2996+ <control>
2997+ <description>B11 headphone cue</description>
2998+ <group>[Master]</group>
2999+ <key>StantonSCS3d.B11</key>
3000+ <status>0x90</status>
3001+ <midino>0x2C</midino>
3002+ <options>
3003+ <Script-Binding/>
3004+ </options>
3005+ </control>
3006+ <control>
3007+ <description>B11 headphone cue</description>
3008+ <group>[Master]</group>
3009+ <key>StantonSCS3d.B11</key>
3010+ <status>0x80</status>
3011+ <midino>0x2C</midino>
3012+ <options>
3013+ <Script-Binding/>
3014+ </options>
3015+ </control>
3016+ <control>
3017+ <description>B12</description>
3018+ <!-- <group>[Channel1]</group> -->
3019+ <!-- <key>rateRange</key> -->
3020+ <group>[Master]</group>
3021+ <key>StantonSCS3d.B12</key>
3022+ <status>0x90</status>
3023+ <midino>0x2E</midino>
3024+ <options>
3025+ <Script-Binding/>
3026+ </options>
3027+ </control>
3028+ <control>
3029+ <description>B12</description>
3030+ <!-- <group>[Channel1]</group> -->
3031+ <!-- <key>rateRange</key> -->
3032+ <group>[Master]</group>
3033+ <key>StantonSCS3d.B12</key>
3034+ <status>0x80</status>
3035+ <midino>0x2E</midino>
3036 <options>
3037 <Script-Binding/>
3038 </options>
3039
3040=== modified file 'mixxx/res/controllers/Stanton SCS.3m.midi.xml'
3041--- mixxx/res/controllers/Stanton SCS.3m.midi.xml 2012-06-25 22:44:46 +0000
3042+++ mixxx/res/controllers/Stanton SCS.3m.midi.xml 2012-08-08 11:20:30 +0000
3043@@ -3,8 +3,8 @@
3044 <info>
3045 <name>Stanton SCS.3m</name>
3046 <author>Sean M. Pappalardo</author>
3047+ <description>This is a complete mapping for a single Stanton SCS.3m mixer touch controller. Requires scripting.</description>
3048 <wiki>http://mixxx.org/wiki/doku.php/stanton_scs.3m</wiki>
3049- <description>This is a complete mapping for a single Stanton SCS.3m mixer touch controller. Requires scripting.</description>
3050 </info>
3051 <controller id="Stanton SCS.3m">
3052 <scriptfiles>
3053
3054=== modified file 'mixxx/res/controllers/TrakProDJ iPad.midi.xml'
3055--- mixxx/res/controllers/TrakProDJ iPad.midi.xml 2012-04-29 04:31:26 +0000
3056+++ mixxx/res/controllers/TrakProDJ iPad.midi.xml 2012-08-08 11:20:30 +0000
3057@@ -1,5 +1,5 @@
3058 <?xml version='1.0' encoding='utf-8'?>
3059-<MixxxMIDIPreset schemaversion="1" mixxxVersion="1.10.0+">
3060+<MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.10.0+">
3061 <info>
3062 <name>TrakProDJ iPad</name>
3063 <author>Ilkka Tuohela &lt;hile@iki.fi&gt;</author>
3064
3065=== removed file 'mixxx/res/controllers/Traktor Kontrol F1 Samplers.cntrlr.xml'
3066--- mixxx/res/controllers/Traktor Kontrol F1 Samplers.cntrlr.xml 2012-07-21 02:05:08 +0000
3067+++ mixxx/res/controllers/Traktor Kontrol F1 Samplers.cntrlr.xml 1970-01-01 00:00:00 +0000
3068@@ -1,18 +0,0 @@
3069-<?xml version="1.0" encoding="utf-8"?>
3070-<MixxxControllerPreset schemaVersion="1">
3071- <info>
3072- <name>Traktor Kontrol F1 Samplers</name>
3073- <author>Ilkka Tuohela</author>
3074- <description>Sampler HID mapping for Native Instruments Traktor Kontrol F1 Controller</description>
3075- <forums>http://www.mixxx.org/forums/viewtopic.php?f=7&amp;t=3810&amp;sid=c1bfe107f8ea6c65bf2294ff51a0920d</forums>
3076- <devices>
3077- <product protocol="hid" vendor_id="0x17cc" product_id="0x1120" usage_page="0x1ff" usage="0x1" interface_number="0x1" />
3078- </devices>
3079- </info>
3080- <controller id="Traktor Kontrol F1">
3081- <scriptfiles>
3082- <file filename="common-hid-packet-parser.js" functionprefix=""/>
3083- <file filename="Traktor-Kontrol-F1-Samplers.js" functionprefix="KontrolF1Samplers"/>
3084- </scriptfiles>
3085- </controller>
3086-</MixxxControllerPreset>
3087
3088=== added file 'mixxx/res/controllers/Traktor Kontrol F1.cntrlr.xml'
3089--- mixxx/res/controllers/Traktor Kontrol F1.cntrlr.xml 1970-01-01 00:00:00 +0000
3090+++ mixxx/res/controllers/Traktor Kontrol F1.cntrlr.xml 2012-08-08 11:20:30 +0000
3091@@ -0,0 +1,18 @@
3092+<?xml version="1.0" encoding="utf-8"?>
3093+<MixxxControllerPreset schemaVersion="1" mixxxVersion="1.11+">
3094+ <info>
3095+ <name>Traktor Kontrol F1</name>
3096+ <author>Ilkka Tuohela</author>
3097+ <description>HID mapping for Native Instruments Traktor Kontrol F1 Controller</description>
3098+ <forums>http://www.mixxx.org/forums/viewtopic.php?f=7&amp;t=3810&amp;sid=c1bfe107f8ea6c65bf2294ff51a0920d</forums>
3099+ <devices>
3100+ <product protocol="hid" vendor_id="0x17cc" product_id="0x1120" usage_page="0x1ff" usage="0x1" interface_number="0x1" />
3101+ </devices>
3102+ </info>
3103+ <controller id="Traktor Kontrol F1">
3104+ <scriptfiles>
3105+ <file filename="common-hid-packet-parser.js" functionprefix=""/>
3106+ <file filename="Traktor-Kontrol-F1-scripts.js" functionprefix="KontrolF1"/>
3107+ </scriptfiles>
3108+ </controller>
3109+</MixxxControllerPreset>
3110
3111=== modified file 'mixxx/res/controllers/Traktor Kontrol X1.midi.xml'
3112--- mixxx/res/controllers/Traktor Kontrol X1.midi.xml 2012-07-21 02:05:08 +0000
3113+++ mixxx/res/controllers/Traktor Kontrol X1.midi.xml 2012-08-08 11:20:30 +0000
3114@@ -1,5 +1,4 @@
3115-<?xml version='1.0' encoding='utf-8'?>
3116-<MixxxMIDIPreset schemaversion="1" mixxxVersion="1.10.0+">
3117+<MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.10.0+">
3118 <info>
3119 <name>Traktor Kontrol X1</name>
3120 <author>Ilkka Tuohela &lt;hile@iki.fi&gt;</author>
3121@@ -35,7 +34,6 @@
3122 <control><group>encoders</group><key>KontrolX1.encoders</key><status>0xb0</status><midino>0x1b</midino><options><Script-Binding/></options></control>
3123 <control><group>buttons</group><key>KontrolX1.buttons</key><status>0xb0</status><midino>0x12</midino><options><Script-Binding/></options></control>
3124 <control><group>buttons</group><key>KontrolX1.buttons</key><status>0xb0</status><midino>0x13</midino><options><Script-Binding/></options></control>
3125- <control><group>buttons</group><key>KontrolX1.buttons</key><status>0xb0</status><midino>0x15</midino><options><Script-Binding/></options></control>
3126 <control><group>buttons</group><key>KontrolX1.buttons</key><status>0xb0</status><midino>0x14</midino><options><Script-Binding/></options></control>
3127 <control><group>buttons</group><key>KontrolX1.buttons</key><status>0xb0</status><midino>0x15</midino><options><Script-Binding/></options></control>
3128 <control><group>buttons</group><key>KontrolX1.buttons</key><status>0xb0</status><midino>0x16</midino><options><Script-Binding/></options></control>
3129
3130=== removed file 'mixxx/res/controllers/Traktor-Kontrol-F1-Samplers.js'
3131--- mixxx/res/controllers/Traktor-Kontrol-F1-Samplers.js 2012-07-21 02:05:08 +0000
3132+++ mixxx/res/controllers/Traktor-Kontrol-F1-Samplers.js 1970-01-01 00:00:00 +0000
3133@@ -1,578 +0,0 @@
3134-//
3135-// Native Instruments Traktor Kontrol F1 HID controller script v0.9
3136-// Copyright (C) 2012, Ilkka Tuohela
3137-// For Mixxx version 1.11.x
3138-//
3139-
3140-// Native Instruments Traktor Kontrol F1 HID interface specification
3141-function KontrolF1Controller() {
3142- this.controller = new HIDController();
3143-
3144- // Initialized to firmware version by version response packet
3145- this.version_major = undefined;
3146- this.version_minor = undefined;
3147- this.controller.activeDeck = 1;
3148-
3149- // F1 PAD LEDs are special, it has full RGB control with three bytes,
3150- // we can't use normal LEDColors directly. Define here some basic
3151- // colors, allow using full RGB values with script
3152- this.padColorSet = {
3153- 1: [0x0,0x40,0x0],
3154- 2: [0x0,0x40,0x40],
3155- 3: [0x40,0x0,0x40],
3156- 4: [0x40,0x40,0x0],
3157- };
3158- this.padColorActive = {
3159- 1: [0x0,0x7f,0x0],
3160- 2: [0x0,0x7f,0x7f],
3161- 3: [0x7f,0x0,0x7f],
3162- 4: [0x7f,0x7f,0x0],
3163- };
3164- this.deckLEDColors = { 1: "red", 2: "green", 3: "red", 4: "green"};
3165- this.deckSwitchMap = { 1: 2, 2: 1, 3: 4, 4: 3, undefined: 1 };
3166-
3167- this.buttonNames = [
3168- "sync","quant","capture","shift",
3169- "reverse","type","size","browse",
3170- "stop_1_1","stop_1_2","stop_2_1","stop_2_2",
3171- "stop_3_1","stop_3_2","stop_4_1","stop_4_2"
3172- ];
3173-
3174- this.registerInputPackets = function() {
3175- var packet = undefined;
3176-
3177- packet = new HIDPacket("control",[0x1],22);
3178- packet.addControl("hid","pad_8_button",1,"I",0x1);
3179- packet.addControl("hid","pad_7_button",1,"I",0x2);
3180- packet.addControl("hid","pad_6_button",1,"I",0x4);
3181- packet.addControl("hid","pad_5_button",1,"I",0x8);
3182- packet.addControl("hid","pad_4_button",1,"I",0x10);
3183- packet.addControl("hid","pad_3_button",1,"I",0x20);
3184- packet.addControl("hid","pad_2_button",1,"I",0x40);
3185- packet.addControl("hid","pad_1_button",1,"I",0x80);
3186- packet.addControl("hid","pad_16_button",1,"I",0x100);
3187- packet.addControl("hid","pad_15_button",1,"I",0x200);
3188- packet.addControl("hid","pad_14_button",1,"I",0x400);
3189- packet.addControl("hid","pad_13_button",1,"I",0x800);
3190- packet.addControl("hid","pad_12_button",1,"I",0x1000);
3191- packet.addControl("hid","pad_11_button",1,"I",0x2000);
3192- packet.addControl("hid","pad_10_button",1,"I",0x4000);
3193- packet.addControl("hid","pad_9_button",1,"I",0x8000);
3194- packet.addControl("hid","shift",1,"I",0x800000);
3195- packet.addControl("hid","reverse",1,"I",0x400000);
3196- packet.addControl("hid","size",1,"I",0x100000);
3197- packet.addControl("hid","type",1,"I",0x200000);
3198- packet.addControl("hid","select_push",1,"I",0x40000);
3199- packet.addControl("hid","browse",1,"I",0x80000);
3200- packet.addControl("hid","stop_1",1,"I",0x80000000);
3201- packet.addControl("hid","stop_2",1,"I",0x40000000);
3202- packet.addControl("hid","stop_3",1,"I",0x20000000);
3203- packet.addControl("hid","stop_4",1,"I",0x10000000);
3204- packet.addControl("hid","sync",1,"I",0x8000000);
3205- packet.addControl("hid","quant",1,"I",0x4000000);
3206- packet.addControl("hid","capture",1,"I",0x2000000);
3207- packet.addControl("hid","select_encoder",5,"B",undefined,true);
3208-
3209- // Knobs have value range 0-4092, so while some controls are
3210- // -1..0..1 range, hidparser will return same data as with h
3211- // packing (16 bit range while we only use 12 bits)
3212- packet.addControl("hid","knob_1",6,"H");
3213- packet.addControl("hid","knob_2",8,"H");
3214- packet.addControl("hid","knob_3",10,"H");
3215- packet.addControl("hid","knob_4",12,"H");
3216- packet.addControl("hid","knob_5",14,"H");
3217- packet.addControl("hid","knob_6",16,"H");
3218- packet.addControl("hid","knob_7",18,"H");
3219- packet.addControl("hid","knob_8",20,"H");
3220- this.controller.registerInputPacket(packet);
3221-
3222- }
3223-
3224- this.registerOutputPackets = function() {
3225- var packet = undefined;
3226-
3227- packet = new HIDPacket("lights",[0x80],81);
3228- // Right 7-segment element - 0x0 off, 0x40 on
3229- packet.addControl("hid","right_segment_dp",1,"B");
3230- packet.addControl("hid","right_segment_a",2,"B");
3231- packet.addControl("hid","right_segment_b",3,"B");
3232- packet.addControl("hid","right_segment_c",4,"B");
3233- packet.addControl("hid","right_segment_d",5,"B");
3234- packet.addControl("hid","right_segment_e",6,"B");
3235- packet.addControl("hid","right_segment_f",7,"B");
3236- packet.addControl("hid","right_segment_g",8,"B");
3237-
3238- // Left 7-segment element - 0x0 off, 0x40 on
3239- packet.addControl("hid","left_segment_dp",9,"B");
3240- packet.addControl("hid","left_segment_a",10,"B");
3241- packet.addControl("hid","left_segment_b",11,"B");
3242- packet.addControl("hid","left_segment_c",12,"B");
3243- packet.addControl("hid","left_segment_d",13,"B");
3244- packet.addControl("hid","left_segment_e",14,"B");
3245- packet.addControl("hid","left_segment_f",15,"B");
3246- packet.addControl("hid","left_segment_g",16,"B");
3247-
3248- // Button led brightness, 0-0xff
3249- packet.addControl("hid","browse_brightness",17,"B");
3250- packet.addControl("hid","size_brightness",18,"B");
3251- packet.addControl("hid","type_brightness",19,"B");
3252- packet.addControl("hid","reverse_brightness",20,"B");
3253- packet.addControl("hid","shift_brightness",21,"B");
3254- packet.addControl("hid","capture_brightness",22,"B");
3255- packet.addControl("hid","quant_brightness",23,"B");
3256- packet.addControl("hid","sync_brightness",24,"B");
3257-
3258- // Pad RGB color button controls, 3 bytes per pad
3259- packet.addControl("hid","pad_1_blue",25,"B")
3260- packet.addControl("hid","pad_1_red",26,"B")
3261- packet.addControl("hid","pad_1_green",27,"B")
3262- packet.addControl("hid","pad_2_blue",28,"B")
3263- packet.addControl("hid","pad_2_red",29,"B")
3264- packet.addControl("hid","pad_2_green",30,"B")
3265- packet.addControl("hid","pad_3_blue",31,"B")
3266- packet.addControl("hid","pad_3_red",32,"B")
3267- packet.addControl("hid","pad_3_green",33,"B")
3268- packet.addControl("hid","pad_4_blue",34,"B")
3269- packet.addControl("hid","pad_4_red",35,"B")
3270- packet.addControl("hid","pad_4_green",36,"B")
3271- packet.addControl("hid","pad_5_blue",37,"B")
3272- packet.addControl("hid","pad_5_red",38,"B")
3273- packet.addControl("hid","pad_5_green",39,"B")
3274- packet.addControl("hid","pad_6_blue",40,"B")
3275- packet.addControl("hid","pad_6_red",41,"B")
3276- packet.addControl("hid","pad_6_green",42,"B")
3277- packet.addControl("hid","pad_7_blue",43,"B")
3278- packet.addControl("hid","pad_7_red",44,"B")
3279- packet.addControl("hid","pad_7_green",45,"B")
3280- packet.addControl("hid","pad_8_blue",46,"B")
3281- packet.addControl("hid","pad_8_red",47,"B")
3282- packet.addControl("hid","pad_8_green",48,"B")
3283- packet.addControl("hid","pad_9_blue",49,"B")
3284- packet.addControl("hid","pad_9_red",50,"B")
3285- packet.addControl("hid","pad_9_green",51,"B")
3286- packet.addControl("hid","pad_10_blue",52,"B")
3287- packet.addControl("hid","pad_10_red",53,"B")
3288- packet.addControl("hid","pad_10_green",54,"B")
3289- packet.addControl("hid","pad_11_blue",55,"B")
3290- packet.addControl("hid","pad_11_red",56,"B")
3291- packet.addControl("hid","pad_11_green",57,"B")
3292- packet.addControl("hid","pad_12_blue",58,"B")
3293- packet.addControl("hid","pad_12_red",59,"B")
3294- packet.addControl("hid","pad_12_green",60,"B")
3295- packet.addControl("hid","pad_13_blue",61,"B")
3296- packet.addControl("hid","pad_13_red",62,"B")
3297- packet.addControl("hid","pad_13_green",63,"B")
3298- packet.addControl("hid","pad_14_blue",64,"B")
3299- packet.addControl("hid","pad_14_red",65,"B")
3300- packet.addControl("hid","pad_14_green",66,"B")
3301- packet.addControl("hid","pad_15_blue",67,"B")
3302- packet.addControl("hid","pad_15_red",68,"B")
3303- packet.addControl("hid","pad_15_green",69,"B")
3304- packet.addControl("hid","pad_16_blue",70,"B")
3305- packet.addControl("hid","pad_16_red",71,"B")
3306- packet.addControl("hid","pad_16_green",72,"B")
3307-
3308- // Stop key brightness control, 0-0xff
3309- packet.addControl("hid","stop_4_1_brightness",73,"B");
3310- packet.addControl("hid","stop_4_2_brightness",74,"B");
3311- packet.addControl("hid","stop_3_1_brightness",75,"B");
3312- packet.addControl("hid","stop_3_2_brightness",76,"B");
3313- packet.addControl("hid","stop_2_1_brightness",77,"B");
3314- packet.addControl("hid","stop_2_2_brightness",78,"B");
3315- packet.addControl("hid","stop_1_1_brightness",79,"B");
3316- packet.addControl("hid","stop_1_2_brightness",80,"B");
3317-
3318- this.controller.registerOutputPacket(packet);
3319-
3320- }
3321-
3322- this.initializeHIDController = function() {
3323- this.registerInputPackets();
3324- this.registerOutputPackets();
3325- }
3326-
3327- // Volume slider scaling for 0..1..5 scaling
3328- this.volumeScaler = function(group,name,value) {
3329- return script.absoluteLin(value, 0, 5, 0, 4096);
3330- }
3331-
3332- // Rate knob scaler
3333- this.rateScaler = function(group,name,value) {
3334- return -script.absoluteLin(value,-1,1,0,4096);
3335- }
3336-
3337- // EQ scaling function for 0..1..4 scaling
3338- this.eqScaler = function(group,name,value) {
3339- return script.absoluteNonLin(value, 0, 1, 4, 0, 4096);
3340- }
3341-
3342- // Set brightness for single color buttons with brigthness adjustment
3343- // Valid adjustment range is 0-0x7f
3344- this.setButtonBrightness = function(name,value) {
3345- var controller = this.controller;
3346- var packet = controller.getOutputPacket("lights");
3347- if (name.match(/pad_/)) {
3348- HIDDebug("ERROR: set PAD colors with setPADColor");
3349- return;
3350- }
3351- if (!name.match(/.*_brightness$/))
3352- name = name + "_brightness";
3353- var field = packet.getField("hid",name);
3354- if (field==undefined) {
3355- HIDDebug("button field not found: " + name);
3356- return;
3357- }
3358- if (value<0)
3359- value = 0;
3360- if (value>0x7f)
3361- value = 0x7f;
3362- field.value = value;
3363- }
3364-
3365- // Set the 8 bytes in left or right 7-segment display. DP is the dot.
3366- this.set7SegmentValue = function(name,dp,v1,v2,v3,v4,v5,v6,v7,v8) {
3367- var controller = this.controller;
3368- var packet = controller.getOutputPacket("lights");
3369- var field = undefined;
3370- field = packet.getField("hid",name+"_segment_dp");
3371- field.value = dp;
3372- field = packet.getField("hid",name+"_segment_a");
3373- field.value = v1;
3374- field = packet.getField("hid",name+"_segment_b");
3375- field.value = v2;
3376- field = packet.getField("hid",name+"_segment_c");
3377- field.value = v3;
3378- field = packet.getField("hid",name+"_segment_d");
3379- field.value = v4;
3380- field = packet.getField("hid",name+"_segment_e");
3381- field.value = v5;
3382- field = packet.getField("hid",name+"_segment_f");
3383- field.value = v6;
3384- field = packet.getField("hid",name+"_segment_g");
3385- field.value = v7;
3386- }
3387-
3388- // Set RGB color for one of the 16 pads.
3389- // Index is pad number index as 1-16.
3390- // Valid range for each color is 0-0x7f.
3391- this.setPADColor = function(index,red,green,blue) {
3392- var controller = this.controller;
3393- var packet = controller.getOutputPacket("lights");
3394- var field = undefined;
3395- if (index<0 || index>16) {
3396- HIDDebug("Invalid pad index" + index);
3397- return;
3398- }
3399- if (red==undefined)
3400- red=0;
3401- if (red>0x7f)
3402- red=0x7f;
3403- if (green==undefined)
3404- green=0;
3405- if (green>0x7f)
3406- green=0x7f;
3407- if (blue==undefined)
3408- blue=0;
3409- if (blue>0x7f)
3410- blue=0x7f;
3411- field = packet.getField("hid","pad_"+index+"_red");
3412- field.value = red;
3413- field = packet.getField("hid","pad_"+index+"_green");
3414- field.value = green;
3415- field = packet.getField("hid","pad_"+index+"_blue");
3416- field.value = blue;
3417- }
3418-
3419- // reset all lights to off state
3420- this.resetLights = function() {
3421- var controller = this.controller;
3422- var packet = controller.getOutputPacket("lights");
3423- for (var group_name in packet.groups) {
3424- var group = packet.groups[group_name];
3425- for (var field_name in group) {
3426- var field = group[field_name];
3427- field.value = 0;
3428- }
3429- }
3430- packet.send();
3431- }
3432-
3433- // Send update for LED packets after LED state modifications
3434- this.updateLEDs = function() {
3435- var packet = this.controller.getOutputPacket("lights");
3436- packet.send();
3437- }
3438-
3439-}
3440-
3441-KontrolF1Samplers = new KontrolF1Controller();
3442-
3443-KontrolF1Samplers.init = function (id) {
3444- KontrolF1Samplers.id = id;
3445- KontrolF1Samplers.initializeHIDController();
3446-
3447- var controller = KontrolF1Samplers.controller;
3448-
3449- // Scratch parameters
3450- controller.scratchintervalsPerRev = 256;
3451- controller.scratchAlpha = 1.0/8;
3452- controller.rampedScratchEnable = true;
3453- controller.rampedScratchEnable = true;
3454-
3455- controller.postProcessDelta = KontrolF1Samplers.ButtonLEDPressUpdate;
3456-
3457- // Link controls and register callbacks
3458- KontrolF1Samplers.registerCallbacks();
3459-
3460- // Reset all lights to off state
3461- KontrolF1Samplers.resetLights();
3462- KontrolF1Samplers.initializeLEDs();
3463-
3464- //engine.softTakeover("[Master]","headVolume",true);
3465- //engine.softTakeover("[Master]","headMix",true);
3466- //for (var deck in KontrolF1Samplers.deckLEDColors) {
3467- // engine.softTakeover("[Channel"+deck+"]","pregain",true);
3468- // engine.softTakeover("[Channel"+deck+"]","volume",true);
3469- //}
3470-
3471- // Timers can't be defined in prototype with this.
3472- if (KontrolF1Samplers.LEDUpdateInterval!=undefined) {
3473- KontrolF1Samplers.LEDTimer = engine.beginTimer(
3474- KontrolF1Samplers.LEDUpdateInterval,
3475- "KontrolF1Samplers.controller.updateLEDs(true)"
3476- );
3477- }
3478- HIDDebug("NI Traktor F1 "+KontrolF1Samplers.id+" initialized");
3479-}
3480-
3481-// Device cleanup function
3482-KontrolF1Samplers.shutdown = function() {
3483- if (KontrolF1Samplers.LEDTimer!=undefined) {
3484- engine.stopTimer(KontrolF1Samplers.LEDTimer);
3485- KontrolF1Samplers.LEDTimer = undefined;
3486- }
3487-
3488- //engine.softTakeover("[Master]","headVolume",false);
3489- //engine.softTakeover("[Master]","headMix",false);
3490- //for (var deck in KontrolF1Samplers.deckLEDColors) {
3491- // engine.softTakeover("[Channel"+deck+"]","pregain",false);
3492- // engine.softTakeover("[Channel"+deck+"]","volume",false);
3493- //}
3494-
3495- KontrolF1Samplers.shutdownHardware(2);
3496- HIDDebug("NI Traktor F1 "+KontrolF1Samplers.id+" shut down");
3497-}
3498-
3499-// Mandatory default handler for incoming packets
3500-KontrolF1Samplers.incomingData = function(data,length) {
3501- KontrolF1Samplers.controller.parsePacket(data,length);
3502-}
3503-
3504-// Handle button LED updates after packet receive if required:
3505-// F1 will reset LEDs to a default state without this
3506-KontrolF1Samplers.ButtonLEDPressUpdate = function(packet,changed_data) {
3507- var send_led_update = false;
3508- for (var field in changed_data) {
3509- var delta = changed_data[field];
3510- var name = field.split(".")[1]
3511- // Select encoder also resets LEDs for some reason
3512- if (field=="select_encoder") {
3513- send_led_update = true;
3514- break;
3515- }
3516- // Update leds if any of these buttons were modified in packet
3517- if (KontrolF1Samplers.buttonNames.indexOf(name)!=-1) {
3518- if (delta.value==1)
3519- KontrolF1Samplers.setButtonBrightness(name,0x7f);
3520- if (delta.value==0)
3521- KontrolF1Samplers.setButtonBrightness(name,0);
3522- send_led_update = true;
3523- break;
3524- }
3525- // Update leds if any of pads was pressed
3526- if (/pad_[0-9]+_button/.test(name)) {
3527- send_led_update = true;
3528- break;
3529- }
3530- }
3531- if (send_led_update)
3532- KontrolF1Samplers.updateLEDs();
3533-}
3534-
3535-// Initialize LED states from mixxx sampler details
3536-KontrolF1Samplers.initializeLEDs = function() {
3537- var value;
3538- for (var i=1;i<=4;i++) {
3539- var sampler = "[Sampler"+i+"]";
3540- value = (engine.getValue(sampler,"play")==1) ? 0x7f :0;
3541- KontrolF1Samplers.setButtonBrightness("stop_"+i+"_1",value);
3542- KontrolF1Samplers.setButtonBrightness("stop_"+i+"_2",value);
3543-
3544- for (var j=1;j<=4;j++) {
3545- var button = 4*(j-1)+i;
3546- if (engine.getValue(sampler,"hotcue_"+j+"_enabled"))
3547- value = KontrolF1Samplers.padColorSet[j];
3548- else
3549- value = [0,0,0];
3550- KontrolF1Samplers.setPADColor(button,value[0],value[1],value[2]);
3551- }
3552- }
3553-
3554- KontrolF1Samplers.updateLEDs();
3555-}
3556-
3557-// Mandatory LED update callback handler
3558-KontrolF1Samplers.activeLEDUpdateWrapper = function() {
3559- KontrolF1Samplers.controller.updateActiveDeckLEDs();
3560-}
3561-
3562-// Link virtual HID naming of input and LED controls to mixxx
3563-// Note: HID specification has more fields than we map here.
3564-KontrolF1Samplers.registerCallbacks = function() {
3565- var controller = KontrolF1Samplers.controller;
3566-
3567- print("Registering HID callbacks");
3568- controller.linkControl("hid","knob_1","[Sampler1]","rate");
3569- controller.linkControl("hid","knob_2","[Sampler2]","rate");
3570- controller.linkControl("hid","knob_3","[Sampler3]","rate");
3571- controller.linkControl("hid","knob_4","[Sampler4]","rate");
3572- controller.linkControl("hid","knob_5","[Sampler1]","pregain");
3573- controller.linkControl("hid","knob_6","[Sampler2]","pregain");
3574- controller.linkControl("hid","knob_7","[Sampler3]","pregain");
3575- controller.linkControl("hid","knob_8","[Sampler4]","pregain");
3576- controller.setScaler("rate",KontrolF1Samplers.rateScaler);
3577- controller.setScaler("pregain",KontrolF1Samplers.volumeScaler);
3578-
3579- controller.linkControl("hid","select_encoder","[Playlist]","SelectTrackKnob");
3580- controller.linkControl("hid","select_push","[Playlist]","LoadSelectedIntoFirstStopped");
3581- controller.linkModifier("hid","shift","shift");
3582-
3583- controller.linkControl("hid","stop_1","[Sampler1]","play",KontrolF1Samplers.play_load);
3584- controller.linkControl("hid","stop_2","[Sampler2]","play",KontrolF1Samplers.play_load);
3585- controller.linkControl("hid","stop_3","[Sampler3]","play",KontrolF1Samplers.play_load);
3586- controller.linkControl("hid","stop_4","[Sampler4]","play",KontrolF1Samplers.play_load);
3587-
3588- controller.setCallback("control","hid","pad_1_button",KontrolF1Samplers.hotcue);
3589- controller.setCallback("control","hid","pad_2_button",KontrolF1Samplers.hotcue);
3590- controller.setCallback("control","hid","pad_3_button",KontrolF1Samplers.hotcue);
3591- controller.setCallback("control","hid","pad_4_button",KontrolF1Samplers.hotcue);
3592- controller.setCallback("control","hid","pad_5_button",KontrolF1Samplers.hotcue);
3593- controller.setCallback("control","hid","pad_6_button",KontrolF1Samplers.hotcue);
3594- controller.setCallback("control","hid","pad_7_button",KontrolF1Samplers.hotcue);
3595- controller.setCallback("control","hid","pad_8_button",KontrolF1Samplers.hotcue);
3596- controller.setCallback("control","hid","pad_9_button",KontrolF1Samplers.hotcue);
3597- controller.setCallback("control","hid","pad_10_button",KontrolF1Samplers.hotcue);
3598- controller.setCallback("control","hid","pad_11_button",KontrolF1Samplers.hotcue);
3599- controller.setCallback("control","hid","pad_12_button",KontrolF1Samplers.hotcue);
3600- controller.setCallback("control","hid","pad_13_button",KontrolF1Samplers.hotcue);
3601- controller.setCallback("control","hid","pad_14_button",KontrolF1Samplers.hotcue);
3602- controller.setCallback("control","hid","pad_15_button",KontrolF1Samplers.hotcue);
3603- controller.setCallback("control","hid","pad_16_button",KontrolF1Samplers.hotcue);
3604-
3605- engine.connectControl("[Sampler1]","play",KontrolF1Samplers.updateButtonLEDState);
3606- engine.connectControl("[Sampler1]","hotcue_1_enabled",KontrolF1Samplers.updatePadLEDState);
3607- engine.connectControl("[Sampler1]","hotcue_2_enabled",KontrolF1Samplers.updatePadLEDState);
3608- engine.connectControl("[Sampler1]","hotcue_3_enabled",KontrolF1Samplers.updatePadLEDState);
3609- engine.connectControl("[Sampler1]","hotcue_4_enabled",KontrolF1Samplers.updatePadLEDState);
3610-
3611- engine.connectControl("[Sampler2]","play",KontrolF1Samplers.updateButtonLEDState);
3612- engine.connectControl("[Sampler2]","hotcue_1_enabled",KontrolF1Samplers.updatePadLEDState);
3613- engine.connectControl("[Sampler2]","hotcue_2_enabled",KontrolF1Samplers.updatePadLEDState);
3614- engine.connectControl("[Sampler2]","hotcue_3_enabled",KontrolF1Samplers.updatePadLEDState);
3615- engine.connectControl("[Sampler2]","hotcue_4_enabled",KontrolF1Samplers.updatePadLEDState);
3616-
3617- engine.connectControl("[Sampler3]","play",KontrolF1Samplers.updateButtonLEDState);
3618- engine.connectControl("[Sampler3]","hotcue_1_enabled",KontrolF1Samplers.updatePadLEDState);
3619- engine.connectControl("[Sampler3]","hotcue_2_enabled",KontrolF1Samplers.updatePadLEDState);
3620- engine.connectControl("[Sampler3]","hotcue_3_enabled",KontrolF1Samplers.updatePadLEDState);
3621- engine.connectControl("[Sampler3]","hotcue_4_enabled",KontrolF1Samplers.updatePadLEDState);
3622-
3623- engine.connectControl("[Sampler4]","play",KontrolF1Samplers.updateButtonLEDState);
3624- engine.connectControl("[Sampler4]","hotcue_1_enabled",KontrolF1Samplers.updatePadLEDState);
3625- engine.connectControl("[Sampler4]","hotcue_2_enabled",KontrolF1Samplers.updatePadLEDState);
3626- engine.connectControl("[Sampler4]","hotcue_3_enabled",KontrolF1Samplers.updatePadLEDState);
3627- engine.connectControl("[Sampler4]","hotcue_4_enabled",KontrolF1Samplers.updatePadLEDState);
3628-
3629-}
3630-
3631-KontrolF1Samplers.updateButtonLEDState = function(value,group,key) {
3632- if (! /^\[Sampler[0-9]+\]$/.test(group))
3633- return;
3634- var sampler = parseInt(group.substring(8,group.length-1));
3635- if (key=="play") {
3636- value = (value==1) ? 0x7f : 0;
3637- KontrolF1Samplers.setButtonBrightness("stop_"+sampler+"_1",value);
3638- KontrolF1Samplers.setButtonBrightness("stop_"+sampler+"_2",value);
3639- // Seek end of track decks back to start
3640- if (value==0 && engine.getValue(group,"playposition")>0.99) {
3641- engine.setValue(group,"playposition",0);
3642- }
3643- }
3644- KontrolF1Samplers.updateLEDs();
3645-}
3646-
3647-KontrolF1Samplers.updatePadLEDState = function(value,group,key) {
3648- if (! /^\[Sampler[0-9]+\]$/.test(group))
3649- return;
3650- if (! /^hotcue_[0-9]_enabled$/.test(key))
3651- return;
3652- var sampler = parseInt(group.substring(8,group.length-1));
3653- var hotcue = parseInt(key.split("_")[1]);
3654- var button = 4*(hotcue-1) + sampler;
3655- var color;
3656-
3657- if (value==1)
3658- color = KontrolF1Samplers.padColorSet[hotcue];
3659- if (value==0)
3660- color = [0,0,0];
3661- if (color==undefined)
3662- return;
3663- KontrolF1Samplers.setPADColor(button,color[0],color[1],color[2]);
3664- KontrolF1Samplers.updateLEDs();
3665-}
3666-
3667-KontrolF1Samplers.play_load = function(field) {
3668- var controller = KontrolF1Samplers.controller;
3669- if (controller.modifiers.get("shift"))
3670- engine.setValue(field.mapped_group,"LoadSelectedTrack",true);
3671- else
3672- controller.togglePlay(field.mapped_group,field);
3673-}
3674-
3675-// Hotcues activated with normal press, cleared with shift
3676-KontrolF1Samplers.hotcue = function (field) {
3677- var controller = KontrolF1Samplers.controller;
3678- var command;
3679-
3680- // Only valid for 'pad' buttons named pad_<number>_button
3681- if (! /pad_[0-9]+_button/.test(field.name))
3682- return;
3683-
3684- var color = undefined;
3685- var hotcue = undefined;
3686- var button = field.name.split("_")[1];
3687- var sampler = "[Sampler"+ (1+(button-1)%4) + "]";
3688- if (button>12) hotcue = 4;
3689- else if (button>8) hotcue = 3;
3690- else if (button>4) hotcue = 2;
3691- else hotcue = 1;
3692-
3693- if (controller.modifiers.get("shift")) {
3694- command = "hotcue_" + hotcue + "_clear";
3695- } else {
3696- if (field.value==1)
3697- color = KontrolF1Samplers.padColorActive[hotcue];
3698- if (field.value==0)
3699- if (engine.getValue(sampler,"hotcue_"+hotcue+"_enabled"))
3700- color = KontrolF1Samplers.padColorSet[hotcue];
3701- else
3702- color = [0,0,0];
3703- if (color!=undefined)
3704- KontrolF1Samplers.setPADColor(button,color[0],color[1],color[2]);
3705- command = "hotcue_" + hotcue + "_activate";
3706- }
3707-
3708- if (field.value==1)
3709- engine.setValue(sampler,command,true);
3710-}
3711-
3712
3713=== added file 'mixxx/res/controllers/Traktor-Kontrol-F1-scripts.js'
3714--- mixxx/res/controllers/Traktor-Kontrol-F1-scripts.js 1970-01-01 00:00:00 +0000
3715+++ mixxx/res/controllers/Traktor-Kontrol-F1-scripts.js 2012-08-08 11:20:30 +0000
3716@@ -0,0 +1,788 @@
3717+//
3718+// Native Instruments Traktor Kontrol F1 HID controller script v0.9
3719+// Copyright (C) 2012, Ilkka Tuohela
3720+// For Mixxx version 1.11.x
3721+//
3722+
3723+// Native Instruments Traktor Kontrol F1 HID interface specification
3724+function KontrolF1Controller() {
3725+ this.controller = new HIDController();
3726+
3727+ // Initialized to firmware version by version response packet
3728+ this.version_major = undefined;
3729+ this.version_minor = undefined;
3730+ this.controller.activeDeck = 1;
3731+
3732+ // F1 PAD LEDs are special, it has full RGB control with three bytes,
3733+ // we can't use normal LEDColors directly. Define here some basic
3734+ // colors, allow using full RGB values with script
3735+
3736+ this.buttonNames = [
3737+ "sync","quant","capture","shift",
3738+ "reverse","type","size","browse",
3739+ "play_1_1","play_1_2","play_2_1","play_2_2",
3740+ "play_3_1","play_3_2","play_4_1","play_4_2"
3741+ ];
3742+
3743+ this.registerInputPackets = function() {
3744+ var packet = undefined;
3745+
3746+ packet = new HIDPacket("control",[0x1],22);
3747+ packet.addControl("hid","grid_8",1,"I",0x1);
3748+ packet.addControl("hid","grid_7",1,"I",0x2);
3749+ packet.addControl("hid","grid_6",1,"I",0x4);
3750+ packet.addControl("hid","grid_5",1,"I",0x8);
3751+ packet.addControl("hid","grid_4",1,"I",0x10);
3752+ packet.addControl("hid","grid_3",1,"I",0x20);
3753+ packet.addControl("hid","grid_2",1,"I",0x40);
3754+ packet.addControl("hid","grid_1",1,"I",0x80);
3755+ packet.addControl("hid","grid_16",1,"I",0x100);
3756+ packet.addControl("hid","grid_15",1,"I",0x200);
3757+ packet.addControl("hid","grid_14",1,"I",0x400);
3758+ packet.addControl("hid","grid_13",1,"I",0x800);
3759+ packet.addControl("hid","grid_12",1,"I",0x1000);
3760+ packet.addControl("hid","grid_11",1,"I",0x2000);
3761+ packet.addControl("hid","grid_10",1,"I",0x4000);
3762+ packet.addControl("hid","grid_9",1,"I",0x8000);
3763+ packet.addControl("hid","shift",1,"I",0x800000);
3764+ packet.addControl("hid","reverse",1,"I",0x400000);
3765+ packet.addControl("hid","size",1,"I",0x100000);
3766+ packet.addControl("hid","type",1,"I",0x200000);
3767+ packet.addControl("hid","select_push",1,"I",0x40000);
3768+ packet.addControl("hid","browse",1,"I",0x80000);
3769+ packet.addControl("hid","play_1",1,"I",0x80000000);
3770+ packet.addControl("hid","play_2",1,"I",0x40000000);
3771+ packet.addControl("hid","play_3",1,"I",0x20000000);
3772+ packet.addControl("hid","play_4",1,"I",0x10000000);
3773+ packet.addControl("hid","sync",1,"I",0x8000000);
3774+ packet.addControl("hid","quant",1,"I",0x4000000);
3775+ packet.addControl("hid","capture",1,"I",0x2000000);
3776+ packet.addControl("hid","select_encoder",5,"B",undefined,true);
3777+
3778+ // Knobs have value range 0-4092, so while some controls are
3779+ // -1..0..1 range, hidparser will return same data as with h
3780+ // packing (16 bit range while we only use 12 bits)
3781+ packet.addControl("hid","knob_1",6,"H");
3782+ packet.addControl("hid","knob_2",8,"H");
3783+ packet.addControl("hid","knob_3",10,"H");
3784+ packet.addControl("hid","knob_4",12,"H");
3785+ packet.addControl("hid","fader_1",14,"H");
3786+ packet.addControl("hid","fader_2",16,"H");
3787+ packet.addControl("hid","fader_3",18,"H");
3788+ packet.addControl("hid","fader_4",20,"H");
3789+ this.controller.registerInputPacket(packet);
3790+
3791+ }
3792+
3793+ this.registerOutputPackets = function() {
3794+ var packet = undefined;
3795+
3796+ packet = new HIDPacket("lights",[0x80],81);
3797+ // Right 7-segment element - 0x0 off, 0x40 on
3798+ packet.addControl("hid","right_segment_dp",1,"B");
3799+ packet.addControl("hid","right_segment_a",2,"B");
3800+ packet.addControl("hid","right_segment_b",3,"B");
3801+ packet.addControl("hid","right_segment_c",4,"B");
3802+ packet.addControl("hid","right_segment_d",5,"B");
3803+ packet.addControl("hid","right_segment_e",6,"B");
3804+ packet.addControl("hid","right_segment_f",7,"B");
3805+ packet.addControl("hid","right_segment_g",8,"B");
3806+
3807+ // Left 7-segment element - 0x0 off, 0x40 on
3808+ packet.addControl("hid","left_segment_dp",9,"B");
3809+ packet.addControl("hid","left_segment_a",10,"B");
3810+ packet.addControl("hid","left_segment_b",11,"B");
3811+ packet.addControl("hid","left_segment_c",12,"B");
3812+ packet.addControl("hid","left_segment_d",13,"B");
3813+ packet.addControl("hid","left_segment_e",14,"B");
3814+ packet.addControl("hid","left_segment_f",15,"B");
3815+ packet.addControl("hid","left_segment_g",16,"B");
3816+
3817+ // Button led brightness, 0-0xff
3818+ packet.addControl("hid","browse_brightness",17,"B");
3819+ packet.addControl("hid","size_brightness",18,"B");
3820+ packet.addControl("hid","type_brightness",19,"B");
3821+ packet.addControl("hid","reverse_brightness",20,"B");
3822+ packet.addControl("hid","shift_brightness",21,"B");
3823+ packet.addControl("hid","capture_brightness",22,"B");
3824+ packet.addControl("hid","quant_brightness",23,"B");
3825+ packet.addControl("hid","sync_brightness",24,"B");
3826+
3827+ // Pad RGB color button controls, 3 bytes per pad
3828+ packet.addControl("hid","grid_1_blue",25,"B")
3829+ packet.addControl("hid","grid_1_red",26,"B")
3830+ packet.addControl("hid","grid_1_green",27,"B")
3831+ packet.addControl("hid","grid_2_blue",28,"B")
3832+ packet.addControl("hid","grid_2_red",29,"B")
3833+ packet.addControl("hid","grid_2_green",30,"B")
3834+ packet.addControl("hid","grid_3_blue",31,"B")
3835+ packet.addControl("hid","grid_3_red",32,"B")
3836+ packet.addControl("hid","grid_3_green",33,"B")
3837+ packet.addControl("hid","grid_4_blue",34,"B")
3838+ packet.addControl("hid","grid_4_red",35,"B")
3839+ packet.addControl("hid","grid_4_green",36,"B")
3840+ packet.addControl("hid","grid_5_blue",37,"B")
3841+ packet.addControl("hid","grid_5_red",38,"B")
3842+ packet.addControl("hid","grid_5_green",39,"B")
3843+ packet.addControl("hid","grid_6_blue",40,"B")
3844+ packet.addControl("hid","grid_6_red",41,"B")
3845+ packet.addControl("hid","grid_6_green",42,"B")
3846+ packet.addControl("hid","grid_7_blue",43,"B")
3847+ packet.addControl("hid","grid_7_red",44,"B")
3848+ packet.addControl("hid","grid_7_green",45,"B")
3849+ packet.addControl("hid","grid_8_blue",46,"B")
3850+ packet.addControl("hid","grid_8_red",47,"B")
3851+ packet.addControl("hid","grid_8_green",48,"B")
3852+ packet.addControl("hid","grid_9_blue",49,"B")
3853+ packet.addControl("hid","grid_9_red",50,"B")
3854+ packet.addControl("hid","grid_9_green",51,"B")
3855+ packet.addControl("hid","grid_10_blue",52,"B")
3856+ packet.addControl("hid","grid_10_red",53,"B")
3857+ packet.addControl("hid","grid_10_green",54,"B")
3858+ packet.addControl("hid","grid_11_blue",55,"B")
3859+ packet.addControl("hid","grid_11_red",56,"B")
3860+ packet.addControl("hid","grid_11_green",57,"B")
3861+ packet.addControl("hid","grid_12_blue",58,"B")
3862+ packet.addControl("hid","grid_12_red",59,"B")
3863+ packet.addControl("hid","grid_12_green",60,"B")
3864+ packet.addControl("hid","grid_13_blue",61,"B")
3865+ packet.addControl("hid","grid_13_red",62,"B")
3866+ packet.addControl("hid","grid_13_green",63,"B")
3867+ packet.addControl("hid","grid_14_blue",64,"B")
3868+ packet.addControl("hid","grid_14_red",65,"B")
3869+ packet.addControl("hid","grid_14_green",66,"B")
3870+ packet.addControl("hid","grid_15_blue",67,"B")
3871+ packet.addControl("hid","grid_15_red",68,"B")
3872+ packet.addControl("hid","grid_15_green",69,"B")
3873+ packet.addControl("hid","grid_16_blue",70,"B")
3874+ packet.addControl("hid","grid_16_red",71,"B")
3875+ packet.addControl("hid","grid_16_green",72,"B")
3876+
3877+ // Play key brightness control, 0-0xff
3878+ packet.addControl("hid","play_4_1_brightness",73,"B");
3879+ packet.addControl("hid","play_4_2_brightness",74,"B");
3880+ packet.addControl("hid","play_3_1_brightness",75,"B");
3881+ packet.addControl("hid","play_3_2_brightness",76,"B");
3882+ packet.addControl("hid","play_2_1_brightness",77,"B");
3883+ packet.addControl("hid","play_2_2_brightness",78,"B");
3884+ packet.addControl("hid","play_1_1_brightness",79,"B");
3885+ packet.addControl("hid","play_1_2_brightness",80,"B");
3886+
3887+ this.controller.registerOutputPacket(packet);
3888+
3889+ }
3890+
3891+ this.initializeHIDController = function() {
3892+ this.scalers = new Object();
3893+ this.scalers["volume"] = function(value) {
3894+ return script.absoluteLin(value, 0, 1, 0, 4096);
3895+ }
3896+ this.scalers["pregain"] = function(value) {
3897+ return script.absoluteNonLin(value,0,1,5,0,4096);
3898+ }
3899+ this.scalers["rate"] = function(value) {
3900+ return script.absoluteLin(value,-1,1,0,4096);
3901+ }
3902+ this.scalers["ratereversed"] = function(value) {
3903+ return -script.absoluteLin(value,-1,1,0,4096);
3904+ }
3905+ this.scalers["plusminus"] = function(value) {
3906+ return script.absoluteLin(value,-1,1,0,4096);
3907+ }
3908+ this.scalers["eq"] = function(value) {
3909+ return script.absoluteNonLin(value, 0, 1, 4, 0, 4096);
3910+ }
3911+
3912+ this.registerInputPackets();
3913+ this.registerOutputPackets();
3914+ }
3915+
3916+ // Set brightness for single color buttons with brigthness adjustment
3917+ // Valid adjustment range is 0-0x7f
3918+ this.setButtonBrightness = function(name,value) {
3919+ var controller = this.controller;
3920+ var packet = controller.getOutputPacket("lights");
3921+ if (name.match(/grid_/)) {
3922+ HIDDebug("ERROR: set PAD colors with setPADColor");
3923+ return;
3924+ }
3925+ if (!name.match(/.*_brightness$/))
3926+ name = name + "_brightness";
3927+ var field = packet.getField("hid",name);
3928+ if (field==undefined) {
3929+ HIDDebug("button field not found: " + name);
3930+ return;
3931+ }
3932+ if (value<0)
3933+ value = 0;
3934+ if (value>0x7f)
3935+ value = 0x7f;
3936+ field.value = value;
3937+ }
3938+
3939+ // Set the 8 bytes in left or right 7-segment display. DP is the dot.
3940+ this.set7SegmentValue = function(name,dp,v1,v2,v3,v4,v5,v6,v7,v8) {
3941+ var controller = this.controller;
3942+ var packet = controller.getOutputPacket("lights");
3943+ var field = undefined;
3944+ field = packet.getField("hid",name+"_segment_dp");
3945+ field.value = dp;
3946+ field = packet.getField("hid",name+"_segment_a");
3947+ field.value = v1;
3948+ field = packet.getField("hid",name+"_segment_b");
3949+ field.value = v2;
3950+ field = packet.getField("hid",name+"_segment_c");
3951+ field.value = v3;
3952+ field = packet.getField("hid",name+"_segment_d");
3953+ field.value = v4;
3954+ field = packet.getField("hid",name+"_segment_e");
3955+ field.value = v5;
3956+ field = packet.getField("hid",name+"_segment_f");
3957+ field.value = v6;
3958+ field = packet.getField("hid",name+"_segment_g");
3959+ field.value = v7;
3960+ }
3961+
3962+ // Set RGB color for one of the 16 pads.
3963+ // Index is pad number index as 1-16.
3964+ // Valid range for each color is 0-0x7f.
3965+ this.setPADColor = function(index,red,green,blue) {
3966+ var controller = this.controller;
3967+ var packet = controller.getOutputPacket("lights");
3968+ var field = undefined;
3969+ if (index<=0 || index>16) {
3970+ HIDDebug("Invalid grid index" + index);
3971+ return;
3972+ }
3973+ if (red==undefined)
3974+ red=0;
3975+ if (red>0x7f)
3976+ red=0x7f;
3977+ field = packet.getField("hid","grid_"+index+"_red");
3978+ field.value = red;
3979+ if (green==undefined)
3980+ green=0;
3981+ if (green>0x7f)
3982+ green=0x7f;
3983+ field = packet.getField("hid","grid_"+index+"_green");
3984+ field.value = green;
3985+ if (blue==undefined)
3986+ blue=0;
3987+ if (blue>0x7f)
3988+ blue=0x7f;
3989+ field = packet.getField("hid","grid_"+index+"_blue");
3990+ field.value = blue;
3991+ }
3992+
3993+ // reset all lights to off state
3994+ this.resetLEDs = function() {
3995+ var controller = this.controller;
3996+ var packet = controller.getOutputPacket("lights");
3997+ for (var group_name in packet.groups) {
3998+ var group = packet.groups[group_name];
3999+ for (var field_name in group) {
4000+ var field = group[field_name];
4001+ field.value = 0;
4002+ }
4003+ }
4004+ packet.send();
4005+ }
4006+
4007+ // Send update for LED packets after LED state modifications
4008+ this.updateLEDs = function() {
4009+ var packet = this.controller.getOutputPacket("lights");
4010+ packet.send();
4011+ }
4012+
4013+}
4014+
4015+KontrolF1 = new KontrolF1Controller();
4016+
4017+KontrolF1.init = function (id) {
4018+ KontrolF1.id = id;
4019+
4020+ KontrolF1.controlModeButtons = { "decks": "capture", "samplers": "quant" };
4021+ KontrolF1.defaultControlMode = "decks";
4022+
4023+ KontrolF1.initializeHIDController();
4024+ var controller = KontrolF1.controller;
4025+
4026+ KontrolF1.knobs = new Object();
4027+ KontrolF1.faders = new Object();
4028+ KontrolF1.grids = new Object();
4029+ KontrolF1.playbuttons = new Object();
4030+
4031+ controller.postProcessDelta = KontrolF1.ButtonLEDPressUpdate;
4032+
4033+ KontrolF1.registerCallbacks();
4034+
4035+ KontrolF1.resetLEDs();
4036+ KontrolF1.setControlMode(KontrolF1.defaultControlMode);
4037+
4038+ // Timers can't be defined in prototype with this.
4039+ if (KontrolF1.LEDUpdateInterval!=undefined) {
4040+ KontrolF1.LEDTimer = engine.beginTimer(
4041+ KontrolF1.LEDUpdateInterval,
4042+ "KontrolF1.controller.updateLEDs(true)"
4043+ );
4044+ }
4045+ HIDDebug("NI Traktor F1 "+KontrolF1.id+" initialized");
4046+}
4047+
4048+// Device cleanup function
4049+KontrolF1.shutdown = function() {
4050+ if (KontrolF1.LEDTimer!=undefined) {
4051+ engine.stopTimer(KontrolF1.LEDTimer);
4052+ KontrolF1.LEDTimer = undefined;
4053+ }
4054+
4055+ KontrolF1.shutdownHardware(2);
4056+ HIDDebug("NI Traktor F1 "+KontrolF1.id+" shut down");
4057+}
4058+
4059+// Mandatory default handler for incoming packets
4060+KontrolF1.incomingData = function(data,length) {
4061+ KontrolF1.controller.parsePacket(data,length);
4062+}
4063+
4064+// Mandatory LED update callback handler
4065+KontrolF1.activeLEDUpdateWrapper = function() {
4066+ KontrolF1.controller.updateActiveDeckLEDs();
4067+}
4068+
4069+// Handle button LED updates after packet receive if required:
4070+// F1 will reset LEDs to a default state without this
4071+// Registered as packet post processing callback in init.
4072+KontrolF1.ButtonLEDPressUpdate = function(packet,changed_data) {
4073+ var send_led_update = false;
4074+ for (var field in changed_data) {
4075+ var delta = changed_data[field];
4076+ var name = field.split(".")[1]
4077+ // Select encoder also resets LEDs for some reason
4078+ if (field=="select_encoder") {
4079+ send_led_update = true;
4080+ break;
4081+ }
4082+ // Check if this is one of permanently lit LEDs
4083+ var controlmode = false;
4084+ for (mode in KontrolF1.controlModeButtons) {
4085+ if (KontrolF1.controlModeButtons[mode]==name) {
4086+ controlmode = true;
4087+ break;
4088+ }
4089+ }
4090+ if (controlmode) {
4091+ send_led_update = true;
4092+ break;
4093+ }
4094+
4095+ // Update leds if any of these buttons were modified in packet
4096+ if (KontrolF1.buttonNames.indexOf(name)!=-1) {
4097+ if (delta.value==1)
4098+ KontrolF1.setButtonBrightness(name,0x7f);
4099+ if (delta.value==0)
4100+ KontrolF1.setButtonBrightness(name,0);
4101+ send_led_update = true;
4102+ break;
4103+ }
4104+ // Update leds if any of pads was pressed
4105+ if (/grid_[0-9]/.test(name)) {
4106+ send_led_update = true;
4107+ break;
4108+ }
4109+ }
4110+ if (send_led_update)
4111+ KontrolF1.updateLEDs();
4112+}
4113+
4114+KontrolF1.disconnectModeLEDs = function(mode) {
4115+ var grid = KontrolF1.grids[mode];
4116+ var buttons = KontrolF1.playbuttons[mode];
4117+ for (var name in grid) {
4118+ var button = grid[name];
4119+ if (button.ledname==undefined)
4120+ continue
4121+ engine.connectControl(button.group, button.ledname,
4122+ KontrolF1.setLED, false
4123+ );
4124+ }
4125+ for (var name in buttons) {
4126+ var button = buttons[name];
4127+ var button_index = parseInt(name.split("_")[1]);
4128+ if (button.ledname==undefined)
4129+ continue;
4130+ engine.connectControl(button.group, button.ledname,
4131+ KontrolF1.setLED, false
4132+ );
4133+ }
4134+}
4135+
4136+KontrolF1.connectModeLEDs = function(mode) {
4137+ var grid = KontrolF1.grids[mode];
4138+ var buttons = KontrolF1.playbuttons[mode];
4139+
4140+ var color;
4141+ for (var name in grid) {
4142+ var button = grid[name];
4143+ var button_index = parseInt(name.split("_")[1]);
4144+ if (button.ledname==undefined)
4145+ continue;
4146+ engine.connectControl(button.group, button.ledname,
4147+ KontrolF1.setLED
4148+ );
4149+ if (engine.getValue(button.group, button.ledname))
4150+ value = button.ledcolor;
4151+ else
4152+ value = 0,0,0;
4153+ KontrolF1.setPADColor(button_index,value[0],value[1],value[2]);
4154+ }
4155+ for (var name in buttons) {
4156+ var button = buttons[name];
4157+ var button_index = parseInt(name.split("_")[1]);
4158+ if (button.ledname==undefined)
4159+ continue;
4160+ engine.connectControl(button.group, button.ledname,
4161+ KontrolF1.setLED
4162+ );
4163+ value = (engine.getValue(button.group,button.name)==1) ? 0x7f :0;
4164+ KontrolF1.setButtonBrightness("play_"+button_index+"_1",value);
4165+ KontrolF1.setButtonBrightness("play_"+button_index+"_2",value);
4166+ }
4167+ KontrolF1.updateLEDs();
4168+}
4169+
4170+KontrolF1.setLED = function(value,group,key) {
4171+ var grid = KontrolF1.grids[KontrolF1.controlMode];
4172+ var buttons = KontrolF1.playbuttons[KontrolF1.controlMode];
4173+ var matched = false;
4174+
4175+ for (var name in grid) {
4176+ var button = grid[name];
4177+ var button_index = parseInt(name.split("_")[1]);
4178+ if (button.group!=group || button.ledname!=key)
4179+ continue;
4180+ if (value)
4181+ value = button.ledcolor;
4182+ else
4183+ value = 0,0,0;
4184+ KontrolF1.setPADColor(button_index,value[0],value[1],value[2]);
4185+ matched = true;
4186+ break;
4187+ }
4188+ for (var name in buttons) {
4189+ var button = buttons[name];
4190+ var button_index = parseInt(name.split("_")[1]);
4191+ if (button.group!=group || button.name!=key)
4192+ continue;
4193+ value = (value==1) ? 0x7f : 0;
4194+ KontrolF1.setButtonBrightness("play_"+button_index+"_1",value);
4195+ KontrolF1.setButtonBrightness("play_"+button_index+"_2",value);
4196+ matched = true;
4197+ break;
4198+ }
4199+ KontrolF1.updateLEDs();
4200+}
4201+
4202+KontrolF1.linkKnob = function(mode,knob,group,name,scaler) {
4203+ if (!(mode in KontrolF1.knobs))
4204+ KontrolF1.knobs[mode] = new Object();
4205+ var mapping = new Object();
4206+ mapping.mode = mode;
4207+ mapping.knob = knob;
4208+ mapping.group = group;
4209+ mapping.name = name;
4210+ mapping.scaler = scaler;
4211+ KontrolF1.knobs[mode][knob] = mapping;
4212+}
4213+
4214+KontrolF1.knob = function(field) {
4215+ var controller = KontrolF1.controller;
4216+ var mode = KontrolF1.knobs[KontrolF1.controlMode];
4217+ if (mode==undefined) {
4218+ HIDDebug("Knob group not mapped in mode " + KontrolF1.controlMode);
4219+ return;
4220+ }
4221+ var knob = mode[field.name];
4222+ if (knob==undefined) {
4223+ HIDDebug("Fader "+field.name+ " not mapped in " + KontrolF1.controlMode);
4224+ return;
4225+ }
4226+ return KontrolF1.control(knob,field);
4227+}
4228+
4229+KontrolF1.linkFader = function(mode,fader,group,name,scaler,callback) {
4230+ if (!(mode in KontrolF1.faders))
4231+ KontrolF1.faders[mode] = new Object();
4232+ var mapping = new Object();
4233+ mapping.mode = mode;
4234+ mapping.fader = fader;
4235+ mapping.group = group;
4236+ mapping.name = name;
4237+ mapping.scaler = scaler;
4238+ mapping.callback = callback;
4239+ KontrolF1.faders[mode][fader] = mapping;
4240+}
4241+
4242+KontrolF1.fader = function(field) {
4243+ var controller = KontrolF1.controller;
4244+ var mode = KontrolF1.faders[KontrolF1.controlMode];
4245+ if (mode==undefined) {
4246+ HIDDebug("Fader group not mapped in mode " + KontrolF1.controlMode);
4247+ return;
4248+ }
4249+ var fader = mode[field.name];
4250+ if (fader==undefined) {
4251+ HIDDebug("Fader "+field.name+ " not mapped in " + KontrolF1.controlMode);
4252+ return;
4253+ }
4254+ return KontrolF1.control(fader,field);
4255+}
4256+
4257+KontrolF1.linkGrid = function(mode,button,group,name,toggle,callback,ledcolor,ledname) {
4258+ if (!(mode in KontrolF1.grids))
4259+ KontrolF1.grids[mode] = new Object();
4260+ if (ledname==undefined) {
4261+ if (name.match(/hotcue_[0-9]/))
4262+ ledname = name + '_enabled';
4263+ else
4264+ ledname = name;
4265+ }
4266+ if (ledcolor==undefined) {
4267+ ledcolor = [0x7f,0x7f,0x7f];
4268+ }
4269+ var mapping = new Object();
4270+ mapping.mode = mode;
4271+ mapping.button = button;
4272+ mapping.group = group;
4273+ mapping.name = name;
4274+ mapping.toggle = toggle;
4275+ mapping.ledname = ledname;
4276+ mapping.ledcolor = ledcolor;
4277+ mapping.callback = callback;
4278+ KontrolF1.grids[mode][button] = mapping;
4279+}
4280+
4281+KontrolF1.grid = function(field) {
4282+ var mode = KontrolF1.grids[KontrolF1.controlMode];
4283+ if (mode==undefined) {
4284+ HIDDebug("Grid button group not mapped in " + KontrolF1.controlMode);
4285+ return;
4286+ }
4287+ var button = mode[field.name];
4288+ if (button==undefined) {
4289+ HIDDebug("Grid "+field.name+ " not mapped in " + KontrolF1.controlMode);
4290+ return;
4291+ }
4292+ return KontrolF1.button(button,field);
4293+}
4294+
4295+KontrolF1.linkPlay = function(mode,button,group,name,toggle,callback,ledname) {
4296+ if (!(mode in KontrolF1.playbuttons))
4297+ KontrolF1.playbuttons[mode] = new Object();
4298+
4299+ if (ledname==undefined) {
4300+ if (name.match(/hotcue_[0-9]/))
4301+ ledname = name + '_enabled';
4302+ else
4303+ ledname = name;
4304+ }
4305+ var mapping = new Object();
4306+ mapping.mode = mode;
4307+ mapping.button = button;
4308+ mapping.group = group;
4309+ mapping.name = name;
4310+ mapping.toggle = toggle;
4311+ mapping.ledname = ledname;
4312+ mapping.callback = callback;
4313+ KontrolF1.playbuttons[mode][button] = mapping;
4314+}
4315+
4316+KontrolF1.play = function(field) {
4317+ var mode = KontrolF1.playbuttons[KontrolF1.controlMode];
4318+ if (mode==undefined) {
4319+ HIDDebug("Play button group not mapped in " + KontrolF1.controlMode);
4320+ return;
4321+ }
4322+ var button = mode[field.name];
4323+ if (button==undefined) {
4324+ HIDDebug("Play button "+field.name+ " not mapped in " + KontrolF1.controlMode);
4325+ return;
4326+ }
4327+ return KontrolF1.button(button,field);
4328+}
4329+
4330+KontrolF1.control = function(control,field) {
4331+ if (control.callback!=undefined) {
4332+ control.callback(control,field);
4333+ return;
4334+ }
4335+ var scaler = KontrolF1.scalers[control.scaler];
4336+ engine.setValue(control.group,control.name,scaler(field.value));
4337+}
4338+
4339+KontrolF1.button = function(button,field) {
4340+ var controller = KontrolF1.controller;
4341+ if (button.callback!=undefined) {
4342+ button.callback(button,field);
4343+ return;
4344+ }
4345+ if (button.toggle) {
4346+ if (button.name=='play')
4347+ controller.togglePlay(button.group,field);
4348+ else
4349+ controller.toggle(button.group,button.name,field.value);
4350+ } else {
4351+ var value = (field.value==1) ? true : false;
4352+ engine.setValue(button.group,button.name,value);
4353+ }
4354+}
4355+
4356+KontrolF1.switchControlMode = function(field) {
4357+ if (field.name=='quant') {
4358+ KontrolF1.setControlMode("samplers");
4359+ } else if (field.name=='capture') {
4360+ KontrolF1.setControlMode("decks");
4361+ } else {
4362+ HIDDebug("Unconfigured mode selector button: " + field.name);
4363+ return;
4364+ }
4365+}
4366+
4367+KontrolF1.setControlMode = function(mode) {
4368+ if (mode==KontrolF1.controlMode)
4369+ return;
4370+ if (!(mode in KontrolF1.controlModeButtons)) {
4371+ HIDDebug("Unconfigured control mode: " + mode);
4372+ return;
4373+ }
4374+
4375+ if (KontrolF1.controlMode!=undefined) {
4376+ KontrolF1.disconnectModeLEDs(KontrolF1.controlMode);
4377+ KontrolF1.setButtonBrightness(
4378+ KontrolF1.controlModeButtons[KontrolF1.controlMode],0
4379+ );
4380+ }
4381+ KontrolF1.controlMode = mode;
4382+ led = KontrolF1.controlModeButtons[mode];
4383+ KontrolF1.connectModeLEDs(KontrolF1.controlMode);
4384+ KontrolF1.setButtonBrightness(
4385+ KontrolF1.controlModeButtons[KontrolF1.controlMode],0x7f
4386+ );
4387+ KontrolF1.updateLEDs();
4388+}
4389+
4390+KontrolF1.registerCallbacks = function() {
4391+ var controller = KontrolF1.controller;
4392+
4393+ HIDDebug("Registering HID callbacks");
4394+
4395+ controller.linkControl("hid","select_encoder","[Playlist]","SelectTrackKnob");
4396+ controller.linkControl("hid","select_push","[Playlist]","LoadSelectedIntoFirstStopped");
4397+ controller.linkModifier("hid","shift","shift");
4398+
4399+ controller.setCallback("control","hid","capture",KontrolF1.switchControlMode);
4400+ controller.setCallback("control","hid","quant",KontrolF1.switchControlMode);
4401+
4402+ controller.setCallback("control","hid","knob_1",KontrolF1.knob);
4403+ controller.setCallback("control","hid","knob_2",KontrolF1.knob);
4404+ controller.setCallback("control","hid","knob_3",KontrolF1.knob);
4405+ controller.setCallback("control","hid","knob_4",KontrolF1.knob);
4406+
4407+ controller.setCallback("control","hid","fader_1",KontrolF1.fader);
4408+ controller.setCallback("control","hid","fader_2",KontrolF1.fader);
4409+ controller.setCallback("control","hid","fader_3",KontrolF1.fader);
4410+ controller.setCallback("control","hid","fader_4",KontrolF1.fader);
4411+
4412+ controller.setCallback("control","hid","grid_1",KontrolF1.grid);
4413+ controller.setCallback("control","hid","grid_2",KontrolF1.grid);
4414+ controller.setCallback("control","hid","grid_3",KontrolF1.grid);
4415+ controller.setCallback("control","hid","grid_4",KontrolF1.grid);
4416+ controller.setCallback("control","hid","grid_5",KontrolF1.grid);
4417+ controller.setCallback("control","hid","grid_6",KontrolF1.grid);
4418+ controller.setCallback("control","hid","grid_7",KontrolF1.grid);
4419+ controller.setCallback("control","hid","grid_8",KontrolF1.grid);
4420+ controller.setCallback("control","hid","grid_9",KontrolF1.grid);
4421+ controller.setCallback("control","hid","grid_10",KontrolF1.grid);
4422+ controller.setCallback("control","hid","grid_11",KontrolF1.grid);
4423+ controller.setCallback("control","hid","grid_12",KontrolF1.grid);
4424+ controller.setCallback("control","hid","grid_13",KontrolF1.grid);
4425+ controller.setCallback("control","hid","grid_14",KontrolF1.grid);
4426+ controller.setCallback("control","hid","grid_15",KontrolF1.grid);
4427+ controller.setCallback("control","hid","grid_16",KontrolF1.grid);
4428+
4429+ controller.setCallback("control","hid","play_1",KontrolF1.play);
4430+ controller.setCallback("control","hid","play_2",KontrolF1.play);
4431+ controller.setCallback("control","hid","play_3",KontrolF1.play);
4432+ controller.setCallback("control","hid","play_4",KontrolF1.play);
4433+
4434+ KontrolF1.linkKnob("decks","knob_1","[Master]","headVolume","pregain");
4435+ KontrolF1.linkKnob("decks","knob_2","[Master]","headMix","plusminus");
4436+ KontrolF1.linkKnob("decks","knob_3","[Master]","balance","plusminus");
4437+ KontrolF1.linkKnob("decks","knob_4","[Master]","volume","pregain");
4438+ KontrolF1.linkFader("decks","fader_1","[Channel1]","rate","rate");
4439+ KontrolF1.linkFader("decks","fader_2","[Channel1]","volume","volume");
4440+ KontrolF1.linkFader("decks","fader_3","[Channel2]","volume","volume");
4441+ KontrolF1.linkFader("decks","fader_4","[Channel2]","rate","rate");
4442+ KontrolF1.linkGrid("decks","grid_1","[Channel1]","hotcue_1",false,KontrolF1.hotcue,[0x7f,0x7f,0x0]);
4443+ KontrolF1.linkGrid("decks","grid_2","[Channel1]","hotcue_2",false,KontrolF1.hotcue,[0x7f,0x0,0x7f]);
4444+ KontrolF1.linkGrid("decks","grid_3","[Channel2]","hotcue_1",false,KontrolF1.hotcue,[0x7f,0x7f,0x0]);
4445+ KontrolF1.linkGrid("decks","grid_4","[Channel2]","hotcue_2",false,KontrolF1.hotcue,[0x7f,0x0,0x7f]);
4446+ KontrolF1.linkGrid("decks","grid_5","[Channel1]","hotcue_3",false,KontrolF1.hotcue,[0x0,0x40,0x7f]);
4447+ KontrolF1.linkGrid("decks","grid_6","[Channel1]","hotcue_4",false,KontrolF1.hotcue,[0x0,0x7f,0x0]);
4448+ KontrolF1.linkGrid("decks","grid_7","[Channel2]","hotcue_3",false,KontrolF1.hotcue,[0x0,0x40,0x7f]);
4449+ KontrolF1.linkGrid("decks","grid_8","[Channel2]","hotcue_4",false,KontrolF1.hotcue,[0x0,0x7f,0x0]);
4450+ KontrolF1.linkGrid("decks","grid_9","[Channel1]","loop_in",false,undefined,[0x0,0x7f,0x0]);
4451+ KontrolF1.linkGrid("decks","grid_10","[Channel1]","loop_out",false,undefined,[0x0,0x7f,0x0]);
4452+ KontrolF1.linkGrid("decks","grid_11","[Channel2]","loop_in",false,undefined,[0x0,0x7f,0x0]);
4453+ KontrolF1.linkGrid("decks","grid_12","[Channel2]","loop_out",false,undefined,[0x0,0x7f,0x0]);
4454+ KontrolF1.linkGrid("decks","grid_13","[Channel1]","quantize",true,undefined,[0x10,0x10,0x40]);
4455+ KontrolF1.linkGrid("decks","grid_14","[Channel1]","reloop_exit",false,undefined,[0x7f,0x0,0x0]);
4456+ KontrolF1.linkGrid("decks","grid_15","[Channel2]","quantize",true,undefined,[0x10,0x10,0x40]);
4457+ KontrolF1.linkGrid("decks","grid_16","[Channel2]","reloop_exit");
4458+ KontrolF1.linkPlay("decks","play_1","[Channel1]","play",true);
4459+ KontrolF1.linkPlay("decks","play_2","[Channel1]","cue_default");
4460+ KontrolF1.linkPlay("decks","play_3","[Channel2]","play",true);
4461+ KontrolF1.linkPlay("decks","play_4","[Channel2]","cue_default");
4462+
4463+ KontrolF1.linkKnob("samplers","knob_1","[Sampler1]","rate","ratereversed");
4464+ KontrolF1.linkKnob("samplers","knob_2","[Sampler2]","rate","ratereversed");
4465+ KontrolF1.linkKnob("samplers","knob_3","[Sampler3]","rate","ratereversed");
4466+ KontrolF1.linkKnob("samplers","knob_4","[Sampler4]","rate","ratereversed");
4467+ KontrolF1.linkFader("samplers","fader_1","[Sampler1]","pregain","pregain");
4468+ KontrolF1.linkFader("samplers","fader_2","[Sampler2]","pregain","pregain");
4469+ KontrolF1.linkFader("samplers","fader_3","[Sampler3]","pregain","pregain");
4470+ KontrolF1.linkFader("samplers","fader_4","[Sampler4]","pregain","pregain");
4471+ KontrolF1.linkGrid("samplers","grid_1","[Sampler1]","hotcue_1",false,KontrolF1.hotcue,[0x7f,0x0,0x0]);
4472+ KontrolF1.linkGrid("samplers","grid_2","[Sampler2]","hotcue_1",false,KontrolF1.hotcue,[0x7f,0x0,0x0]);
4473+ KontrolF1.linkGrid("samplers","grid_3","[Sampler3]","hotcue_1",false,KontrolF1.hotcue,[0x7f,0x0,0x0]);
4474+ KontrolF1.linkGrid("samplers","grid_4","[Sampler4]","hotcue_1",false,KontrolF1.hotcue,[0x7f,0x0,0x0]);
4475+ KontrolF1.linkGrid("samplers","grid_5","[Sampler1]","hotcue_2",false,KontrolF1.hotcue,[0x0,0x7f,0x0]);
4476+ KontrolF1.linkGrid("samplers","grid_6","[Sampler2]","hotcue_2",false,KontrolF1.hotcue,[0x0,0x7f,0x0]);
4477+ KontrolF1.linkGrid("samplers","grid_7","[Sampler3]","hotcue_2",false,KontrolF1.hotcue,[0x0,0x7f,0x0]);
4478+ KontrolF1.linkGrid("samplers","grid_8","[Sampler4]","hotcue_2",false,KontrolF1.hotcue,[0x0,0x7f,0x0]);
4479+ KontrolF1.linkGrid("samplers","grid_9","[Sampler1]","hotcue_3",false,KontrolF1.hotcue,[0x0,0x0,0x7f]);
4480+ KontrolF1.linkGrid("samplers","grid_10","[Sampler2]","hotcue_3",false,KontrolF1.hotcue,[0x0,0x0,0x7f]);
4481+ KontrolF1.linkGrid("samplers","grid_11","[Sampler3]","hotcue_3",false,KontrolF1.hotcue,[0x0,0x0,0x7f]);
4482+ KontrolF1.linkGrid("samplers","grid_12","[Sampler4]","hotcue_3",false,KontrolF1.hotcue,[0x0,0x0,0x7f]);
4483+ KontrolF1.linkGrid("samplers","grid_13","[Sampler1]","hotcue_4",false,KontrolF1.hotcue,[0x0,0x7f,0x7f]);
4484+ KontrolF1.linkGrid("samplers","grid_14","[Sampler2]","hotcue_4",false,KontrolF1.hotcue,[0x0,0x7f,0x7f]);
4485+ KontrolF1.linkGrid("samplers","grid_15","[Sampler3]","hotcue_4",false,KontrolF1.hotcue,[0x0,0x7f,0x7f]);
4486+ KontrolF1.linkGrid("samplers","grid_16","[Sampler4]","hotcue_4",false,KontrolF1.hotcue,[0x0,0x7f,0x7f]);
4487+ KontrolF1.linkPlay("samplers","play_1","[Sampler1]","play",true);
4488+ KontrolF1.linkPlay("samplers","play_2","[Sampler2]","play",true);
4489+ KontrolF1.linkPlay("samplers","play_3","[Sampler3]","play",true);
4490+ KontrolF1.linkPlay("samplers","play_4","[Sampler4]","play",true);
4491+}
4492+
4493+KontrolF1.hotcue = function(button,field) {
4494+ var controller = KontrolF1.controller;
4495+ var name;
4496+ if (field.value == controller.buttonStates.released)
4497+ return;
4498+ if (controller.modifiers.get("shift"))
4499+ name = button.name + '_clear';
4500+ else
4501+ name = button.name + '_activate';
4502+ engine.setValue(button.group,name,true);
4503+}
4504+
4505
4506=== modified file 'mixxx/res/controllers/Traktor-Kontrol-X1.js'
4507--- mixxx/res/controllers/Traktor-Kontrol-X1.js 2012-07-06 06:59:45 +0000
4508+++ mixxx/res/controllers/Traktor-Kontrol-X1.js 2012-08-08 11:20:30 +0000
4509@@ -1,119 +1,88 @@
4510
4511 function KontrolX1() {};
4512
4513-KontrolX1.ledStates = { off: 0x0, on: 0x7f };
4514-KontrolX1.leds = new Object();
4515-KontrolX1.knobs = new Object();
4516-KontrolX1.buttons = new Object();
4517-KontrolX1.encoders = new Object();
4518-
4519-// Value scaling functions for certain default mixxx ranges
4520-KontrolX1.volumeScaler = function(value) {
4521- return script.absoluteLin(value, 0, 1, 0, 127);
4522-}
4523-KontrolX1.eqScaler = function(value) {
4524- return script.absoluteNonLin(value, 0, 1, 4, 0, 127);
4525-}
4526-
4527-// Define output LEDs
4528-KontrolX1.addLED = function(index,group,control) {
4529- led_id = group+"."+control;
4530- KontrolX1.leds[led_id] = {
4531- "id": led_id,
4532- "group": group,
4533- "control": control,
4534- "index": index,
4535- };
4536- engine.connectControl(group,control,KontrolX1.updateLEDState);
4537-}
4538-
4539-// Define named input button and engine control
4540-KontrolX1.addButton = function(index,group,control,hold,callback) {
4541- KontrolX1.buttons[index] = {
4542- "id": group+"."+control,
4543- "group": group,
4544- "control": control,
4545- "hold": hold,
4546- "callback": callback
4547- };
4548-}
4549-
4550-// Define named input knob and engine control
4551-KontrolX1.addKnob = function(index,group,control,scaler,callback) {
4552- KontrolX1.knobs[index] = {
4553- "id": group+"."+control,
4554- "group": group,
4555- "control": control,
4556- "scaler": scaler,
4557- "callback": callback
4558- };
4559-}
4560-
4561-// Defined named input encoder and engine control
4562-KontrolX1.addEncoder = function(index,group,control,callback) {
4563- KontrolX1.encoders[index] = {
4564- "id": group+"."+control,
4565- "group": group,
4566- "control": control,
4567- "callback": callback
4568- };
4569-}
4570+KontrolX1.debugging = true;
4571
4572 KontrolX1.init = function(id) {
4573 KontrolX1.id = id;
4574+ KontrolX1.ledStates = { off: 0x0, on: 0x7f };
4575+ KontrolX1.ledOutStatus = 0xb0;
4576+
4577 KontrolX1.timers = new Object();
4578-
4579- KontrolX1.addKnob(0x0,"[Channel1]","filterHigh",KontrolX1.eqScaler);
4580- KontrolX1.addKnob(0x1,"[Channel2]","filterHigh",KontrolX1.eqScaler);
4581- KontrolX1.addKnob(0x2,"[Channel1]","filterMid",KontrolX1.eqScaler);
4582- KontrolX1.addKnob(0x3,"[Channel2]","filterMid",KontrolX1.eqScaler);
4583- KontrolX1.addKnob(0x4,"[Channel1]","filterLow",KontrolX1.eqScaler);
4584- KontrolX1.addKnob(0x5,"[Channel2]","filterLow",KontrolX1.eqScaler);
4585- KontrolX1.addKnob(0x6,"[Channel1]","volume",KontrolX1.volumeScaler);
4586- KontrolX1.addKnob(0x7,"[Channel2]","volume",KontrolX1.volumeScaler);
4587-
4588- KontrolX1.addKnob(0x2c,"[Channel1]","mixer_1_shift");
4589- KontrolX1.addKnob(0x2d,"[Channel2]","mixer_1_shift");
4590- KontrolX1.addKnob(0x2e,"[Channel1]","mixer_2_shift");
4591- KontrolX1.addKnob(0x2f,"[Channel2]","mixer_2_shift");
4592- KontrolX1.addKnob(0x30,"[Channel1]","mixer_3_shift");
4593- KontrolX1.addKnob(0x31,"[Channel2]","mixer_3_shift");
4594- KontrolX1.addKnob(0x32,"[Channel1]","mixer_4_shift");
4595- KontrolX1.addKnob(0x33,"[Channel2]","mixer_4_shift");
4596-
4597- KontrolX1.addButton(0x8,"[Channel1]","filterHighKill");
4598- KontrolX1.addLED(0x8,"[Channel1]","filterHighKill");
4599- KontrolX1.addButton(0x9,"[Channel2]","filterHighKill");
4600- KontrolX1.addLED(0x9,"[Channel2]","filterHighKill");
4601- KontrolX1.addButton(0xa,"[Channel1]","filterMidKill");
4602- KontrolX1.addLED(0xa,"[Channel1]","filterMidKill");
4603- KontrolX1.addButton(0xb,"[Channel2]","filterMidKill");
4604- KontrolX1.addLED(0xb,"[Channel2]","filterMidKill");
4605- KontrolX1.addButton(0xc,"[Channel1]","filterLowKill");
4606- KontrolX1.addLED(0xc,"[Channel1]","filterLowKill");
4607- KontrolX1.addButton(0xd,"[Channel2]","filterLowKill");
4608- KontrolX1.addLED(0xd,"[Channel2]","filterLowKill");
4609- KontrolX1.addButton(0xe,"[Channel1]","pfl");
4610- KontrolX1.addLED(0xe,"[Channel1]","pfl");
4611- KontrolX1.addButton(0xf,"[Channel2]","pfl");
4612- KontrolX1.addLED(0xf,"[Channel2]","pfl");
4613+ KontrolX1.ledmap = new Object();
4614+ KontrolX1.knobmap = new Object();
4615+ KontrolX1.buttonmap = new Object();
4616+ KontrolX1.encodermap = new Object();
4617+ KontrolX1.scalers = new Object();
4618+
4619+ KontrolX1.registerScalers();
4620+ KontrolX1.registerControls();
4621+
4622+ KontrolX1.resetLEDs();
4623+ KontrolX1.debug(KontrolX1.id + " initialized");
4624+}
4625+
4626+KontrolX1.shutdown = function() {
4627+ for (var led_name in KontrolX1.ledmap) {
4628+ var led = KontrolX1.ledmap[led_name];
4629+ engine.connectControl(led.group,led.control,KontrolX1.setLED,true);
4630+ }
4631+ KontrolX1.debug(KontrolX1.id + " shutdown");
4632+}
4633+
4634+KontrolX1.debug = function(message) {
4635+ if (!KontrolX1.debugging)
4636+ return;
4637+ print("KontrolX1: " + message);
4638+}
4639+
4640+KontrolX1.registerScalers = function() {
4641+ KontrolX1.scalers = new Object();
4642+ KontrolX1.scalers["volume"] = function(value) {
4643+ return script.absoluteLin(value, 0, 1, 0, 127);
4644+ }
4645+ KontrolX1.scalers["eq"] = function(value) {
4646+ return script.absoluteNonLin(value, 0, 1, 4, 0, 127);
4647+ }
4648+}
4649+
4650+KontrolX1.registerControls = function() {
4651+
4652+ KontrolX1.addKnob(0x0,"[Channel1]","filterHigh","eq");
4653+ KontrolX1.addKnob(0x1,"[Channel2]","filterHigh","eq");
4654+ KontrolX1.addKnob(0x2,"[Channel1]","filterMid","eq");
4655+ KontrolX1.addKnob(0x3,"[Channel2]","filterMid","eq");
4656+ KontrolX1.addKnob(0x4,"[Channel1]","filterLow","eq");
4657+ KontrolX1.addKnob(0x5,"[Channel2]","filterLow","eq");
4658+ KontrolX1.addKnob(0x6,"[Channel1]","volume");
4659+ KontrolX1.addKnob(0x7,"[Channel2]","volume");
4660+
4661+ //KontrolX1.addKnob(0x2c,"[Channel1]","mixer_1_shift");
4662+ //KontrolX1.addKnob(0x2d,"[Channel2]","mixer_1_shift");
4663+ //KontrolX1.addKnob(0x2e,"[Channel1]","mixer_2_shift");
4664+ //KontrolX1.addKnob(0x2f,"[Channel2]","mixer_2_shift");
4665+ //KontrolX1.addKnob(0x30,"[Channel1]","mixer_3_shift");
4666+ //KontrolX1.addKnob(0x31,"[Channel2]","mixer_3_shift");
4667+ //KontrolX1.addKnob(0x32,"[Channel1]","mixer_4_shift");
4668+ //KontrolX1.addKnob(0x33,"[Channel2]","mixer_4_shift");
4669+
4670+ KontrolX1.addLEDButton(0x8,"[Channel1]","filterHighKill");
4671+ KontrolX1.addLEDButton(0x9,"[Channel2]","filterHighKill");
4672+ KontrolX1.addLEDButton(0xa,"[Channel1]","filterMidKill");
4673+ KontrolX1.addLEDButton(0xb,"[Channel2]","filterMidKill");
4674+ KontrolX1.addLEDButton(0xc,"[Channel1]","filterLowKill");
4675+ KontrolX1.addLEDButton(0xd,"[Channel2]","filterLowKill");
4676+ KontrolX1.addLEDButton(0xe,"[Channel1]","pfl");
4677+ KontrolX1.addLEDButton(0xf,"[Channel2]","pfl");
4678
4679 KontrolX1.addButton(0x34,"[Channel1]","mixer_1_shift");
4680- KontrolX1.addLED(0x34,"[Channel1]","mixer_1_shift");
4681 KontrolX1.addButton(0x35,"[Channel2]","mixer_1_shift");
4682- KontrolX1.addLED(0x35,"[Channel2]","mixer_1_shift");
4683 KontrolX1.addButton(0x36,"[Channel1]","mixer_2_shift");
4684- KontrolX1.addLED(0x36,"[Channel1]","mixer_2_shift");
4685 KontrolX1.addButton(0x37,"[Channel2]","mixer_2_shift");
4686- KontrolX1.addLED(0x37,"[Channel2]","mixer_2_shift");
4687 KontrolX1.addButton(0x38,"[Channel1]","mixer_3_shift");
4688- KontrolX1.addLED(0x38,"[Channel1]","mixer_3_shift");
4689 KontrolX1.addButton(0x39,"[Channel2]","mixer_3_shift");
4690- KontrolX1.addLED(0x39,"[Channel2]","mixer_3_shift");
4691 KontrolX1.addButton(0x3a,"[Channel1]","mixer_4_shift");
4692- KontrolX1.addLED(0x3a,"[Channel1]","mixer_4_shift");
4693 KontrolX1.addButton(0x3b,"[Channel2]","mixer_4_shift");
4694- KontrolX1.addLED(0x3b,"[Channel2]","mixer_4_shift");
4695
4696 KontrolX1.addEncoder(0x10,"[Channel1]","encoder_1");
4697 KontrolX1.addButton(0x12,"[Channel1]","encoder_1_button");
4698@@ -135,125 +104,201 @@
4699 KontrolX1.addEncoder(0x47,"[Channel2]","encoder_2_shift");
4700 KontrolX1.addButton(0x45,"[Channel2]","encoder_2_button_shift");
4701
4702- KontrolX1.addButton(0x14,"[Channel1]","quantize");
4703- KontrolX1.addLED(0x14,"[Channel1]","quantize");
4704- KontrolX1.addButton(0x15,"[Channel2]","quantize");
4705- KontrolX1.addLED(0x15,"[Channel2]","quantize");
4706- KontrolX1.addButton(0x16,"[Channel1]","keylock");
4707- KontrolX1.addLED(0x16,"[Channel1]","keylock");
4708- KontrolX1.addButton(0x17,"[Channel2]","keylock");
4709- KontrolX1.addLED(0x17,"[Channel2]","keylock");
4710-
4711- KontrolX1.addButton(0x40,"[Channel1]","beatsync",true);
4712- KontrolX1.addLED(0x40,"[Channel1]","beatsync");
4713- KontrolX1.addButton(0x41,"[Channel2]","beatsync",true);
4714- KontrolX1.addLED(0x41,"[Channel2]","beatsync");
4715- KontrolX1.addButton(0x42,"[Channel1]","beats_translate_curpos",true);
4716- KontrolX1.addLED(0x42,"[Channel1]","beats_translate_curpos");
4717- KontrolX1.addButton(0x43,"[Channel2]","beats_translate_curpos",true);
4718- KontrolX1.addLED(0x43,"[Channel2","beats_translate_curpos");
4719-
4720- KontrolX1.addButton(0x1c,"[Channel1]","loop_in",true);
4721- KontrolX1.addLED(0x1c,"[Channel1]","loop_in");
4722- KontrolX1.addButton(0x1d,"[Channel2]","loop_in",true);
4723- KontrolX1.addLED(0x1d,"[Channel2]","loop_in");
4724- KontrolX1.addButton(0x1e,"[Channel1]","loop_out",true);
4725- KontrolX1.addLED(0x1e,"[Channel1]","loop_out");
4726- KontrolX1.addButton(0x1f,"[Channel2]","loop_out",true);
4727- KontrolX1.addLED(0x1f,"[Channel2]","loop_out");
4728- KontrolX1.addButton(0x20,"[Channel1]","rate_temp_down",true);
4729- KontrolX1.addLED(0x20,"[Channel1]","rate_temp_down");
4730- KontrolX1.addButton(0x21,"[Channel2]","rate_temp_down",true);
4731- KontrolX1.addLED(0x21,"[Channel2]","rate_temp_down");
4732- KontrolX1.addButton(0x22,"[Channel1]","rate_temp_up",true);
4733- KontrolX1.addLED(0x22,"[Channel1]","rate_temp_up");
4734- KontrolX1.addButton(0x23,"[Channel2]","rate_temp_up",true);
4735- KontrolX1.addLED(0x23,"[Channel2]","rate_temp_up");
4736- KontrolX1.addButton(0x24,"[Channel1]","cue_default",true);
4737- KontrolX1.addLED(0x24,"[Channel1]","cue_default");
4738- KontrolX1.addButton(0x25,"[Channel2]","cue_default",true);
4739- KontrolX1.addLED(0x25,"[Channel2]","cue_default");
4740- KontrolX1.addButton(0x26,"[Channel1]","reloop_exit",true);
4741- KontrolX1.addLED(0x26,"[Channel1]","reloop_exit");
4742- KontrolX1.addButton(0x27,"[Channel2]","reloop_exit",true);
4743- KontrolX1.addLED(0x27,"[Channel2]","reloop_exit");
4744- KontrolX1.addButton(0x28,"[Channel1]","play");
4745- KontrolX1.addLED(0x28,"[Channel1]","play");
4746- KontrolX1.addButton(0x29,"[Channel2]","play");
4747- KontrolX1.addLED(0x29,"[Channel2]","play");
4748- KontrolX1.addButton(0x2a,"[Channel1]","reverse");
4749- KontrolX1.addLED(0x2a,"[Channel1]","reverse");
4750- KontrolX1.addButton(0x2b,"[Channel2]","reverse");
4751- KontrolX1.addLED(0x2b,"[Channel2]","reverse");
4752-
4753- KontrolX1.addButton(0x48,"[Channel1]","loop_halve",true);
4754- KontrolX1.addLED(0x48,"[Channel1]","loop_halve");
4755- KontrolX1.addButton(0x49,"[Channel2]","loop_halve",true);
4756- KontrolX1.addLED(0x49,"[Channel2]","loop_halve");
4757- KontrolX1.addButton(0x4a,"[Channel1]","loop_double",true);
4758- KontrolX1.addLED(0x4a,"[Channel1]","loop_double");
4759- KontrolX1.addButton(0x4b,"[Channel2]","loop_double",true);
4760- KontrolX1.addLED(0x4b,"[Channel2]","loop_double");
4761- KontrolX1.addButton(0x4c,"[Channel1]","back",true);
4762- KontrolX1.addLED(0x4c,"[Channel1]","back");
4763- KontrolX1.addButton(0x4d,"[Channel2]","back",true);
4764- KontrolX1.addLED(0x4d,"[Channel2]","back");
4765- KontrolX1.addButton(0x4e,"[Channel1]","fwd",true);
4766- KontrolX1.addLED(0x4e,"[Channel1]","fwd");
4767- KontrolX1.addButton(0x4f,"[Channel2]","fwd",true);
4768- KontrolX1.addLED(0x4f,"[Channel2]","fwd");
4769- KontrolX1.addButton(0x50,"[Channel1]","seek_back",true,KontrolX1.seek);
4770- KontrolX1.addLED(0x50,"[Channel1]","seek_back");
4771- KontrolX1.addButton(0x51,"[Channel2]","seek_back",true,KontrolX1.seek);
4772- KontrolX1.addLED(0x51,"[Channel2]","seek_back");
4773- KontrolX1.addButton(0x52,"[Channel1]","seek_fwd",true,KontrolX1.seek);
4774- KontrolX1.addLED(0x52,"[Channel1]","seek_fwd");
4775- KontrolX1.addButton(0x53,"[Channel2]","seek_fwd",true,KontrolX1.seek);
4776- KontrolX1.addLED(0x53,"[Channel2]","seek_fwd");
4777+ KontrolX1.addLEDButton(0x14,"[Channel1]","quantize");
4778+ KontrolX1.addLEDButton(0x15,"[Channel2]","quantize");
4779+ KontrolX1.addLEDButton(0x16,"[Channel1]","keylock");
4780+ KontrolX1.addLEDButton(0x17,"[Channel2]","keylock");
4781+
4782+ KontrolX1.addLEDButton(0x40,"[Channel1]","beatsync",true);
4783+ KontrolX1.addLEDButton(0x41,"[Channel2]","beatsync",true);
4784+ KontrolX1.addLEDButton(0x42,"[Channel1]","beats_translate_curpos",true);
4785+ KontrolX1.addLEDButton(0x43,"[Channel2]","beats_translate_curpos",true);
4786+
4787+ KontrolX1.addButton(0x1c,"[Channel1]","seek_back",true,KontrolX1.seek);
4788+ KontrolX1.addButton(0x1d,"[Channel2]","seek_back",true,KontrolX1.seek);
4789+ KontrolX1.addButton(0x1e,"[Channel1]","seek_fwd",true,KontrolX1.seek);
4790+ KontrolX1.addButton(0x1f,"[Channel2]","seek_fwd",true,KontrolX1.seek);
4791+ KontrolX1.addLEDButton(0x20,"[Channel1]","loop_in",true);
4792+ KontrolX1.addLEDButton(0x21,"[Channel2]","loop_in",true);
4793+ KontrolX1.addLEDButton(0x22,"[Channel1]","loop_out",true);
4794+ KontrolX1.addLEDButton(0x23,"[Channel2]","loop_out",true);
4795+ KontrolX1.addLEDButton(0x24,"[Channel1]","reverse");
4796+ KontrolX1.addLEDButton(0x25,"[Channel2]","reverse");
4797+ KontrolX1.addLEDButton(0x26,"[Channel1]","reloop_exit",true);
4798+ KontrolX1.addLEDButton(0x27,"[Channel2]","reloop_exit",true);
4799+ KontrolX1.addLEDButton(0x28,"[Channel1]","play");
4800+ KontrolX1.addLEDButton(0x29,"[Channel2]","play");
4801+ KontrolX1.addLEDButton(0x2a,"[Channel1]","cue_default",true);
4802+ KontrolX1.addLEDButton(0x2b,"[Channel2]","cue_default",true);
4803+
4804+ KontrolX1.addLEDButton(0x48,"[Channel1]","back",true);
4805+ KontrolX1.addLEDButton(0x49,"[Channel2]","back",true);
4806+ KontrolX1.addLEDButton(0x4a,"[Channel1]","fwd",true);
4807+ KontrolX1.addLEDButton(0x4b,"[Channel2]","fwd",true);
4808+ KontrolX1.addLEDButton(0x4c,"[Channel1]","loop_halve",true);
4809+ KontrolX1.addLEDButton(0x4d,"[Channel2]","loop_halve",true);
4810+ KontrolX1.addLEDButton(0x4e,"[Channel1]","loop_double",true);
4811+ KontrolX1.addLEDButton(0x4f,"[Channel2]","loop_double",true);
4812+
4813+ // TODO - unmapped buttons
4814+ KontrolX1.addButton(0x50,"[Channel1]","reverse_shift");
4815+ KontrolX1.addButton(0x51,"[Channel2]","reverse_shift");
4816+ KontrolX1.addButton(0x52,"[Channel1]","reloop_exit_shift");
4817+ KontrolX1.addButton(0x53,"[Channel2]","reloop_exit_shift");
4818 KontrolX1.addButton(0x54,"[Channel1]","play_shift");
4819- KontrolX1.addLED(0x54,"[Channel1]","play_shift");
4820 KontrolX1.addButton(0x55,"[Channel2]","play_shift");
4821- KontrolX1.addLED(0x55,"[Channel2]","play_shift");
4822- KontrolX1.addButton(0x56,"[Channel1]","tap");
4823- KontrolX1.addLED(0x56,"[Channel1]","tap");
4824- KontrolX1.addButton(0x57,"[Channel2]","tap");
4825- KontrolX1.addLED(0x57,"[Channel2]","tap");
4826-
4827- KontrolX1.resetLEDs();
4828- print("Kontrol X1 " + KontrolX1.id + " initialized");
4829-}
4830-
4831-KontrolX1.shutdown = function() {
4832- print("Kontrol X1 " + KontrolX1.id + " shutdown");
4833-}
4834-
4835-// Set all LEDs to disabled state, both normal and shifted mode
4836+ KontrolX1.addButton(0x56,"[Channel1]","cue_shift");
4837+ KontrolX1.addButton(0x57,"[Channel2]","cue_shift");
4838+}
4839+
4840+// Define output LEDs
4841+KontrolX1.addLED = function(index,group,control) {
4842+ led_id = group+"."+control;
4843+ var led = new Object();
4844+ led.id = led_id;
4845+ led.group = group;
4846+ led.control = control;
4847+ led.index = index;
4848+ KontrolX1.ledmap[led_id] = led;
4849+ engine.connectControl(led.group,led.control,KontrolX1.setLED);
4850+}
4851+
4852 KontrolX1.resetLEDs = function() {
4853 var led;
4854- for (var led_name in KontrolX1.leds) {
4855- led = KontrolX1.leds[led_name];
4856- midi.sendShortMsg(0xb0,led.index,KontrolX1.ledStates["off"]);
4857- midi.sendShortMsg(0xb0,led.index+0x2c,KontrolX1.ledStates["off"]);
4858+ for (var led_name in KontrolX1.ledmap) {
4859+ led = KontrolX1.ledmap[led_name];
4860+ shifted = led.index + 0x2c;
4861+ midi.sendShortMsg(KontrolX1.ledOutStatus,led.index,KontrolX1.ledStates.off);
4862+ midi.sendShortMsg(KontrolX1.ledOutStatus,shifted,KontrolX1.ledStates.off);
4863 }
4864 }
4865-KontrolX1.updateLEDState = function(value,group,key) {
4866+
4867+KontrolX1.setLED = function(value,group,key) {
4868 var led_id = group+"."+key;
4869- var led = KontrolX1.leds[led_id];
4870+ var led = KontrolX1.ledmap[led_id];
4871 if (led==undefined) {
4872- print("Unknown LED to update: " + led_id);
4873- return;
4874- }
4875- midi.sendShortMsg(0xb0,led.index,value);
4876-}
4877-
4878+ KontrolX1.debug("Unknown LED to update: " + led_id);
4879+ return;
4880+ }
4881+ value = (value==1) ? KontrolX1.ledStates.on : KontrolX1.ledStates.off;
4882+ midi.sendShortMsg(KontrolX1.ledOutStatus,led.index,value);
4883+}
4884+
4885+KontrolX1.addLEDButton = function(index,group,control,hold,callback) {
4886+ KontrolX1.addButton(index,group,control,hold,callback);
4887+ KontrolX1.addLED(index,group,control);
4888+}
4889+
4890+KontrolX1.addButton = function(index,group,control,hold,callback) {
4891+ KontrolX1.buttonmap[index] = {
4892+ "id": group+"."+control,
4893+ "group": group,
4894+ "control": control,
4895+ "hold": hold,
4896+ "callback": callback
4897+ };
4898+}
4899+
4900+// Callback from MIDI mapping for all buttons in device
4901+KontrolX1.buttons = function(channel,control,value,status,group) {
4902+ var button = KontrolX1.buttonmap[control];
4903+ var shift = (control>=0x2c) ? true : false;
4904+
4905+ if (button==undefined) {
4906+ KontrolX1.debug("BUTTON not defined in mapping: " + control);
4907+ return;
4908+ }
4909+ if (button.callback!=undefined) {
4910+ button.callback(channel,button.control,value,status,button.group);
4911+ return;
4912+ }
4913+ if (!button.hold && value==0)
4914+ return;
4915+
4916+ if (button.control=="play") {
4917+ if (engine.getValue(button.group,"play"))
4918+ engine.setValue(button.group,"play",false);
4919+ else
4920+ engine.setValue(button.group,"play",true);
4921+ return;
4922+ }
4923+
4924+ //if (!button.hold)
4925+ value = engine.getValue(button.group,button.control) ? false : true;
4926+ engine.setValue(button.group,button.control,value);
4927+}
4928+
4929+KontrolX1.addKnob = function(index,group,control,scaler,callback) {
4930+ if (scaler==undefined && control in KontrolX1.scalers)
4931+ scaler = control;
4932+ scaler = KontrolX1.scalers[scaler];
4933+ if (scaler==undefined) {
4934+ KontrolX1.debug("Invalid scaling function for " +group+"."+control + ": " + scaler);
4935+ return;
4936+ }
4937+ KontrolX1.knobmap[index] = {
4938+ "id": group+"."+control,
4939+ "group": group,
4940+ "control": control,
4941+ "scaler": scaler,
4942+ "callback": callback
4943+ };
4944+}
4945+
4946+KontrolX1.knobs = function(channel,control,value,status,group) {
4947+ var knob = KontrolX1.knobmap[control];
4948+ var shift = (control>=0x2c) ? true : false;
4949+ if (knob==undefined) {
4950+ KontrolX1.debug("Knob not defined in mapping: " + control);
4951+ return;
4952+ }
4953+ if (knob.scaler==undefined) {
4954+ KontrolX1.debug("No valid scaling function registered for " + knob.id);
4955+ return;
4956+ }
4957+ if (knob.callback!=undefined) {
4958+ knob.callback(channel,control,value,status,group);
4959+ return;
4960+ }
4961+ value = knob.scaler(value);
4962+ engine.setValue(knob.group,knob.control,value);
4963+}
4964+
4965+KontrolX1.addEncoder = function(index,group,control,callback) {
4966+ KontrolX1.encodermap[index] = {
4967+ "id": group+"."+control,
4968+ "group": group,
4969+ "control": control,
4970+ "callback": callback
4971+ };
4972+}
4973+
4974+// Callback from MIDI mapping for all encoders in device
4975+KontrolX1.encoders = function(channel,control,value,status,group) {
4976+ var encoder = KontrolX1.encodermap[control];
4977+ var shift = (control>=0x2c) ? true : false;
4978+
4979+ if (encoder==undefined) {
4980+ KontrolX1.debug("ENCODER not defined in mapping: " + control);
4981+ return;
4982+ }
4983+ // Encoders in F1 send 127 for -1, 1 for +1
4984+ value = (value==127)?value=-1:value=+1;
4985+ if (encoder.callback!=undefined) {
4986+ encoder.callback(channel,control,value,status,encoder.group);
4987+ return;
4988+ }
4989+ engine.setValue(encoder.group,encoder.control,value);
4990+}
4991+
4992+// Seek button callback
4993 KontrolX1.seek = function(channel,control,value,status,group) {
4994- print("SEEK " + group+"."+control + " " +value);
4995 if (value==0) {
4996 engine.setValue(group,'wheel',0);
4997 return;
4998 }
4999- if (control=='seek_back') value = -0.2;
5000- if (control=='seek_fwd') value = 0.2;
The diff has been truncated for viewing.