add new sigc++2 directory
[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 ( 80, 1, "option", *group );
619         buttons[0x50] = 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 ( 73, 1, "cmd_alt", *group );
626         buttons[0x49] = control;
627         controls.push_back( control );
628         controls_by_name["cmd_alt"] = control;
629         group->add( *control );
630
631         group = groups["automation"];
632         control = new Button ( 74, 1, "on", *group );
633         buttons[0x4a] = control;
634         controls.push_back( control );
635         controls_by_name["on"] = control;
636         group->add( *control );
637
638         group = groups["automation"];
639         control = new Button ( 75, 1, "rec_ready", *group );
640         buttons[0x4b] = control;
641         controls.push_back( control );
642         controls_by_name["rec_ready"] = control;
643         group->add( *control );
644
645         group = groups["functions"];
646         control = new Button ( 76, 1, "undo", *group );
647         buttons[0x4c] = control;
648         controls.push_back( control );
649         controls_by_name["undo"] = control;
650         group->add( *control );
651
652         group = groups["automation"];
653         control = new Button ( 77, 1, "snapshot", *group );
654         buttons[0x4d] = control;
655         controls.push_back( control );
656         controls_by_name["snapshot"] = control;
657         group->add( *control );
658
659         group = groups["functions"];
660         control = new Button ( 79, 1, "redo", *group );
661         buttons[0x4f] = control;
662         controls.push_back( control );
663         controls_by_name["redo"] = control;
664         group->add( *control );
665
666         group = groups["functions"];
667         control = new Button ( 71, 1, "marker", *group );
668         buttons[0x47] = control;
669         controls.push_back( control );
670         controls_by_name["marker"] = control;
671         group->add( *control );
672
673         group = groups["functions"];
674         control = new Button ( 81, 1, "enter", *group );
675         buttons[0x51] = control;
676         controls.push_back( control );
677         controls_by_name["enter"] = control;
678         group->add( *control );
679
680         group = groups["functions"];
681         control = new Button ( 82, 1, "cancel", *group );
682         buttons[0x52] = control;
683         controls.push_back( control );
684         controls_by_name["cancel"] = control;
685         group->add( *control );
686
687         group = groups["functions"];
688         control = new Button ( 83, 1, "mixer", *group );
689         buttons[0x53] = control;
690         controls.push_back( control );
691         controls_by_name["mixer"] = control;
692         group->add( *control );
693
694         group = groups["transport"];
695         control = new Button ( 91, 1, "frm_left", *group );
696         buttons[0x5b] = control;
697         controls.push_back( control );
698         controls_by_name["frm_left"] = control;
699         group->add( *control );
700
701         group = groups["transport"];
702         control = new Button ( 92, 1, "frm_right", *group );
703         buttons[0x5c] = control;
704         controls.push_back( control );
705         controls_by_name["frm_right"] = control;
706         group->add( *control );
707
708         group = groups["transport"];
709         control = new Button ( 70, 1, "loop", *group );
710         buttons[0x46] = control;
711         controls.push_back( control );
712         controls_by_name["loop"] = control;
713         group->add( *control );
714
715         group = groups["transport"];
716         control = new Button ( 72, 1, "punch_in", *group );
717         buttons[0x48] = control;
718         controls.push_back( control );
719         controls_by_name["punch_in"] = control;
720         group->add( *control );
721
722         group = groups["transport"];
723         control = new Button ( 78, 1, "punch_out", *group );
724         buttons[0x4e] = control;
725         controls.push_back( control );
726         controls_by_name["punch_out"] = control;
727         group->add( *control );
728
729         group = groups["transport"];
730         control = new Button ( 42, 1, "home", *group );
731         buttons[0x2a] = control;
732         controls.push_back( control );
733         controls_by_name["home"] = control;
734         group->add( *control );
735
736         group = groups["transport"];
737         control = new Button ( 41, 1, "end", *group );
738         buttons[0x29] = control;
739         controls.push_back( control );
740         controls_by_name["end"] = control;
741         group->add( *control );
742
743         group = groups["transport"];
744         control = new Button ( 44, 1, "rewind", *group );
745         buttons[0x2c] = control;
746         controls.push_back( control );
747         controls_by_name["rewind"] = control;
748         group->add( *control );
749
750         group = groups["transport"];
751         control = new Button ( 43, 1, "ffwd", *group );
752         buttons[0x2b] = control;
753         controls.push_back( control );
754         controls_by_name["ffwd"] = control;
755         group->add( *control );
756
757         group = groups["transport"];
758         control = new Button ( 93, 1, "stop", *group );
759         buttons[0x5d] = control;
760         controls.push_back( control );
761         controls_by_name["stop"] = control;
762         group->add( *control );
763
764         group = groups["transport"];
765         control = new Button ( 94, 1, "play", *group );
766         buttons[0x5e] = control;
767         controls.push_back( control );
768         controls_by_name["play"] = control;
769         group->add( *control );
770
771         group = groups["transport"];
772         control = new Button ( 31, 1, "record", *group );
773         buttons[0x1f] = control;
774         controls.push_back( control );
775         controls_by_name["record"] = control;
776         group->add( *control );
777
778         group = groups["cursor"];
779         control = new Button ( 96, 1, "cursor_up", *group );
780         buttons[0x60] = control;
781         controls.push_back( control );
782         controls_by_name["cursor_up"] = control;
783         group->add( *control );
784
785         group = groups["cursor"];
786         control = new Button ( 97, 1, "cursor_down", *group );
787         buttons[0x61] = control;
788         controls.push_back( control );
789         controls_by_name["cursor_down"] = control;
790         group->add( *control );
791
792         group = groups["cursor"];
793         control = new Button ( 98, 1, "cursor_left", *group );
794         buttons[0x62] = control;
795         controls.push_back( control );
796         controls_by_name["cursor_left"] = control;
797         group->add( *control );
798
799         group = groups["cursor"];
800         control = new Button ( 99, 1, "cursor_right", *group );
801         buttons[0x63] = control;
802         controls.push_back( control );
803         controls_by_name["cursor_right"] = control;
804         group->add( *control );
805
806         group = groups["none"];
807         control = new Button ( 100, 1, "zoom", *group );
808         buttons[0x64] = control;
809         controls.push_back( control );
810         controls_by_name["zoom"] = control;
811         group->add( *control );
812
813         group = groups["none"];
814         control = new Button ( 101, 1, "scrub", *group );
815         buttons[0x65] = control;
816         controls.push_back( control );
817         controls_by_name["scrub"] = control;
818         group->add( *control );
819
820         group = groups["user"];
821         control = new Button ( 102, 1, "user_a", *group );
822         buttons[0x66] = control;
823         controls.push_back( control );
824         controls_by_name["user_a"] = control;
825         group->add( *control );
826
827         group = groups["user"];
828         control = new Button ( 103, 1, "user_b", *group );
829         buttons[0x67] = control;
830         controls.push_back( control );
831         controls_by_name["user_b"] = control;
832         group->add( *control );
833
834         group = groups["strip_1"];
835         control = new Button ( 104, 1, "fader_touch", *group );
836         buttons[0x68] = control;
837         controls.push_back( control );
838         group->add( *control );
839
840         group = groups["strip_2"];
841         control = new Button ( 105, 2, "fader_touch", *group );
842         buttons[0x69] = control;
843         controls.push_back( control );
844         group->add( *control );
845
846         group = groups["strip_3"];
847         control = new Button ( 106, 3, "fader_touch", *group );
848         buttons[0x6a] = control;
849         controls.push_back( control );
850         group->add( *control );
851
852         group = groups["strip_4"];
853         control = new Button ( 107, 4, "fader_touch", *group );
854         buttons[0x6b] = control;
855         controls.push_back( control );
856         group->add( *control );
857
858         group = groups["strip_5"];
859         control = new Button ( 108, 5, "fader_touch", *group );
860         buttons[0x6c] = control;
861         controls.push_back( control );
862         group->add( *control );
863
864         group = groups["strip_6"];
865         control = new Button ( 109, 6, "fader_touch", *group );
866         buttons[0x6d] = control;
867         controls.push_back( control );
868         group->add( *control );
869
870         group = groups["strip_7"];
871         control = new Button ( 110, 7, "fader_touch", *group );
872         buttons[0x6e] = control;
873         controls.push_back( control );
874         group->add( *control );
875
876         group = groups["master"];
877         control = new Button ( 111, 1, "fader_touch", *group );
878         buttons[0x6f] = control;
879         controls.push_back( control );
880         group->add( *control );
881
882         group = groups["master"];
883         control = new Button ( 23, 1, "mute", *group );
884         buttons[0x17] = control;
885         controls.push_back( control );
886         group->add( *control );
887
888         group = groups["none"];
889         control = new Button ( 51, 1, "clicking", *group );
890         buttons[0x33] = control;
891         controls.push_back( control );
892         controls_by_name["clicking"] = control;
893         group->add( *control );
894
895         group = groups["none"];
896         control = new Led ( 113, 1, "smpte", *group );
897         leds[0x71] = control;
898         controls.push_back( control );
899         controls_by_name["smpte"] = control;
900         group->add( *control );
901
902         group = groups["none"];
903         control = new Led ( 114, 1, "beats", *group );
904         leds[0x72] = control;
905         controls.push_back( control );
906         controls_by_name["beats"] = control;
907         group->add( *control );
908
909         group = groups["none"];
910         control = new Led ( 115, 1, "solo", *group );
911         leds[0x73] = control;
912         controls.push_back( control );
913         controls_by_name["solo"] = control;
914         group->add( *control );
915
916         group = groups["none"];
917         control = new Led ( 118, 1, "relay_click", *group );
918         leds[0x76] = control;
919         controls.push_back( control );
920         controls_by_name["relay_click"] = control;
921         group->add( *control );
922
923 }
924
925 void Mackie::BcfSurface::handle_button( MackieButtonHandler & mbh, ButtonState bs, Button & button )
926 {
927         if ( bs != press && bs != release )
928         {
929                 mbh.update_led( button, none );
930                 return;
931         }
932         
933         LedState ls;
934         switch ( button.id() )
935         {
936
937                 case 0x28: // io
938                         switch ( bs ) {
939                                 case press: ls = mbh.io_press( button ); break;
940                                 case release: ls = mbh.io_release( button ); break;
941                                 case neither: break;
942                         }
943                         break;
944
945                 case 0x5a: // sends
946                         switch ( bs ) {
947                                 case press: ls = mbh.sends_press( button ); break;
948                                 case release: ls = mbh.sends_release( button ); break;
949                                 case neither: break;
950                         }
951                         break;
952
953                 case 0x59: // pan
954                         switch ( bs ) {
955                                 case press: ls = mbh.pan_press( button ); break;
956                                 case release: ls = mbh.pan_release( button ); break;
957                                 case neither: break;
958                         }
959                         break;
960
961                 case 0x57: // plugin
962                         switch ( bs ) {
963                                 case press: ls = mbh.plugin_press( button ); break;
964                                 case release: ls = mbh.plugin_release( button ); break;
965                                 case neither: break;
966                         }
967                         break;
968
969                 case 0x58: // eq
970                         switch ( bs ) {
971                                 case press: ls = mbh.eq_press( button ); break;
972                                 case release: ls = mbh.eq_release( button ); break;
973                                 case neither: break;
974                         }
975                         break;
976
977                 case 0x2d: // dyn
978                         switch ( bs ) {
979                                 case press: ls = mbh.dyn_press( button ); break;
980                                 case release: ls = mbh.dyn_release( button ); break;
981                                 case neither: break;
982                         }
983                         break;
984
985                 case 0x2e: // left
986                         switch ( bs ) {
987                                 case press: ls = mbh.left_press( button ); break;
988                                 case release: ls = mbh.left_release( button ); break;
989                                 case neither: break;
990                         }
991                         break;
992
993                 case 0x2f: // right
994                         switch ( bs ) {
995                                 case press: ls = mbh.right_press( button ); break;
996                                 case release: ls = mbh.right_release( button ); break;
997                                 case neither: break;
998                         }
999                         break;
1000
1001                 case 0x30: // channel_left
1002                         switch ( bs ) {
1003                                 case press: ls = mbh.channel_left_press( button ); break;
1004                                 case release: ls = mbh.channel_left_release( button ); break;
1005                                 case neither: break;
1006                         }
1007                         break;
1008
1009                 case 0x31: // channel_right
1010                         switch ( bs ) {
1011                                 case press: ls = mbh.channel_right_press( button ); break;
1012                                 case release: ls = mbh.channel_right_release( button ); break;
1013                                 case neither: break;
1014                         }
1015                         break;
1016
1017                 case 0x32: // flip
1018                         switch ( bs ) {
1019                                 case press: ls = mbh.flip_press( button ); break;
1020                                 case release: ls = mbh.flip_release( button ); break;
1021                                 case neither: break;
1022                         }
1023                         break;
1024
1025                 case 0x56: // edit
1026                         switch ( bs ) {
1027                                 case press: ls = mbh.edit_press( button ); break;
1028                                 case release: ls = mbh.edit_release( button ); break;
1029                                 case neither: break;
1030                         }
1031                         break;
1032
1033                 case 0x34: // name_value
1034                         switch ( bs ) {
1035                                 case press: ls = mbh.name_value_press( button ); break;
1036                                 case release: ls = mbh.name_value_release( button ); break;
1037                                 case neither: break;
1038                         }
1039                         break;
1040
1041                 case 0x35: // smpte_beats
1042                         switch ( bs ) {
1043                                 case press: ls = mbh.smpte_beats_press( button ); break;
1044                                 case release: ls = mbh.smpte_beats_release( button ); break;
1045                                 case neither: break;
1046                         }
1047                         break;
1048
1049                 case 0x36: // F1
1050                         switch ( bs ) {
1051                                 case press: ls = mbh.F1_press( button ); break;
1052                                 case release: ls = mbh.F1_release( button ); break;
1053                                 case neither: break;
1054                         }
1055                         break;
1056
1057                 case 0x37: // F2
1058                         switch ( bs ) {
1059                                 case press: ls = mbh.F2_press( button ); break;
1060                                 case release: ls = mbh.F2_release( button ); break;
1061                                 case neither: break;
1062                         }
1063                         break;
1064
1065                 case 0x38: // F3
1066                         switch ( bs ) {
1067                                 case press: ls = mbh.F3_press( button ); break;
1068                                 case release: ls = mbh.F3_release( button ); break;
1069                                 case neither: break;
1070                         }
1071                         break;
1072
1073                 case 0x39: // F4
1074                         switch ( bs ) {
1075                                 case press: ls = mbh.F4_press( button ); break;
1076                                 case release: ls = mbh.F4_release( button ); break;
1077                                 case neither: break;
1078                         }
1079                         break;
1080
1081                 case 0x3a: // F5
1082                         switch ( bs ) {
1083                                 case press: ls = mbh.F5_press( button ); break;
1084                                 case release: ls = mbh.F5_release( button ); break;
1085                                 case neither: break;
1086                         }
1087                         break;
1088
1089                 case 0x3b: // F6
1090                         switch ( bs ) {
1091                                 case press: ls = mbh.F6_press( button ); break;
1092                                 case release: ls = mbh.F6_release( button ); break;
1093                                 case neither: break;
1094                         }
1095                         break;
1096
1097                 case 0x3c: // F7
1098                         switch ( bs ) {
1099                                 case press: ls = mbh.F7_press( button ); break;
1100                                 case release: ls = mbh.F7_release( button ); break;
1101                                 case neither: break;
1102                         }
1103                         break;
1104
1105                 case 0x3d: // F8
1106                         switch ( bs ) {
1107                                 case press: ls = mbh.F8_press( button ); break;
1108                                 case release: ls = mbh.F8_release( button ); break;
1109                                 case neither: break;
1110                         }
1111                         break;
1112
1113                 case 0x3e: // F9
1114                         switch ( bs ) {
1115                                 case press: ls = mbh.F9_press( button ); break;
1116                                 case release: ls = mbh.F9_release( button ); break;
1117                                 case neither: break;
1118                         }
1119                         break;
1120
1121                 case 0x3f: // F10
1122                         switch ( bs ) {
1123                                 case press: ls = mbh.F10_press( button ); break;
1124                                 case release: ls = mbh.F10_release( button ); break;
1125                                 case neither: break;
1126                         }
1127                         break;
1128
1129                 case 0x40: // F11
1130                         switch ( bs ) {
1131                                 case press: ls = mbh.F11_press( button ); break;
1132                                 case release: ls = mbh.F11_release( button ); break;
1133                                 case neither: break;
1134                         }
1135                         break;
1136
1137                 case 0x41: // F12
1138                         switch ( bs ) {
1139                                 case press: ls = mbh.F12_press( button ); break;
1140                                 case release: ls = mbh.F12_release( button ); break;
1141                                 case neither: break;
1142                         }
1143                         break;
1144
1145                 case 0x42: // F13
1146                         switch ( bs ) {
1147                                 case press: ls = mbh.F13_press( button ); break;
1148                                 case release: ls = mbh.F13_release( button ); break;
1149                                 case neither: break;
1150                         }
1151                         break;
1152
1153                 case 0x43: // F14
1154                         switch ( bs ) {
1155                                 case press: ls = mbh.F14_press( button ); break;
1156                                 case release: ls = mbh.F14_release( button ); break;
1157                                 case neither: break;
1158                         }
1159                         break;
1160
1161                 case 0x44: // F15
1162                         switch ( bs ) {
1163                                 case press: ls = mbh.F15_press( button ); break;
1164                                 case release: ls = mbh.F15_release( button ); break;
1165                                 case neither: break;
1166                         }
1167                         break;
1168
1169                 case 0x45: // F16
1170                         switch ( bs ) {
1171                                 case press: ls = mbh.F16_press( button ); break;
1172                                 case release: ls = mbh.F16_release( button ); break;
1173                                 case neither: break;
1174                         }
1175                         break;
1176
1177                 case 0x27: // global_solo
1178                         switch ( bs ) {
1179                                 case press: ls = mbh.global_solo_press( button ); break;
1180                                 case release: ls = mbh.global_solo_release( button ); break;
1181                                 case neither: break;
1182                         }
1183                         break;
1184
1185                 case 0x50: // option
1186                         switch ( bs ) {
1187                                 case press: ls = mbh.option_press( button ); break;
1188                                 case release: ls = mbh.option_release( button ); break;
1189                                 case neither: break;
1190                         }
1191                         break;
1192
1193                 case 0x49: // cmd_alt
1194                         switch ( bs ) {
1195                                 case press: ls = mbh.cmd_alt_press( button ); break;
1196                                 case release: ls = mbh.cmd_alt_release( button ); break;
1197                                 case neither: break;
1198                         }
1199                         break;
1200
1201                 case 0x4a: // on
1202                         switch ( bs ) {
1203                                 case press: ls = mbh.on_press( button ); break;
1204                                 case release: ls = mbh.on_release( button ); break;
1205                                 case neither: break;
1206                         }
1207                         break;
1208
1209                 case 0x4b: // rec_ready
1210                         switch ( bs ) {
1211                                 case press: ls = mbh.rec_ready_press( button ); break;
1212                                 case release: ls = mbh.rec_ready_release( button ); break;
1213                                 case neither: break;
1214                         }
1215                         break;
1216
1217                 case 0x4c: // undo
1218                         switch ( bs ) {
1219                                 case press: ls = mbh.undo_press( button ); break;
1220                                 case release: ls = mbh.undo_release( button ); break;
1221                                 case neither: break;
1222                         }
1223                         break;
1224
1225                 case 0x4d: // snapshot
1226                         switch ( bs ) {
1227                                 case press: ls = mbh.snapshot_press( button ); break;
1228                                 case release: ls = mbh.snapshot_release( button ); break;
1229                                 case neither: break;
1230                         }
1231                         break;
1232
1233                 case 0x4f: // redo
1234                         switch ( bs ) {
1235                                 case press: ls = mbh.redo_press( button ); break;
1236                                 case release: ls = mbh.redo_release( button ); break;
1237                                 case neither: break;
1238                         }
1239                         break;
1240
1241                 case 0x47: // marker
1242                         switch ( bs ) {
1243                                 case press: ls = mbh.marker_press( button ); break;
1244                                 case release: ls = mbh.marker_release( button ); break;
1245                                 case neither: break;
1246                         }
1247                         break;
1248
1249                 case 0x51: // enter
1250                         switch ( bs ) {
1251                                 case press: ls = mbh.enter_press( button ); break;
1252                                 case release: ls = mbh.enter_release( button ); break;
1253                                 case neither: break;
1254                         }
1255                         break;
1256
1257                 case 0x52: // cancel
1258                         switch ( bs ) {
1259                                 case press: ls = mbh.cancel_press( button ); break;
1260                                 case release: ls = mbh.cancel_release( button ); break;
1261                                 case neither: break;
1262                         }
1263                         break;
1264
1265                 case 0x53: // mixer
1266                         switch ( bs ) {
1267                                 case press: ls = mbh.mixer_press( button ); break;
1268                                 case release: ls = mbh.mixer_release( button ); break;
1269                                 case neither: break;
1270                         }
1271                         break;
1272
1273                 case 0x5b: // frm_left
1274                         switch ( bs ) {
1275                                 case press: ls = mbh.frm_left_press( button ); break;
1276                                 case release: ls = mbh.frm_left_release( button ); break;
1277                                 case neither: break;
1278                         }
1279                         break;
1280
1281                 case 0x5c: // frm_right
1282                         switch ( bs ) {
1283                                 case press: ls = mbh.frm_right_press( button ); break;
1284                                 case release: ls = mbh.frm_right_release( button ); break;
1285                                 case neither: break;
1286                         }
1287                         break;
1288
1289                 case 0x46: // loop
1290                         switch ( bs ) {
1291                                 case press: ls = mbh.loop_press( button ); break;
1292                                 case release: ls = mbh.loop_release( button ); break;
1293                                 case neither: break;
1294                         }
1295                         break;
1296
1297                 case 0x48: // punch_in
1298                         switch ( bs ) {
1299                                 case press: ls = mbh.punch_in_press( button ); break;
1300                                 case release: ls = mbh.punch_in_release( button ); break;
1301                                 case neither: break;
1302                         }
1303                         break;
1304
1305                 case 0x4e: // punch_out
1306                         switch ( bs ) {
1307                                 case press: ls = mbh.punch_out_press( button ); break;
1308                                 case release: ls = mbh.punch_out_release( button ); break;
1309                                 case neither: break;
1310                         }
1311                         break;
1312
1313                 case 0x2a: // home
1314                         switch ( bs ) {
1315                                 case press: ls = mbh.home_press( button ); break;
1316                                 case release: ls = mbh.home_release( button ); break;
1317                                 case neither: break;
1318                         }
1319                         break;
1320
1321                 case 0x29: // end
1322                         switch ( bs ) {
1323                                 case press: ls = mbh.end_press( button ); break;
1324                                 case release: ls = mbh.end_release( button ); break;
1325                                 case neither: break;
1326                         }
1327                         break;
1328
1329                 case 0x2c: // rewind
1330                         switch ( bs ) {
1331                                 case press: ls = mbh.rewind_press( button ); break;
1332                                 case release: ls = mbh.rewind_release( button ); break;
1333                                 case neither: break;
1334                         }
1335                         break;
1336
1337                 case 0x2b: // ffwd
1338                         switch ( bs ) {
1339                                 case press: ls = mbh.ffwd_press( button ); break;
1340                                 case release: ls = mbh.ffwd_release( button ); break;
1341                                 case neither: break;
1342                         }
1343                         break;
1344
1345                 case 0x5d: // stop
1346                         switch ( bs ) {
1347                                 case press: ls = mbh.stop_press( button ); break;
1348                                 case release: ls = mbh.stop_release( button ); break;
1349                                 case neither: break;
1350                         }
1351                         break;
1352
1353                 case 0x5e: // play
1354                         switch ( bs ) {
1355                                 case press: ls = mbh.play_press( button ); break;
1356                                 case release: ls = mbh.play_release( button ); break;
1357                                 case neither: break;
1358                         }
1359                         break;
1360
1361                 case 0x1f: // record
1362                         switch ( bs ) {
1363                                 case press: ls = mbh.record_press( button ); break;
1364                                 case release: ls = mbh.record_release( button ); break;
1365                                 case neither: break;
1366                         }
1367                         break;
1368
1369                 case 0x60: // cursor_up
1370                         switch ( bs ) {
1371                                 case press: ls = mbh.cursor_up_press( button ); break;
1372                                 case release: ls = mbh.cursor_up_release( button ); break;
1373                                 case neither: break;
1374                         }
1375                         break;
1376
1377                 case 0x61: // cursor_down
1378                         switch ( bs ) {
1379                                 case press: ls = mbh.cursor_down_press( button ); break;
1380                                 case release: ls = mbh.cursor_down_release( button ); break;
1381                                 case neither: break;
1382                         }
1383                         break;
1384
1385                 case 0x62: // cursor_left
1386                         switch ( bs ) {
1387                                 case press: ls = mbh.cursor_left_press( button ); break;
1388                                 case release: ls = mbh.cursor_left_release( button ); break;
1389                                 case neither: break;
1390                         }
1391                         break;
1392
1393                 case 0x63: // cursor_right
1394                         switch ( bs ) {
1395                                 case press: ls = mbh.cursor_right_press( button ); break;
1396                                 case release: ls = mbh.cursor_right_release( button ); break;
1397                                 case neither: break;
1398                         }
1399                         break;
1400
1401                 case 0x64: // zoom
1402                         switch ( bs ) {
1403                                 case press: ls = mbh.zoom_press( button ); break;
1404                                 case release: ls = mbh.zoom_release( button ); break;
1405                                 case neither: break;
1406                         }
1407                         break;
1408
1409                 case 0x65: // scrub
1410                         switch ( bs ) {
1411                                 case press: ls = mbh.scrub_press( button ); break;
1412                                 case release: ls = mbh.scrub_release( button ); break;
1413                                 case neither: break;
1414                         }
1415                         break;
1416
1417                 case 0x66: // user_a
1418                         switch ( bs ) {
1419                                 case press: ls = mbh.user_a_press( button ); break;
1420                                 case release: ls = mbh.user_a_release( button ); break;
1421                                 case neither: break;
1422                         }
1423                         break;
1424
1425                 case 0x67: // user_b
1426                         switch ( bs ) {
1427                                 case press: ls = mbh.user_b_press( button ); break;
1428                                 case release: ls = mbh.user_b_release( button ); break;
1429                                 case neither: break;
1430                         }
1431                         break;
1432
1433                 case 0x33: // clicking
1434                         switch ( bs ) {
1435                                 case press: ls = mbh.clicking_press( button ); break;
1436                                 case release: ls = mbh.clicking_release( button ); break;
1437                                 case neither: break;
1438                         }
1439                         break;
1440
1441         }
1442         mbh.update_led( button, ls );
1443 }