Merged with trunk R1612.
[ardour.git] / libs / surfaces / mackie / bcf_surface.cc
1 /*
2         Generated by scripts/generate-surface.rb
3 */
4
5 #include "bcf_surface.h"
6
7 #include "controls.h"
8 #include "mackie_button_handler.h"
9
10 using namespace Mackie;
11
12 void Mackie::BcfSurface::init_controls()
13 {
14         // intialise groups and strips
15         Group * group = 0;
16         
17         // make sure there are enough strips
18         strips.resize( 7 );
19         
20         group = new Group ( "user" );
21         groups["user"] = group;
22         
23         group = new Group ( "assignment" );
24         groups["assignment"] = group;
25         
26         group = new Group ( "none" );
27         groups["none"] = group;
28         
29         group = new MasterStrip ( "master", 0 );
30         groups["master"] = group;
31         strips[0] = dynamic_cast<Strip*>( group );
32         
33         group = new Strip ( "strip_1", 0 );
34         groups["strip_1"] = group;
35         strips[0] = dynamic_cast<Strip*>( group );
36         
37         group = new Group ( "cursor" );
38         groups["cursor"] = group;
39         
40         group = new Strip ( "strip_2", 1 );
41         groups["strip_2"] = group;
42         strips[1] = dynamic_cast<Strip*>( group );
43         
44         group = new Group ( "functions" );
45         groups["functions"] = group;
46         
47         group = new Group ( "automation" );
48         groups["automation"] = group;
49         
50         group = new Strip ( "strip_3", 2 );
51         groups["strip_3"] = group;
52         strips[2] = dynamic_cast<Strip*>( group );
53         
54         group = new Group ( "display" );
55         groups["display"] = group;
56         
57         group = new Strip ( "strip_4", 3 );
58         groups["strip_4"] = group;
59         strips[3] = dynamic_cast<Strip*>( group );
60         
61         group = new Strip ( "strip_5", 4 );
62         groups["strip_5"] = group;
63         strips[4] = dynamic_cast<Strip*>( group );
64         
65         group = new Strip ( "strip_6", 5 );
66         groups["strip_6"] = group;
67         strips[5] = dynamic_cast<Strip*>( group );
68         
69         group = new Group ( "transport" );
70         groups["transport"] = group;
71         
72         group = new Strip ( "strip_7", 6 );
73         groups["strip_7"] = group;
74         strips[6] = dynamic_cast<Strip*>( group );
75         
76         group = new Group ( "modifiers" );
77         groups["modifiers"] = group;
78         
79         group = new Group ( "bank" );
80         groups["bank"] = group;
81         
82
83         // initialise controls
84         Control * control = 0;
85
86         group = groups["strip_1"];
87         control = new Fader ( 0, 1, "gain", *group );
88         faders[0x00] = control;
89         controls.push_back( control );
90         group->add( *control );
91
92         group = groups["strip_2"];
93         control = new Fader ( 1, 2, "gain", *group );
94         faders[0x01] = control;
95         controls.push_back( control );
96         group->add( *control );
97
98         group = groups["strip_3"];
99         control = new Fader ( 2, 3, "gain", *group );
100         faders[0x02] = control;
101         controls.push_back( control );
102         group->add( *control );
103
104         group = groups["strip_4"];
105         control = new Fader ( 3, 4, "gain", *group );
106         faders[0x03] = control;
107         controls.push_back( control );
108         group->add( *control );
109
110         group = groups["strip_5"];
111         control = new Fader ( 4, 5, "gain", *group );
112         faders[0x04] = control;
113         controls.push_back( control );
114         group->add( *control );
115
116         group = groups["strip_6"];
117         control = new Fader ( 5, 6, "gain", *group );
118         faders[0x05] = control;
119         controls.push_back( control );
120         group->add( *control );
121
122         group = groups["strip_7"];
123         control = new Fader ( 6, 7, "gain", *group );
124         faders[0x06] = control;
125         controls.push_back( control );
126         group->add( *control );
127
128         group = groups["master"];
129         control = new Fader ( 7, 1, "gain", *group );
130         faders[0x07] = control;
131         controls.push_back( control );
132         group->add( *control );
133
134         group = groups["strip_1"];
135         control = new Pot ( 16, 1, "vpot", *group );
136         pots[0x10] = control;
137         controls.push_back( control );
138         group->add( *control );
139
140         group = groups["strip_2"];
141         control = new Pot ( 17, 2, "vpot", *group );
142         pots[0x11] = control;
143         controls.push_back( control );
144         group->add( *control );
145
146         group = groups["strip_3"];
147         control = new Pot ( 18, 3, "vpot", *group );
148         pots[0x12] = control;
149         controls.push_back( control );
150         group->add( *control );
151
152         group = groups["strip_4"];
153         control = new Pot ( 19, 4, "vpot", *group );
154         pots[0x13] = control;
155         controls.push_back( control );
156         group->add( *control );
157
158         group = groups["strip_5"];
159         control = new Pot ( 20, 5, "vpot", *group );
160         pots[0x14] = control;
161         controls.push_back( control );
162         group->add( *control );
163
164         group = groups["strip_6"];
165         control = new Pot ( 21, 6, "vpot", *group );
166         pots[0x15] = control;
167         controls.push_back( control );
168         group->add( *control );
169
170         group = groups["strip_7"];
171         control = new Pot ( 22, 7, "vpot", *group );
172         pots[0x16] = control;
173         controls.push_back( control );
174         group->add( *control );
175
176         group = groups["none"];
177         control = new Pot ( 23, 1, "jog", *group );
178         pots[0x17] = control;
179         controls.push_back( control );
180         controls_by_name["jog"] = control;
181         group->add( *control );
182
183         group = groups["none"];
184         control = new Pot ( 46, 1, "external", *group );
185         pots[0x2e] = control;
186         controls.push_back( control );
187         controls_by_name["external"] = control;
188         group->add( *control );
189
190         group = groups["strip_1"];
191         control = new Button ( 24, 1, "recenable", *group );
192         buttons[0x18] = control;
193         controls.push_back( control );
194         group->add( *control );
195
196         group = groups["strip_2"];
197         control = new Button ( 25, 2, "recenable", *group );
198         buttons[0x19] = control;
199         controls.push_back( control );
200         group->add( *control );
201
202         group = groups["strip_3"];
203         control = new Button ( 26, 3, "recenable", *group );
204         buttons[0x1a] = control;
205         controls.push_back( control );
206         group->add( *control );
207
208         group = groups["strip_4"];
209         control = new Button ( 27, 4, "recenable", *group );
210         buttons[0x1b] = control;
211         controls.push_back( control );
212         group->add( *control );
213
214         group = groups["strip_5"];
215         control = new Button ( 28, 5, "recenable", *group );
216         buttons[0x1c] = control;
217         controls.push_back( control );
218         group->add( *control );
219
220         group = groups["strip_6"];
221         control = new Button ( 29, 6, "recenable", *group );
222         buttons[0x1d] = control;
223         controls.push_back( control );
224         group->add( *control );
225
226         group = groups["strip_7"];
227         control = new Button ( 30, 7, "recenable", *group );
228         buttons[0x1e] = control;
229         controls.push_back( control );
230         group->add( *control );
231
232         group = groups["strip_1"];
233         control = new Button ( 32, 1, "solo", *group );
234         buttons[0x20] = control;
235         controls.push_back( control );
236         group->add( *control );
237
238         group = groups["strip_2"];
239         control = new Button ( 33, 2, "solo", *group );
240         buttons[0x21] = control;
241         controls.push_back( control );
242         group->add( *control );
243
244         group = groups["strip_3"];
245         control = new Button ( 34, 3, "solo", *group );
246         buttons[0x22] = control;
247         controls.push_back( control );
248         group->add( *control );
249
250         group = groups["strip_4"];
251         control = new Button ( 35, 4, "solo", *group );
252         buttons[0x23] = control;
253         controls.push_back( control );
254         group->add( *control );
255
256         group = groups["strip_5"];
257         control = new Button ( 36, 5, "solo", *group );
258         buttons[0x24] = control;
259         controls.push_back( control );
260         group->add( *control );
261
262         group = groups["strip_6"];
263         control = new Button ( 37, 6, "solo", *group );
264         buttons[0x25] = control;
265         controls.push_back( control );
266         group->add( *control );
267
268         group = groups["strip_7"];
269         control = new Button ( 38, 7, "solo", *group );
270         buttons[0x26] = control;
271         controls.push_back( control );
272         group->add( *control );
273
274         group = groups["strip_1"];
275         control = new Button ( 16, 1, "mute", *group );
276         buttons[0x10] = control;
277         controls.push_back( control );
278         group->add( *control );
279
280         group = groups["strip_2"];
281         control = new Button ( 17, 2, "mute", *group );
282         buttons[0x11] = control;
283         controls.push_back( control );
284         group->add( *control );
285
286         group = groups["strip_3"];
287         control = new Button ( 18, 3, "mute", *group );
288         buttons[0x12] = control;
289         controls.push_back( control );
290         group->add( *control );
291
292         group = groups["strip_4"];
293         control = new Button ( 19, 4, "mute", *group );
294         buttons[0x13] = control;
295         controls.push_back( control );
296         group->add( *control );
297
298         group = groups["strip_5"];
299         control = new Button ( 20, 5, "mute", *group );
300         buttons[0x14] = control;
301         controls.push_back( control );
302         group->add( *control );
303
304         group = groups["strip_6"];
305         control = new Button ( 21, 6, "mute", *group );
306         buttons[0x15] = control;
307         controls.push_back( control );
308         group->add( *control );
309
310         group = groups["strip_7"];
311         control = new Button ( 22, 7, "mute", *group );
312         buttons[0x16] = control;
313         controls.push_back( control );
314         group->add( *control );
315
316         group = groups["strip_1"];
317         control = new Button ( 0, 1, "select", *group );
318         buttons[0x00] = control;
319         controls.push_back( control );
320         group->add( *control );
321
322         group = groups["strip_2"];
323         control = new Button ( 1, 2, "select", *group );
324         buttons[0x01] = control;
325         controls.push_back( control );
326         group->add( *control );
327
328         group = groups["strip_3"];
329         control = new Button ( 2, 3, "select", *group );
330         buttons[0x02] = control;
331         controls.push_back( control );
332         group->add( *control );
333
334         group = groups["strip_4"];
335         control = new Button ( 3, 4, "select", *group );
336         buttons[0x03] = control;
337         controls.push_back( control );
338         group->add( *control );
339
340         group = groups["strip_5"];
341         control = new Button ( 4, 5, "select", *group );
342         buttons[0x04] = control;
343         controls.push_back( control );
344         group->add( *control );
345
346         group = groups["strip_6"];
347         control = new Button ( 5, 6, "select", *group );
348         buttons[0x05] = control;
349         controls.push_back( control );
350         group->add( *control );
351
352         group = groups["strip_7"];
353         control = new Button ( 6, 7, "select", *group );
354         buttons[0x06] = control;
355         controls.push_back( control );
356         group->add( *control );
357
358         group = groups["strip_1"];
359         control = new Button ( 8, 1, "vselect", *group );
360         buttons[0x08] = control;
361         controls.push_back( control );
362         group->add( *control );
363
364         group = groups["strip_2"];
365         control = new Button ( 9, 2, "vselect", *group );
366         buttons[0x09] = control;
367         controls.push_back( control );
368         group->add( *control );
369
370         group = groups["strip_3"];
371         control = new Button ( 10, 3, "vselect", *group );
372         buttons[0x0a] = control;
373         controls.push_back( control );
374         group->add( *control );
375
376         group = groups["strip_4"];
377         control = new Button ( 11, 4, "vselect", *group );
378         buttons[0x0b] = control;
379         controls.push_back( control );
380         group->add( *control );
381
382         group = groups["strip_5"];
383         control = new Button ( 12, 5, "vselect", *group );
384         buttons[0x0c] = control;
385         controls.push_back( control );
386         group->add( *control );
387
388         group = groups["strip_6"];
389         control = new Button ( 13, 6, "vselect", *group );
390         buttons[0x0d] = control;
391         controls.push_back( control );
392         group->add( *control );
393
394         group = groups["strip_7"];
395         control = new Button ( 14, 7, "vselect", *group );
396         buttons[0x0e] = control;
397         controls.push_back( control );
398         group->add( *control );
399
400         group = groups["assignment"];
401         control = new Button ( 40, 1, "io", *group );
402         buttons[0x28] = control;
403         controls.push_back( control );
404         controls_by_name["io"] = control;
405         group->add( *control );
406
407         group = groups["assignment"];
408         control = new Button ( 90, 1, "sends", *group );
409         buttons[0x5a] = control;
410         controls.push_back( control );
411         controls_by_name["sends"] = control;
412         group->add( *control );
413
414         group = groups["assignment"];
415         control = new Button ( 89, 1, "pan", *group );
416         buttons[0x59] = control;
417         controls.push_back( control );
418         controls_by_name["pan"] = control;
419         group->add( *control );
420
421         group = groups["assignment"];
422         control = new Button ( 87, 1, "plugin", *group );
423         buttons[0x57] = control;
424         controls.push_back( control );
425         controls_by_name["plugin"] = control;
426         group->add( *control );
427
428         group = groups["assignment"];
429         control = new Button ( 88, 1, "eq", *group );
430         buttons[0x58] = control;
431         controls.push_back( control );
432         controls_by_name["eq"] = control;
433         group->add( *control );
434
435         group = groups["assignment"];
436         control = new Button ( 45, 1, "dyn", *group );
437         buttons[0x2d] = control;
438         controls.push_back( control );
439         controls_by_name["dyn"] = control;
440         group->add( *control );
441
442         group = groups["bank"];
443         control = new Button ( 46, 1, "left", *group );
444         buttons[0x2e] = control;
445         controls.push_back( control );
446         controls_by_name["left"] = control;
447         group->add( *control );
448
449         group = groups["bank"];
450         control = new Button ( 47, 1, "right", *group );
451         buttons[0x2f] = control;
452         controls.push_back( control );
453         controls_by_name["right"] = control;
454         group->add( *control );
455
456         group = groups["bank"];
457         control = new Button ( 48, 1, "channel_left", *group );
458         buttons[0x30] = control;
459         controls.push_back( control );
460         controls_by_name["channel_left"] = control;
461         group->add( *control );
462
463         group = groups["bank"];
464         control = new Button ( 49, 1, "channel_right", *group );
465         buttons[0x31] = control;
466         controls.push_back( control );
467         controls_by_name["channel_right"] = control;
468         group->add( *control );
469
470         group = groups["none"];
471         control = new Button ( 50, 1, "flip", *group );
472         buttons[0x32] = control;
473         controls.push_back( control );
474         controls_by_name["flip"] = control;
475         group->add( *control );
476
477         group = groups["none"];
478         control = new Button ( 86, 1, "edit", *group );
479         buttons[0x56] = control;
480         controls.push_back( control );
481         controls_by_name["edit"] = control;
482         group->add( *control );
483
484         group = groups["display"];
485         control = new Button ( 52, 1, "name_value", *group );
486         buttons[0x34] = control;
487         controls.push_back( control );
488         controls_by_name["name_value"] = control;
489         group->add( *control );
490
491         group = groups["display"];
492         control = new Button ( 53, 1, "smpte_beats", *group );
493         buttons[0x35] = control;
494         controls.push_back( control );
495         controls_by_name["smpte_beats"] = control;
496         group->add( *control );
497
498         group = groups["none"];
499         control = new Button ( 54, 1, "F1", *group );
500         buttons[0x36] = control;
501         controls.push_back( control );
502         controls_by_name["F1"] = control;
503         group->add( *control );
504
505         group = groups["none"];
506         control = new Button ( 55, 1, "F2", *group );
507         buttons[0x37] = control;
508         controls.push_back( control );
509         controls_by_name["F2"] = control;
510         group->add( *control );
511
512         group = groups["none"];
513         control = new Button ( 56, 1, "F3", *group );
514         buttons[0x38] = control;
515         controls.push_back( control );
516         controls_by_name["F3"] = control;
517         group->add( *control );
518
519         group = groups["none"];
520         control = new Button ( 57, 1, "F4", *group );
521         buttons[0x39] = control;
522         controls.push_back( control );
523         controls_by_name["F4"] = control;
524         group->add( *control );
525
526         group = groups["none"];
527         control = new Button ( 58, 1, "F5", *group );
528         buttons[0x3a] = control;
529         controls.push_back( control );
530         controls_by_name["F5"] = control;
531         group->add( *control );
532
533         group = groups["none"];
534         control = new Button ( 59, 1, "F6", *group );
535         buttons[0x3b] = control;
536         controls.push_back( control );
537         controls_by_name["F6"] = control;
538         group->add( *control );
539
540         group = groups["none"];
541         control = new Button ( 60, 1, "F7", *group );
542         buttons[0x3c] = control;
543         controls.push_back( control );
544         controls_by_name["F7"] = control;
545         group->add( *control );
546
547         group = groups["none"];
548         control = new Button ( 61, 1, "F8", *group );
549         buttons[0x3d] = control;
550         controls.push_back( control );
551         controls_by_name["F8"] = control;
552         group->add( *control );
553
554         group = groups["none"];
555         control = new Button ( 62, 1, "F9", *group );
556         buttons[0x3e] = control;
557         controls.push_back( control );
558         controls_by_name["F9"] = control;
559         group->add( *control );
560
561         group = groups["none"];
562         control = new Button ( 63, 1, "F10", *group );
563         buttons[0x3f] = control;
564         controls.push_back( control );
565         controls_by_name["F10"] = control;
566         group->add( *control );
567
568         group = groups["none"];
569         control = new Button ( 64, 1, "F11", *group );
570         buttons[0x40] = control;
571         controls.push_back( control );
572         controls_by_name["F11"] = control;
573         group->add( *control );
574
575         group = groups["none"];
576         control = new Button ( 65, 1, "F12", *group );
577         buttons[0x41] = control;
578         controls.push_back( control );
579         controls_by_name["F12"] = control;
580         group->add( *control );
581
582         group = groups["none"];
583         control = new Button ( 66, 1, "F13", *group );
584         buttons[0x42] = control;
585         controls.push_back( control );
586         controls_by_name["F13"] = control;
587         group->add( *control );
588
589         group = groups["none"];
590         control = new Button ( 67, 1, "F14", *group );
591         buttons[0x43] = control;
592         controls.push_back( control );
593         controls_by_name["F14"] = control;
594         group->add( *control );
595
596         group = groups["none"];
597         control = new Button ( 68, 1, "F15", *group );
598         buttons[0x44] = control;
599         controls.push_back( control );
600         controls_by_name["F15"] = control;
601         group->add( *control );
602
603         group = groups["none"];
604         control = new Button ( 69, 1, "F16", *group );
605         buttons[0x45] = control;
606         controls.push_back( control );
607         controls_by_name["F16"] = control;
608         group->add( *control );
609
610         group = groups["none"];
611         control = new Button ( 39, 1, "global_solo", *group );
612         buttons[0x27] = control;
613         controls.push_back( control );
614         controls_by_name["global_solo"] = control;
615         group->add( *control );
616
617         group = groups["modifiers"];
618         control = new Button ( 71, 1, "option", *group );
619         buttons[0x47] = control;
620         controls.push_back( control );
621         controls_by_name["option"] = control;
622         group->add( *control );
623
624         group = groups["modifiers"];
625         control = new Button ( 72, 1, "control", *group );
626         buttons[0x48] = control;
627         controls.push_back( control );
628         controls_by_name["control"] = control;
629         group->add( *control );
630
631         group = groups["modifiers"];
632         control = new Button ( 73, 1, "cmd_alt", *group );
633         buttons[0x49] = control;
634         controls.push_back( control );
635         controls_by_name["cmd_alt"] = control;
636         group->add( *control );
637
638         group = groups["automation"];
639         control = new Button ( 74, 1, "on", *group );
640         buttons[0x4a] = control;
641         controls.push_back( control );
642         controls_by_name["on"] = control;
643         group->add( *control );
644
645         group = groups["automation"];
646         control = new Button ( 75, 1, "rec_ready", *group );
647         buttons[0x4b] = control;
648         controls.push_back( control );
649         controls_by_name["rec_ready"] = control;
650         group->add( *control );
651
652         group = groups["functions"];
653         control = new Button ( 76, 1, "undo", *group );
654         buttons[0x4c] = control;
655         controls.push_back( control );
656         controls_by_name["undo"] = control;
657         group->add( *control );
658
659         group = groups["automation"];
660         control = new Button ( 77, 1, "snapshot", *group );
661         buttons[0x4d] = control;
662         controls.push_back( control );
663         controls_by_name["snapshot"] = control;
664         group->add( *control );
665
666         group = groups["automation"];
667         control = new Button ( 78, 1, "touch", *group );
668         buttons[0x4e] = control;
669         controls.push_back( control );
670         controls_by_name["touch"] = control;
671         group->add( *control );
672
673         group = groups["functions"];
674         control = new Button ( 79, 1, "redo", *group );
675         buttons[0x4f] = control;
676         controls.push_back( control );
677         controls_by_name["redo"] = control;
678         group->add( *control );
679
680         group = groups["functions"];
681         control = new Button ( 80, 1, "marker", *group );
682         buttons[0x50] = control;
683         controls.push_back( control );
684         controls_by_name["marker"] = control;
685         group->add( *control );
686
687         group = groups["functions"];
688         control = new Button ( 81, 1, "enter", *group );
689         buttons[0x51] = control;
690         controls.push_back( control );
691         controls_by_name["enter"] = control;
692         group->add( *control );
693
694         group = groups["functions"];
695         control = new Button ( 82, 1, "cancel", *group );
696         buttons[0x52] = control;
697         controls.push_back( control );
698         controls_by_name["cancel"] = control;
699         group->add( *control );
700
701         group = groups["functions"];
702         control = new Button ( 83, 1, "mixer", *group );
703         buttons[0x53] = control;
704         controls.push_back( control );
705         controls_by_name["mixer"] = control;
706         group->add( *control );
707
708         group = groups["transport"];
709         control = new Button ( 84, 1, "frm_left", *group );
710         buttons[0x54] = control;
711         controls.push_back( control );
712         controls_by_name["frm_left"] = control;
713         group->add( *control );
714
715         group = groups["transport"];
716         control = new Button ( 85, 1, "frm_right", *group );
717         buttons[0x55] = control;
718         controls.push_back( control );
719         controls_by_name["frm_right"] = control;
720         group->add( *control );
721
722         group = groups["transport"];
723         control = new Button ( 70, 1, "loop", *group );
724         buttons[0x46] = control;
725         controls.push_back( control );
726         controls_by_name["loop"] = control;
727         group->add( *control );
728
729         group = groups["transport"];
730         control = new Button ( 44, 1, "punch_in", *group );
731         buttons[0x2c] = control;
732         controls.push_back( control );
733         controls_by_name["punch_in"] = control;
734         group->add( *control );
735
736         group = groups["transport"];
737         control = new Button ( 43, 1, "punch_out", *group );
738         buttons[0x2b] = control;
739         controls.push_back( control );
740         controls_by_name["punch_out"] = control;
741         group->add( *control );
742
743         group = groups["transport"];
744         control = new Button ( 42, 1, "home", *group );
745         buttons[0x2a] = control;
746         controls.push_back( control );
747         controls_by_name["home"] = control;
748         group->add( *control );
749
750         group = groups["transport"];
751         control = new Button ( 41, 1, "end", *group );
752         buttons[0x29] = control;
753         controls.push_back( control );
754         controls_by_name["end"] = control;
755         group->add( *control );
756
757         group = groups["transport"];
758         control = new Button ( 91, 1, "rewind", *group );
759         buttons[0x5b] = control;
760         controls.push_back( control );
761         controls_by_name["rewind"] = control;
762         group->add( *control );
763
764         group = groups["transport"];
765         control = new Button ( 92, 1, "ffwd", *group );
766         buttons[0x5c] = control;
767         controls.push_back( control );
768         controls_by_name["ffwd"] = control;
769         group->add( *control );
770
771         group = groups["transport"];
772         control = new Button ( 93, 1, "stop", *group );
773         buttons[0x5d] = control;
774         controls.push_back( control );
775         controls_by_name["stop"] = control;
776         group->add( *control );
777
778         group = groups["transport"];
779         control = new Button ( 94, 1, "play", *group );
780         buttons[0x5e] = control;
781         controls.push_back( control );
782         controls_by_name["play"] = control;
783         group->add( *control );
784
785         group = groups["transport"];
786         control = new Button ( 31, 1, "record", *group );
787         buttons[0x1f] = control;
788         controls.push_back( control );
789         controls_by_name["record"] = control;
790         group->add( *control );
791
792         group = groups["cursor"];
793         control = new Button ( 96, 1, "cursor_up", *group );
794         buttons[0x60] = control;
795         controls.push_back( control );
796         controls_by_name["cursor_up"] = control;
797         group->add( *control );
798
799         group = groups["cursor"];
800         control = new Button ( 97, 1, "cursor_down", *group );
801         buttons[0x61] = control;
802         controls.push_back( control );
803         controls_by_name["cursor_down"] = control;
804         group->add( *control );
805
806         group = groups["cursor"];
807         control = new Button ( 98, 1, "cursor_left", *group );
808         buttons[0x62] = control;
809         controls.push_back( control );
810         controls_by_name["cursor_left"] = control;
811         group->add( *control );
812
813         group = groups["cursor"];
814         control = new Button ( 99, 1, "cursor_right", *group );
815         buttons[0x63] = control;
816         controls.push_back( control );
817         controls_by_name["cursor_right"] = control;
818         group->add( *control );
819
820         group = groups["none"];
821         control = new Button ( 100, 1, "zoom", *group );
822         buttons[0x64] = control;
823         controls.push_back( control );
824         controls_by_name["zoom"] = control;
825         group->add( *control );
826
827         group = groups["none"];
828         control = new Button ( 101, 1, "scrub", *group );
829         buttons[0x65] = control;
830         controls.push_back( control );
831         controls_by_name["scrub"] = control;
832         group->add( *control );
833
834         group = groups["user"];
835         control = new Button ( 102, 1, "user_a", *group );
836         buttons[0x66] = control;
837         controls.push_back( control );
838         controls_by_name["user_a"] = control;
839         group->add( *control );
840
841         group = groups["user"];
842         control = new Button ( 103, 1, "user_b", *group );
843         buttons[0x67] = control;
844         controls.push_back( control );
845         controls_by_name["user_b"] = control;
846         group->add( *control );
847
848         group = groups["strip_1"];
849         control = new Button ( 104, 1, "fader_touch", *group );
850         buttons[0x68] = control;
851         controls.push_back( control );
852         group->add( *control );
853
854         group = groups["strip_2"];
855         control = new Button ( 105, 2, "fader_touch", *group );
856         buttons[0x69] = control;
857         controls.push_back( control );
858         group->add( *control );
859
860         group = groups["strip_3"];
861         control = new Button ( 106, 3, "fader_touch", *group );
862         buttons[0x6a] = control;
863         controls.push_back( control );
864         group->add( *control );
865
866         group = groups["strip_4"];
867         control = new Button ( 107, 4, "fader_touch", *group );
868         buttons[0x6b] = control;
869         controls.push_back( control );
870         group->add( *control );
871
872         group = groups["strip_5"];
873         control = new Button ( 108, 5, "fader_touch", *group );
874         buttons[0x6c] = control;
875         controls.push_back( control );
876         group->add( *control );
877
878         group = groups["strip_6"];
879         control = new Button ( 109, 6, "fader_touch", *group );
880         buttons[0x6d] = control;
881         controls.push_back( control );
882         group->add( *control );
883
884         group = groups["strip_7"];
885         control = new Button ( 110, 7, "fader_touch", *group );
886         buttons[0x6e] = control;
887         controls.push_back( control );
888         group->add( *control );
889
890         group = groups["master"];
891         control = new Button ( 111, 1, "fader_touch", *group );
892         buttons[0x6f] = control;
893         controls.push_back( control );
894         group->add( *control );
895
896         group = groups["master"];
897         control = new Button ( 23, 1, "mute", *group );
898         buttons[0x17] = control;
899         controls.push_back( control );
900         group->add( *control );
901
902         group = groups["none"];
903         control = new Button ( 51, 1, "clicking", *group );
904         buttons[0x33] = control;
905         controls.push_back( control );
906         controls_by_name["clicking"] = control;
907         group->add( *control );
908
909         group = groups["none"];
910         control = new Led ( 113, 1, "smpte", *group );
911         leds[0x71] = control;
912         controls.push_back( control );
913         controls_by_name["smpte"] = control;
914         group->add( *control );
915
916         group = groups["none"];
917         control = new Led ( 114, 1, "beats", *group );
918         leds[0x72] = control;
919         controls.push_back( control );
920         controls_by_name["beats"] = control;
921         group->add( *control );
922
923         group = groups["none"];
924         control = new Led ( 115, 1, "solo", *group );
925         leds[0x73] = control;
926         controls.push_back( control );
927         controls_by_name["solo"] = control;
928         group->add( *control );
929
930         group = groups["none"];
931         control = new Led ( 118, 1, "relay_click", *group );
932         leds[0x76] = control;
933         controls.push_back( control );
934         controls_by_name["relay_click"] = control;
935         group->add( *control );
936
937 }
938
939 void Mackie::BcfSurface::handle_button( MackieButtonHandler & mbh, ButtonState bs, Button & button )
940 {
941         if ( bs != press && bs != release )
942         {
943                 mbh.update_led( button, none );
944                 return;
945         }
946         
947         LedState ls;
948         switch ( button.id() )
949         {
950
951                 case 0x28: // io
952                         switch ( bs ) {
953                                 case press: ls = mbh.io_press( button ); break;
954                                 case release: ls = mbh.io_release( button ); break;
955                                 case neither: break;
956                         }
957                         break;
958
959                 case 0x5a: // sends
960                         switch ( bs ) {
961                                 case press: ls = mbh.sends_press( button ); break;
962                                 case release: ls = mbh.sends_release( button ); break;
963                                 case neither: break;
964                         }
965                         break;
966
967                 case 0x59: // pan
968                         switch ( bs ) {
969                                 case press: ls = mbh.pan_press( button ); break;
970                                 case release: ls = mbh.pan_release( button ); break;
971                                 case neither: break;
972                         }
973                         break;
974
975                 case 0x57: // plugin
976                         switch ( bs ) {
977                                 case press: ls = mbh.plugin_press( button ); break;
978                                 case release: ls = mbh.plugin_release( button ); break;
979                                 case neither: break;
980                         }
981                         break;
982
983                 case 0x58: // eq
984                         switch ( bs ) {
985                                 case press: ls = mbh.eq_press( button ); break;
986                                 case release: ls = mbh.eq_release( button ); break;
987                                 case neither: break;
988                         }
989                         break;
990
991                 case 0x2d: // dyn
992                         switch ( bs ) {
993                                 case press: ls = mbh.dyn_press( button ); break;
994                                 case release: ls = mbh.dyn_release( button ); break;
995                                 case neither: break;
996                         }
997                         break;
998
999                 case 0x2e: // left
1000                         switch ( bs ) {
1001                                 case press: ls = mbh.left_press( button ); break;
1002                                 case release: ls = mbh.left_release( button ); break;
1003                                 case neither: break;
1004                         }
1005                         break;
1006
1007                 case 0x2f: // right
1008                         switch ( bs ) {
1009                                 case press: ls = mbh.right_press( button ); break;
1010                                 case release: ls = mbh.right_release( button ); break;
1011                                 case neither: break;
1012                         }
1013                         break;
1014
1015                 case 0x30: // channel_left
1016                         switch ( bs ) {
1017                                 case press: ls = mbh.channel_left_press( button ); break;
1018                                 case release: ls = mbh.channel_left_release( button ); break;
1019                                 case neither: break;
1020                         }
1021                         break;
1022
1023                 case 0x31: // channel_right
1024                         switch ( bs ) {
1025                                 case press: ls = mbh.channel_right_press( button ); break;
1026                                 case release: ls = mbh.channel_right_release( button ); break;
1027                                 case neither: break;
1028                         }
1029                         break;
1030
1031                 case 0x32: // flip
1032                         switch ( bs ) {
1033                                 case press: ls = mbh.flip_press( button ); break;
1034                                 case release: ls = mbh.flip_release( button ); break;
1035                                 case neither: break;
1036                         }
1037                         break;
1038
1039                 case 0x56: // edit
1040                         switch ( bs ) {
1041                                 case press: ls = mbh.edit_press( button ); break;
1042                                 case release: ls = mbh.edit_release( button ); break;
1043                                 case neither: break;
1044                         }
1045                         break;
1046
1047                 case 0x34: // name_value
1048                         switch ( bs ) {
1049                                 case press: ls = mbh.name_value_press( button ); break;
1050                                 case release: ls = mbh.name_value_release( button ); break;
1051                                 case neither: break;
1052                         }
1053                         break;
1054
1055                 case 0x35: // smpte_beats
1056                         switch ( bs ) {
1057                                 case press: ls = mbh.smpte_beats_press( button ); break;
1058                                 case release: ls = mbh.smpte_beats_release( button ); break;
1059                                 case neither: break;
1060                         }
1061                         break;
1062
1063                 case 0x36: // F1
1064                         switch ( bs ) {
1065                                 case press: ls = mbh.F1_press( button ); break;
1066                                 case release: ls = mbh.F1_release( button ); break;
1067                                 case neither: break;
1068                         }
1069                         break;
1070
1071                 case 0x37: // F2
1072                         switch ( bs ) {
1073                                 case press: ls = mbh.F2_press( button ); break;
1074                                 case release: ls = mbh.F2_release( button ); break;
1075                                 case neither: break;
1076                         }
1077                         break;
1078
1079                 case 0x38: // F3
1080                         switch ( bs ) {
1081                                 case press: ls = mbh.F3_press( button ); break;
1082                                 case release: ls = mbh.F3_release( button ); break;
1083                                 case neither: break;
1084                         }
1085                         break;
1086
1087                 case 0x39: // F4
1088                         switch ( bs ) {
1089                                 case press: ls = mbh.F4_press( button ); break;
1090                                 case release: ls = mbh.F4_release( button ); break;
1091                                 case neither: break;
1092                         }
1093                         break;
1094
1095                 case 0x3a: // F5
1096                         switch ( bs ) {
1097                                 case press: ls = mbh.F5_press( button ); break;
1098                                 case release: ls = mbh.F5_release( button ); break;
1099                                 case neither: break;
1100                         }
1101                         break;
1102
1103                 case 0x3b: // F6
1104                         switch ( bs ) {
1105                                 case press: ls = mbh.F6_press( button ); break;
1106                                 case release: ls = mbh.F6_release( button ); break;
1107                                 case neither: break;
1108                         }
1109                         break;
1110
1111                 case 0x3c: // F7
1112                         switch ( bs ) {
1113                                 case press: ls = mbh.F7_press( button ); break;
1114                                 case release: ls = mbh.F7_release( button ); break;
1115                                 case neither: break;
1116                         }
1117                         break;
1118
1119                 case 0x3d: // F8
1120                         switch ( bs ) {
1121                                 case press: ls = mbh.F8_press( button ); break;
1122                                 case release: ls = mbh.F8_release( button ); break;
1123                                 case neither: break;
1124                         }
1125                         break;
1126
1127                 case 0x3e: // F9
1128                         switch ( bs ) {
1129                                 case press: ls = mbh.F9_press( button ); break;
1130                                 case release: ls = mbh.F9_release( button ); break;
1131                                 case neither: break;
1132                         }
1133                         break;
1134
1135                 case 0x3f: // F10
1136                         switch ( bs ) {
1137                                 case press: ls = mbh.F10_press( button ); break;
1138                                 case release: ls = mbh.F10_release( button ); break;
1139                                 case neither: break;
1140                         }
1141                         break;
1142
1143                 case 0x40: // F11
1144                         switch ( bs ) {
1145                                 case press: ls = mbh.F11_press( button ); break;
1146                                 case release: ls = mbh.F11_release( button ); break;
1147                                 case neither: break;
1148                         }
1149                         break;
1150
1151                 case 0x41: // F12
1152                         switch ( bs ) {
1153                                 case press: ls = mbh.F12_press( button ); break;
1154                                 case release: ls = mbh.F12_release( button ); break;
1155                                 case neither: break;
1156                         }
1157                         break;
1158
1159                 case 0x42: // F13
1160                         switch ( bs ) {
1161                                 case press: ls = mbh.F13_press( button ); break;
1162                                 case release: ls = mbh.F13_release( button ); break;
1163                                 case neither: break;
1164                         }
1165                         break;
1166
1167                 case 0x43: // F14
1168                         switch ( bs ) {
1169                                 case press: ls = mbh.F14_press( button ); break;
1170                                 case release: ls = mbh.F14_release( button ); break;
1171                                 case neither: break;
1172                         }
1173                         break;
1174
1175                 case 0x44: // F15
1176                         switch ( bs ) {
1177                                 case press: ls = mbh.F15_press( button ); break;
1178                                 case release: ls = mbh.F15_release( button ); break;
1179                                 case neither: break;
1180                         }
1181                         break;
1182
1183                 case 0x45: // F16
1184                         switch ( bs ) {
1185                                 case press: ls = mbh.F16_press( button ); break;
1186                                 case release: ls = mbh.F16_release( button ); break;
1187                                 case neither: break;
1188                         }
1189                         break;
1190
1191                 case 0x27: // global_solo
1192                         switch ( bs ) {
1193                                 case press: ls = mbh.global_solo_press( button ); break;
1194                                 case release: ls = mbh.global_solo_release( button ); break;
1195                                 case neither: break;
1196                         }
1197                         break;
1198
1199                 case 0x47: // option
1200                         switch ( bs ) {
1201                                 case press: ls = mbh.option_press( button ); break;
1202                                 case release: ls = mbh.option_release( button ); break;
1203                                 case neither: break;
1204                         }
1205                         break;
1206
1207                 case 0x48: // control
1208                         switch ( bs ) {
1209                                 case press: ls = mbh.control_press( button ); break;
1210                                 case release: ls = mbh.control_release( button ); break;
1211                                 case neither: break;
1212                         }
1213                         break;
1214
1215                 case 0x49: // cmd_alt
1216                         switch ( bs ) {
1217                                 case press: ls = mbh.cmd_alt_press( button ); break;
1218                                 case release: ls = mbh.cmd_alt_release( button ); break;
1219                                 case neither: break;
1220                         }
1221                         break;
1222
1223                 case 0x4a: // on
1224                         switch ( bs ) {
1225                                 case press: ls = mbh.on_press( button ); break;
1226                                 case release: ls = mbh.on_release( button ); break;
1227                                 case neither: break;
1228                         }
1229                         break;
1230
1231                 case 0x4b: // rec_ready
1232                         switch ( bs ) {
1233                                 case press: ls = mbh.rec_ready_press( button ); break;
1234                                 case release: ls = mbh.rec_ready_release( button ); break;
1235                                 case neither: break;
1236                         }
1237                         break;
1238
1239                 case 0x4c: // undo
1240                         switch ( bs ) {
1241                                 case press: ls = mbh.undo_press( button ); break;
1242                                 case release: ls = mbh.undo_release( button ); break;
1243                                 case neither: break;
1244                         }
1245                         break;
1246
1247                 case 0x4d: // snapshot
1248                         switch ( bs ) {
1249                                 case press: ls = mbh.snapshot_press( button ); break;
1250                                 case release: ls = mbh.snapshot_release( button ); break;
1251                                 case neither: break;
1252                         }
1253                         break;
1254
1255                 case 0x4e: // touch
1256                         switch ( bs ) {
1257                                 case press: ls = mbh.touch_press( button ); break;
1258                                 case release: ls = mbh.touch_release( button ); break;
1259                                 case neither: break;
1260                         }
1261                         break;
1262
1263                 case 0x4f: // redo
1264                         switch ( bs ) {
1265                                 case press: ls = mbh.redo_press( button ); break;
1266                                 case release: ls = mbh.redo_release( button ); break;
1267                                 case neither: break;
1268                         }
1269                         break;
1270
1271                 case 0x50: // marker
1272                         switch ( bs ) {
1273                                 case press: ls = mbh.marker_press( button ); break;
1274                                 case release: ls = mbh.marker_release( button ); break;
1275                                 case neither: break;
1276                         }
1277                         break;
1278
1279                 case 0x51: // enter
1280                         switch ( bs ) {
1281                                 case press: ls = mbh.enter_press( button ); break;
1282                                 case release: ls = mbh.enter_release( button ); break;
1283                                 case neither: break;
1284                         }
1285                         break;
1286
1287                 case 0x52: // cancel
1288                         switch ( bs ) {
1289                                 case press: ls = mbh.cancel_press( button ); break;
1290                                 case release: ls = mbh.cancel_release( button ); break;
1291                                 case neither: break;
1292                         }
1293                         break;
1294
1295                 case 0x53: // mixer
1296                         switch ( bs ) {
1297                                 case press: ls = mbh.mixer_press( button ); break;
1298                                 case release: ls = mbh.mixer_release( button ); break;
1299                                 case neither: break;
1300                         }
1301                         break;
1302
1303                 case 0x54: // frm_left
1304                         switch ( bs ) {
1305                                 case press: ls = mbh.frm_left_press( button ); break;
1306                                 case release: ls = mbh.frm_left_release( button ); break;
1307                                 case neither: break;
1308                         }
1309                         break;
1310
1311                 case 0x55: // frm_right
1312                         switch ( bs ) {
1313                                 case press: ls = mbh.frm_right_press( button ); break;
1314                                 case release: ls = mbh.frm_right_release( button ); break;
1315                                 case neither: break;
1316                         }
1317                         break;
1318
1319                 case 0x46: // loop
1320                         switch ( bs ) {
1321                                 case press: ls = mbh.loop_press( button ); break;
1322                                 case release: ls = mbh.loop_release( button ); break;
1323                                 case neither: break;
1324                         }
1325                         break;
1326
1327                 case 0x2c: // punch_in
1328                         switch ( bs ) {
1329                                 case press: ls = mbh.punch_in_press( button ); break;
1330                                 case release: ls = mbh.punch_in_release( button ); break;
1331                                 case neither: break;
1332                         }
1333                         break;
1334
1335                 case 0x2b: // punch_out
1336                         switch ( bs ) {
1337                                 case press: ls = mbh.punch_out_press( button ); break;
1338                                 case release: ls = mbh.punch_out_release( button ); break;
1339                                 case neither: break;
1340                         }
1341                         break;
1342
1343                 case 0x2a: // home
1344                         switch ( bs ) {
1345                                 case press: ls = mbh.home_press( button ); break;
1346                                 case release: ls = mbh.home_release( button ); break;
1347                                 case neither: break;
1348                         }
1349                         break;
1350
1351                 case 0x29: // end
1352                         switch ( bs ) {
1353                                 case press: ls = mbh.end_press( button ); break;
1354                                 case release: ls = mbh.end_release( button ); break;
1355                                 case neither: break;
1356                         }
1357                         break;
1358
1359                 case 0x5b: // rewind
1360                         switch ( bs ) {
1361                                 case press: ls = mbh.rewind_press( button ); break;
1362                                 case release: ls = mbh.rewind_release( button ); break;
1363                                 case neither: break;
1364                         }
1365                         break;
1366
1367                 case 0x5c: // ffwd
1368                         switch ( bs ) {
1369                                 case press: ls = mbh.ffwd_press( button ); break;
1370                                 case release: ls = mbh.ffwd_release( button ); break;
1371                                 case neither: break;
1372                         }
1373                         break;
1374
1375                 case 0x5d: // stop
1376                         switch ( bs ) {
1377                                 case press: ls = mbh.stop_press( button ); break;
1378                                 case release: ls = mbh.stop_release( button ); break;
1379                                 case neither: break;
1380                         }
1381                         break;
1382
1383                 case 0x5e: // play
1384                         switch ( bs ) {
1385                                 case press: ls = mbh.play_press( button ); break;
1386                                 case release: ls = mbh.play_release( button ); break;
1387                                 case neither: break;
1388                         }
1389                         break;
1390
1391                 case 0x1f: // record
1392                         switch ( bs ) {
1393                                 case press: ls = mbh.record_press( button ); break;
1394                                 case release: ls = mbh.record_release( button ); break;
1395                                 case neither: break;
1396                         }
1397                         break;
1398
1399                 case 0x60: // cursor_up
1400                         switch ( bs ) {
1401                                 case press: ls = mbh.cursor_up_press( button ); break;
1402                                 case release: ls = mbh.cursor_up_release( button ); break;
1403                                 case neither: break;
1404                         }
1405                         break;
1406
1407                 case 0x61: // cursor_down
1408                         switch ( bs ) {
1409                                 case press: ls = mbh.cursor_down_press( button ); break;
1410                                 case release: ls = mbh.cursor_down_release( button ); break;
1411                                 case neither: break;
1412                         }
1413                         break;
1414
1415                 case 0x62: // cursor_left
1416                         switch ( bs ) {
1417                                 case press: ls = mbh.cursor_left_press( button ); break;
1418                                 case release: ls = mbh.cursor_left_release( button ); break;
1419                                 case neither: break;
1420                         }
1421                         break;
1422
1423                 case 0x63: // cursor_right
1424                         switch ( bs ) {
1425                                 case press: ls = mbh.cursor_right_press( button ); break;
1426                                 case release: ls = mbh.cursor_right_release( button ); break;
1427                                 case neither: break;
1428                         }
1429                         break;
1430
1431                 case 0x64: // zoom
1432                         switch ( bs ) {
1433                                 case press: ls = mbh.zoom_press( button ); break;
1434                                 case release: ls = mbh.zoom_release( button ); break;
1435                                 case neither: break;
1436                         }
1437                         break;
1438
1439                 case 0x65: // scrub
1440                         switch ( bs ) {
1441                                 case press: ls = mbh.scrub_press( button ); break;
1442                                 case release: ls = mbh.scrub_release( button ); break;
1443                                 case neither: break;
1444                         }
1445                         break;
1446
1447                 case 0x66: // user_a
1448                         switch ( bs ) {
1449                                 case press: ls = mbh.user_a_press( button ); break;
1450                                 case release: ls = mbh.user_a_release( button ); break;
1451                                 case neither: break;
1452                         }
1453                         break;
1454
1455                 case 0x67: // user_b
1456                         switch ( bs ) {
1457                                 case press: ls = mbh.user_b_press( button ); break;
1458                                 case release: ls = mbh.user_b_release( button ); break;
1459                                 case neither: break;
1460                         }
1461                         break;
1462
1463                 case 0x33: // clicking
1464                         switch ( bs ) {
1465                                 case press: ls = mbh.clicking_press( button ); break;
1466                                 case release: ls = mbh.clicking_release( button ); break;
1467                                 case neither: break;
1468                         }
1469                         break;
1470
1471         }
1472         mbh.update_led( button, ls );
1473 }