1cb388da487381001341cc4fe65120bdecb89c22
[ardour.git] / libs / surfaces / mackie / mcp_buttons.cc
1 /*
2         Copyright (C) 2006,2007 John Anderson
3         Copyright (C) 2012 Paul Davis
4
5         This program is free software; you can redistribute it and/or modify
6         it under the terms of the GNU General Public License as published by
7         the Free Software Foundation; either version 2 of the License, or
8         (at your option) any later version.
9
10         This program is distributed in the hope that it will be useful,
11         but WITHOUT ANY WARRANTY; without even the implied warranty of
12         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13         GNU General Public License for more details.
14
15         You should have received a copy of the GNU General Public License
16         along with this program; if not, write to the Free Software
17         Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #include <algorithm>
21
22 #include "pbd/memento_command.h"
23
24 #include "ardour/debug.h"
25 #include "ardour/session.h"
26 #include "ardour/route.h"
27 #include "ardour/location.h"
28 #include "ardour/rc_configuration.h"
29
30 #include "mackie_control_protocol.h"
31 #include "surface.h"
32 #include "fader.h"
33
34 #include "i18n.h"
35
36 /* handlers for all buttons, broken into a separate file to avoid clutter in
37  * mackie_control_protocol.cc 
38  */
39
40 using std::string;
41 using namespace ARDOUR;
42 using namespace PBD;
43 using namespace ArdourSurface;
44 using namespace Mackie;
45
46 LedState
47 MackieControlProtocol::shift_press (Button &)
48 {
49         _modifier_state |= MODIFIER_SHIFT;
50         return on;
51 }
52 LedState
53 MackieControlProtocol::shift_release (Button &)
54 {
55         _modifier_state &= ~MODIFIER_SHIFT;
56         return on;
57 }
58 LedState
59 MackieControlProtocol::option_press (Button &)
60 {
61         _modifier_state |= MODIFIER_OPTION;
62         return on;
63 }
64 LedState
65 MackieControlProtocol::option_release (Button &)
66 {
67         _modifier_state &= ~MODIFIER_OPTION;
68         return on;
69 }
70 LedState
71 MackieControlProtocol::control_press (Button &)
72 {
73         _modifier_state |= MODIFIER_CONTROL;
74         DEBUG_TRACE (DEBUG::MackieControl, string_compose ("CONTROL Press: modifier state now set to %1\n", _modifier_state));
75         return on;
76 }
77 LedState
78 MackieControlProtocol::control_release (Button &)
79 {
80         _modifier_state &= ~MODIFIER_CONTROL;
81         DEBUG_TRACE (DEBUG::MackieControl, string_compose ("CONTROL Release: modifier state now set to %1\n", _modifier_state));
82         return on;
83 }
84 LedState
85 MackieControlProtocol::cmd_alt_press (Button &)
86 {
87         _modifier_state |= MODIFIER_CMDALT;
88         return on;
89 }
90 LedState
91 MackieControlProtocol::cmd_alt_release (Button &)
92 {
93         _modifier_state &= ~MODIFIER_CMDALT;
94         return on;
95 }
96
97 LedState 
98 MackieControlProtocol::left_press (Button &)
99 {
100         Sorted sorted = get_sorted_routes();
101         uint32_t strip_cnt = n_strips (); 
102
103         DEBUG_TRACE (DEBUG::MackieControl, string_compose ("bank left with current initial = %1 nstrips = %2 tracks/busses = %3\n",
104                                                            _current_initial_bank, strip_cnt, sorted.size()));
105         if (_current_initial_bank > 0) {
106                 switch_banks ((_current_initial_bank - 1) / strip_cnt * strip_cnt);
107         } else {
108                 switch_banks (0);
109         }
110
111
112         return on;
113 }
114
115 LedState 
116 MackieControlProtocol::left_release (Button &)
117 {
118         return off;
119 }
120
121 LedState 
122 MackieControlProtocol::right_press (Button &)
123 {
124         Sorted sorted = get_sorted_routes();
125         uint32_t strip_cnt = n_strips();
126         uint32_t route_cnt = sorted.size();
127         uint32_t max_bank = route_cnt / strip_cnt * strip_cnt;
128
129
130         DEBUG_TRACE (DEBUG::MackieControl, string_compose ("bank right with current initial = %1 nstrips = %2 tracks/busses = %3\n",
131                                                            _current_initial_bank, strip_cnt, route_cnt));
132
133         if (_current_initial_bank < max_bank) {
134                 uint32_t new_initial = (_current_initial_bank / strip_cnt * strip_cnt) + strip_cnt;
135
136                 switch_banks (new_initial);
137         } else {
138                 switch_banks (max_bank);
139         }
140
141         return on;
142 }
143
144 LedState 
145 MackieControlProtocol::right_release (Button &)
146 {
147         if (_zoom_mode) {
148
149         }
150
151         return off;
152 }
153
154 LedState
155 MackieControlProtocol::cursor_left_press (Button& )
156 {
157         if (_zoom_mode) {
158
159                 if (_modifier_state & MODIFIER_OPTION) {
160                         /* reset selected tracks to default vertical zoom */
161                 } else {
162                         ZoomOut (); /* EMIT SIGNAL */
163                 }
164         } else {
165                 float page_fraction;
166                 if (_modifier_state == MODIFIER_CONTROL) {
167                         page_fraction = 1.0;
168                 } else if (_modifier_state == MODIFIER_OPTION) {
169                         page_fraction = 0.1;
170                 } else if (_modifier_state == MODIFIER_SHIFT) {
171                         page_fraction = 2.0;
172                 } else {
173                         page_fraction = 0.25;
174                 }
175
176                 ScrollTimeline (-page_fraction);
177         }
178
179         return off;
180 }
181
182 LedState
183 MackieControlProtocol::cursor_left_release (Button&)
184 {
185         return off;
186 }
187
188 LedState
189 MackieControlProtocol::cursor_right_press (Button& )
190 {
191         if (_zoom_mode) {
192                 
193                 if (_modifier_state & MODIFIER_OPTION) {
194                         /* reset selected tracks to default vertical zoom */
195                 } else {
196                         ZoomIn (); /* EMIT SIGNAL */
197                 }
198         } else {
199                 float page_fraction;
200                 if (_modifier_state == MODIFIER_CONTROL) {
201                         page_fraction = 1.0;
202                 } else if (_modifier_state == MODIFIER_OPTION) {
203                         page_fraction = 0.1;
204                 } else if (_modifier_state == MODIFIER_SHIFT) {
205                         page_fraction = 2.0;
206                 } else {
207                         page_fraction = 0.25;
208                 }
209
210                 ScrollTimeline (page_fraction);
211         }
212                         
213         return off;
214 }
215
216 LedState
217 MackieControlProtocol::cursor_right_release (Button&)
218 {
219         return off;
220 }
221
222 LedState
223 MackieControlProtocol::cursor_up_press (Button&)
224 {
225         if (_zoom_mode) {
226                 
227                 if (_modifier_state & MODIFIER_CONTROL) {
228                         VerticalZoomInSelected (); /* EMIT SIGNAL */
229                 } else {
230                         VerticalZoomInAll (); /* EMIT SIGNAL */
231                 }
232         } else {
233                 StepTracksUp (); /* EMIT SIGNAL */
234         }
235         return off;
236 }
237
238 LedState
239 MackieControlProtocol::cursor_up_release (Button&)
240 {
241         return off;
242 }
243
244 LedState
245 MackieControlProtocol::cursor_down_press (Button&)
246 {
247         if (_zoom_mode) {
248                 if (_modifier_state & MODIFIER_OPTION) {
249                         VerticalZoomOutSelected (); /* EMIT SIGNAL */
250                 } else {
251                         VerticalZoomOutAll (); /* EMIT SIGNAL */
252                 }
253         } else {
254                 StepTracksDown (); /* EMIT SIGNAL */
255         }
256         return off;
257 }
258
259 LedState
260 MackieControlProtocol::cursor_down_release (Button&)
261 {
262         return off;
263 }
264
265 LedState 
266 MackieControlProtocol::channel_left_press (Button &)
267 {
268         Sorted sorted = get_sorted_routes();
269         if (sorted.size() > n_strips()) {
270                 prev_track();
271                 return on;
272         } else {
273                 return flashing;
274         }
275 }
276
277 LedState 
278 MackieControlProtocol::channel_left_release (Button &)
279 {
280         return off;
281 }
282
283 LedState 
284 MackieControlProtocol::channel_right_press (Button &)
285 {
286         Sorted sorted = get_sorted_routes();
287         if (sorted.size() > n_strips()) {
288                 next_track();
289                 return on;
290         } else {
291                 return flashing;
292         }
293 }
294
295 LedState 
296 MackieControlProtocol::channel_right_release (Button &)
297 {
298         return off;
299 }
300
301 Mackie::LedState 
302 MackieControlProtocol::zoom_press (Mackie::Button &)
303 {
304         _zoom_mode = !_zoom_mode;
305         return (_zoom_mode ? on : off);
306 }
307
308 Mackie::LedState 
309 MackieControlProtocol::zoom_release (Mackie::Button &)
310 {
311         return (_zoom_mode ? on : off);
312 }
313
314 Mackie::LedState 
315 MackieControlProtocol::scrub_press (Mackie::Button &)
316 {
317         if (!surfaces.empty()) {
318                 surfaces.front()->next_jog_mode ();
319         }
320         return none;
321 }
322
323 Mackie::LedState 
324 MackieControlProtocol::scrub_release (Mackie::Button &)
325 {
326         return none;
327 }
328
329 LedState
330 MackieControlProtocol::undo_press (Button&)
331 {
332         if (_modifier_state & MODIFIER_SHIFT) {
333                 Redo(); /* EMIT SIGNAL */
334         } else {
335                 Undo(); /* EMIT SIGNAL */
336         }
337         return off;
338 }
339
340 LedState
341 MackieControlProtocol::undo_release (Button&)
342 {
343         return off;
344 }
345
346 LedState
347 MackieControlProtocol::redo_press (Button&)
348 {
349         Redo(); /* EMIT SIGNAL */
350         return off;
351 }
352
353 LedState
354 MackieControlProtocol::redo_release (Button&)
355 {
356         return off;
357 }
358
359 LedState 
360 MackieControlProtocol::drop_press (Button &)
361 {
362         session->remove_last_capture();
363         return on;
364 }
365
366 LedState 
367 MackieControlProtocol::drop_release (Button &)
368 {
369         return off;
370 }
371
372 LedState 
373 MackieControlProtocol::save_press (Button &)
374 {
375         session->save_state ("");
376         return on;
377 }
378
379 LedState 
380 MackieControlProtocol::save_release (Button &)
381 {
382         return off;
383 }
384
385 LedState 
386 MackieControlProtocol::timecode_beats_press (Button &)
387 {
388         switch (_timecode_type) {
389         case ARDOUR::AnyTime::BBT:
390                 _timecode_type = ARDOUR::AnyTime::Timecode;
391                 break;
392         case ARDOUR::AnyTime::Timecode:
393                 _timecode_type = ARDOUR::AnyTime::BBT;
394                 break;
395         default:
396                 return off;
397         }
398
399         update_timecode_beats_led();
400
401         return on;
402 }
403
404 LedState 
405 MackieControlProtocol::timecode_beats_release (Button &)
406 {
407         return off;
408 }
409
410 /////////////////////////////////////
411 // Functions
412 /////////////////////////////////////
413 LedState 
414 MackieControlProtocol::marker_press (Button &)
415 {
416         string markername;
417
418         session->locations()->next_available_name (markername,"mcu");
419         add_marker (markername);
420
421         return on;
422 }
423
424 LedState 
425 MackieControlProtocol::marker_release (Button &)
426 {
427         return off;
428 }
429
430 /////////////////////////////////////
431 // Transport Buttons
432 /////////////////////////////////////
433
434 LedState 
435 MackieControlProtocol::frm_left_press (Button &)
436 {
437         // can use first_mark_before/after as well
438         unsigned long elapsed = _frm_left_last.restart();
439
440         framepos_t pos = session->locations()->first_mark_before (session->transport_frame());
441         
442         // allow a quick double to go past a previous mark
443         if (session->transport_rolling() && elapsed < 500 && pos >= 0) {
444                 framepos_t pos_two_back = session->locations()->first_mark_before (pos);
445                 if (pos_two_back >= 0) {
446                         pos = pos_two_back;
447                 }
448         }
449
450         // move to the location, if it's valid
451         if (pos >= 0) {
452                 session->request_locate (pos, session->transport_rolling());
453         } else {
454                 session->request_locate (session->current_start_frame(), session->transport_rolling());
455         }
456
457         return on;
458 }
459
460 LedState 
461 MackieControlProtocol::frm_left_release (Button &)
462 {
463         return off;
464 }
465
466 LedState 
467 MackieControlProtocol::frm_right_press (Button &)
468 {
469         // can use first_mark_before/after as well
470         framepos_t pos = session->locations()->first_mark_after (session->transport_frame());
471         
472         if (pos >= 0) {
473                 session->request_locate (pos, session->transport_rolling());
474         } else {
475                 session->request_locate (session->current_end_frame(), session->transport_rolling());
476         }
477                 
478         return on;
479 }
480
481 LedState 
482 MackieControlProtocol::frm_right_release (Button &)
483 {
484         return off;
485 }
486
487 LedState 
488 MackieControlProtocol::stop_press (Button &)
489 {
490         transport_stop ();
491         return on;
492 }
493
494 LedState 
495 MackieControlProtocol::stop_release (Button &)
496 {
497         return session->transport_stopped();
498 }
499
500 LedState 
501 MackieControlProtocol::play_press (Button &)
502 {
503         /* if we're already rolling at normal speed, and we're pressed
504            again, jump back to where we started last time
505         */
506
507         transport_play (session->transport_speed() == 1.0);
508         return none;
509 }
510
511 LedState 
512 MackieControlProtocol::play_release (Button &)
513 {
514         return none;
515 }
516
517 LedState 
518 MackieControlProtocol::record_press (Button &)
519 {
520         rec_enable_toggle ();
521         return none;
522 }
523
524 LedState 
525 MackieControlProtocol::record_release (Button &)
526 {
527         return none;
528 }
529
530 LedState 
531 MackieControlProtocol::rewind_press (Button &)
532 {
533         if (_modifier_state == MODIFIER_CONTROL) {
534                 goto_start ();
535         } else {
536                 rewind ();
537         }
538         return none;
539 }
540
541 LedState 
542 MackieControlProtocol::rewind_release (Button &)
543 {
544         return none;
545 }
546
547 LedState 
548 MackieControlProtocol::ffwd_press (Button &)
549 {
550         if (_modifier_state == MODIFIER_CONTROL) {
551                 goto_end();
552         } else {
553                 ffwd ();
554         }
555         return none;
556 }
557
558 LedState 
559 MackieControlProtocol::ffwd_release (Button &)
560 {
561         return none;
562 }
563
564 LedState 
565 MackieControlProtocol::loop_press (Button &)
566 {
567         if (_modifier_state & MODIFIER_CONTROL) {
568                 set_view_mode (Loop);
569                 return on;
570         } else {
571                 session->request_play_loop (!session->get_play_loop());
572                 return none;
573         }
574 }
575
576 LedState 
577 MackieControlProtocol::loop_release (Button &)
578 {
579         return none;
580 }
581
582 LedState 
583 MackieControlProtocol::punch_in_press (Button &)
584 {
585         bool const state = !session->config.get_punch_in();
586         session->config.set_punch_in (state);
587         return state;
588 }
589
590 LedState 
591 MackieControlProtocol::punch_in_release (Button &)
592 {
593         return session->config.get_punch_in();
594 }
595
596 LedState 
597 MackieControlProtocol::punch_out_press (Button &)
598 {
599         bool const state = !session->config.get_punch_out();
600         session->config.set_punch_out (state);
601         return state;
602 }
603
604 LedState 
605 MackieControlProtocol::punch_out_release (Button &)
606 {
607         return session->config.get_punch_out();
608 }
609
610 LedState 
611 MackieControlProtocol::home_press (Button &)
612 {
613         session->goto_start();
614         return on;
615 }
616
617 LedState 
618 MackieControlProtocol::home_release (Button &)
619 {
620         return off;
621 }
622
623 LedState 
624 MackieControlProtocol::end_press (Button &)
625 {
626         session->goto_end();
627         return on;
628 }
629
630 LedState 
631 MackieControlProtocol::end_release (Button &)
632 {
633         return off;
634 }
635
636 LedState 
637 MackieControlProtocol::clicking_press (Button &)
638 {
639         bool state = !Config->get_clicking();
640         Config->set_clicking (state);
641         return state;
642 }
643
644 LedState 
645 MackieControlProtocol::clicking_release (Button &)
646 {
647         return Config->get_clicking();
648 }
649
650 LedState MackieControlProtocol::global_solo_press (Button &)
651 {
652         bool state = !session->soloing();
653         session->set_solo (session->get_routes(), state);
654         return state;
655 }
656
657 LedState MackieControlProtocol::global_solo_release (Button &)
658 {
659         return session->soloing();
660 }
661
662 LedState
663 MackieControlProtocol::enter_press (Button &) 
664
665         Enter(); /* EMIT SIGNAL */
666         return off;
667 }
668
669 LedState
670 MackieControlProtocol::enter_release (Button &) 
671
672         return off;
673 }
674
675 LedState
676 MackieControlProtocol::F1_press (Button &) 
677
678         return off; 
679 }
680 LedState
681 MackieControlProtocol::F1_release (Button &) 
682
683         return off; 
684 }
685 LedState
686 MackieControlProtocol::F2_press (Button &) 
687
688         return off; 
689 }
690 LedState
691 MackieControlProtocol::F2_release (Button &) 
692
693         return off; 
694 }
695 LedState
696 MackieControlProtocol::F3_press (Button &) 
697
698         return off; 
699 }
700 LedState
701 MackieControlProtocol::F3_release (Button &) 
702
703         return off; 
704 }
705 LedState
706 MackieControlProtocol::F4_press (Button &) 
707
708         return off; 
709 }
710 LedState
711 MackieControlProtocol::F4_release (Button &) 
712
713         return off; 
714 }
715 LedState
716 MackieControlProtocol::F5_press (Button &) 
717
718         return off; 
719 }
720 LedState
721 MackieControlProtocol::F5_release (Button &) 
722
723         return off; 
724 }
725 LedState
726 MackieControlProtocol::F6_press (Button &) 
727
728         return off; 
729 }
730 LedState
731 MackieControlProtocol::F6_release (Button &) 
732
733         return off; 
734 }
735 LedState
736 MackieControlProtocol::F7_press (Button &) 
737
738         return off; 
739 }
740 LedState
741 MackieControlProtocol::F7_release (Button &) 
742
743         return off; 
744 }
745 LedState
746 MackieControlProtocol::F8_press (Button &) 
747
748         CloseDialog (); /* EMIT SIGNAL */
749         return off; 
750 }
751 LedState
752 MackieControlProtocol::F8_release (Button &) 
753
754         return off; 
755 }
756
757 /* UNIMPLEMENTED */
758
759 LedState
760 MackieControlProtocol::io_press (Button &) 
761
762         return off; 
763 }
764 LedState
765 MackieControlProtocol::io_release (Button &) 
766
767         return off; 
768 }
769 LedState
770 MackieControlProtocol::sends_press (Button &) 
771
772         set_view_mode (Sends);
773         return on;
774 }
775 LedState
776 MackieControlProtocol::sends_release (Button &) 
777
778         return none; 
779 }
780 LedState
781 MackieControlProtocol::pan_press (Button &) 
782
783         return off; 
784 }
785 LedState
786 MackieControlProtocol::pan_release (Button &) 
787
788         return off; 
789 }
790 LedState
791 MackieControlProtocol::plugin_press (Button &) 
792
793         return off; 
794 }
795 LedState
796 MackieControlProtocol::plugin_release (Button &) 
797
798         return off; 
799 }
800 LedState
801 MackieControlProtocol::eq_press (Button &) 
802
803         set_view_mode (EQ);
804         return on;
805 }
806 LedState
807 MackieControlProtocol::eq_release (Button &) 
808
809         return none;
810 }
811 LedState
812 MackieControlProtocol::dyn_press (Button &) 
813
814         set_view_mode (Dynamics);
815         return on;
816 }
817 LedState
818 MackieControlProtocol::dyn_release (Button &) 
819
820         return none;
821 }
822 LedState
823 MackieControlProtocol::flip_press (Button &) 
824
825         if (_flip_mode != Normal) {
826                 set_flip_mode (Normal);
827         } else {
828                 set_flip_mode (Mirror);
829         }
830         return ((_flip_mode != Normal) ? on : off);
831 }
832 LedState
833 MackieControlProtocol::flip_release (Button &) 
834
835         return none;
836 }
837 LedState
838 MackieControlProtocol::edit_press (Button &) 
839
840         return off; 
841 }
842 LedState
843 MackieControlProtocol::edit_release (Button &) 
844
845         return off; 
846 }
847 LedState
848 MackieControlProtocol::name_value_press (Button &) 
849
850         return off; 
851 }
852 LedState
853 MackieControlProtocol::name_value_release (Button &) 
854
855         return off; 
856 }
857 LedState
858 MackieControlProtocol::F9_press (Button &) 
859
860         return off; 
861 }
862 LedState
863 MackieControlProtocol::F9_release (Button &) 
864
865         return off; 
866 }
867 LedState
868 MackieControlProtocol::F10_press (Button &) 
869
870         return off; 
871 }
872 LedState
873 MackieControlProtocol::F10_release (Button &) 
874
875         return off; 
876 }
877 LedState
878 MackieControlProtocol::F11_press (Button &) 
879
880         return off; 
881 }
882 LedState
883 MackieControlProtocol::F11_release (Button &) 
884
885         return off; 
886 }
887 LedState
888 MackieControlProtocol::F12_press (Button &) 
889
890         return off; 
891 }
892 LedState
893 MackieControlProtocol::F12_release (Button &) 
894
895         return off; 
896 }
897 LedState
898 MackieControlProtocol::F13_press (Button &) 
899
900         return off; 
901 }
902 LedState
903 MackieControlProtocol::F13_release (Button &) 
904
905         return off; 
906 }
907 LedState
908 MackieControlProtocol::F14_press (Button &) 
909
910         return off; 
911 }
912 LedState
913 MackieControlProtocol::F14_release (Button &) 
914
915         return off; 
916 }
917 LedState
918 MackieControlProtocol::F15_press (Button &) 
919
920         return off; 
921 }
922 LedState
923 MackieControlProtocol::F15_release (Button &) 
924
925         return off; 
926 }
927 LedState
928 MackieControlProtocol::F16_press (Button &) 
929
930         return off; 
931 }
932 LedState
933 MackieControlProtocol::F16_release (Button &) 
934
935         return off; 
936 }
937 LedState
938 MackieControlProtocol::on_press (Button &) 
939
940         return off; 
941 }
942 LedState
943 MackieControlProtocol::on_release (Button &) 
944
945         return off; 
946 }
947 LedState
948 MackieControlProtocol::rec_ready_press (Button &) 
949
950         return off; 
951 }
952 LedState
953 MackieControlProtocol::rec_ready_release (Button &) 
954
955         return off; 
956 }
957 LedState
958 MackieControlProtocol::touch_press (Button &) 
959
960         return off; 
961 }
962 LedState
963 MackieControlProtocol::touch_release (Button &) 
964
965         return off; 
966 }
967 LedState
968 MackieControlProtocol::cancel_press (Button &) 
969
970         return off; 
971 }
972 LedState
973 MackieControlProtocol::cancel_release (Button &) 
974
975         return off; 
976 }
977 LedState
978 MackieControlProtocol::mixer_press (Button &) 
979
980         return off; 
981 }
982 LedState
983 MackieControlProtocol::mixer_release (Button &) 
984
985         return off; 
986 }
987 LedState
988 MackieControlProtocol::user_a_press (Button &) 
989
990         transport_play (session->transport_speed() == 1.0);
991         return off; 
992 }
993 LedState
994 MackieControlProtocol::user_a_release (Button &) 
995
996         return off; 
997 }
998 LedState
999 MackieControlProtocol::user_b_press (Button &) 
1000
1001         transport_stop();
1002         return off; 
1003 }
1004 LedState
1005 MackieControlProtocol::user_b_release (Button &) 
1006
1007         return off; 
1008 }
1009
1010 LedState
1011 MackieControlProtocol::master_fader_touch_press (Mackie::Button &)
1012 {
1013         DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::master_fader_touch_press\n");
1014
1015         Fader* master_fader = surfaces.front()->master_fader();
1016
1017         boost::shared_ptr<AutomationControl> ac = master_fader->control ();
1018
1019         master_fader->set_in_use (true);
1020         master_fader->start_touch (transport_frame());
1021
1022         return none;
1023 }
1024 LedState
1025 MackieControlProtocol::master_fader_touch_release (Mackie::Button &)
1026 {
1027         DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::master_fader_touch_release\n");
1028
1029         Fader* master_fader = surfaces.front()->master_fader();
1030
1031         master_fader->set_in_use (false);
1032         master_fader->stop_touch (transport_frame(), true);
1033
1034         return none;
1035 }
1036
1037 Mackie::LedState 
1038 MackieControlProtocol::snapshot_press (Mackie::Button&) 
1039 {
1040         return none;
1041 }
1042 Mackie::LedState 
1043 MackieControlProtocol::snapshot_release (Mackie::Button&) 
1044 {
1045         return none;
1046 }
1047 Mackie::LedState 
1048 MackieControlProtocol::read_press (Mackie::Button&) 
1049 {
1050         _metering_active = !_metering_active;
1051         notify_metering_state_changed ();
1052         return _metering_active;
1053 }
1054 Mackie::LedState 
1055 MackieControlProtocol::read_release (Mackie::Button&) 
1056 {
1057         return _metering_active;
1058 }
1059 Mackie::LedState 
1060 MackieControlProtocol::write_press (Mackie::Button&) 
1061 {
1062         return none;
1063 }
1064 Mackie::LedState 
1065 MackieControlProtocol::write_release (Mackie::Button&) 
1066 {
1067         return none;
1068 }
1069 Mackie::LedState 
1070 MackieControlProtocol::fdrgroup_press (Mackie::Button&) 
1071 {
1072         return none;
1073 }
1074 Mackie::LedState 
1075 MackieControlProtocol::fdrgroup_release (Mackie::Button&) 
1076 {
1077         return none;
1078 }
1079 Mackie::LedState 
1080 MackieControlProtocol::clearsolo_press (Mackie::Button&) 
1081 {
1082         return none;
1083 }
1084 Mackie::LedState 
1085 MackieControlProtocol::clearsolo_release (Mackie::Button&) 
1086 {
1087         return none;
1088 }
1089 Mackie::LedState 
1090 MackieControlProtocol::track_press (Mackie::Button&) 
1091 {
1092         return none;
1093 }
1094 Mackie::LedState 
1095 MackieControlProtocol::track_release (Mackie::Button&) 
1096 {
1097         return none;
1098 }
1099 Mackie::LedState 
1100 MackieControlProtocol::send_press (Mackie::Button&) 
1101 {
1102         return none;
1103 }
1104 Mackie::LedState 
1105 MackieControlProtocol::send_release (Mackie::Button&) 
1106 {
1107         return none;
1108 }
1109 Mackie::LedState 
1110 MackieControlProtocol::miditracks_press (Mackie::Button&) 
1111 {
1112         return none;
1113 }
1114 Mackie::LedState 
1115 MackieControlProtocol::miditracks_release (Mackie::Button&) 
1116 {
1117         return none;
1118 }
1119 Mackie::LedState 
1120 MackieControlProtocol::inputs_press (Mackie::Button&) 
1121 {
1122         return none;
1123 }
1124 Mackie::LedState 
1125 MackieControlProtocol::inputs_release (Mackie::Button&) 
1126 {
1127         return none;
1128 }
1129 Mackie::LedState 
1130 MackieControlProtocol::audiotracks_press (Mackie::Button&) 
1131 {
1132         return none;
1133 }
1134 Mackie::LedState 
1135 MackieControlProtocol::audiotracks_release (Mackie::Button&) 
1136 {
1137         return none;
1138 }
1139 Mackie::LedState 
1140 MackieControlProtocol::audioinstruments_press (Mackie::Button&) 
1141 {
1142         return none;
1143 }
1144 Mackie::LedState 
1145 MackieControlProtocol::audioinstruments_release (Mackie::Button&) 
1146 {
1147         return none;
1148 }
1149 Mackie::LedState 
1150 MackieControlProtocol::aux_press (Mackie::Button&) 
1151 {
1152         return none;
1153 }
1154 Mackie::LedState 
1155 MackieControlProtocol::aux_release (Mackie::Button&) 
1156 {
1157         return none;
1158 }
1159 Mackie::LedState 
1160 MackieControlProtocol::busses_press (Mackie::Button&) 
1161 {
1162         return none;
1163 }
1164 Mackie::LedState 
1165 MackieControlProtocol::busses_release (Mackie::Button&) 
1166 {
1167         return none;
1168 }
1169 Mackie::LedState 
1170 MackieControlProtocol::outputs_press (Mackie::Button&) 
1171 {
1172         return none;
1173 }
1174 Mackie::LedState 
1175 MackieControlProtocol::outputs_release (Mackie::Button&) 
1176 {
1177         return none;
1178 }
1179 Mackie::LedState 
1180 MackieControlProtocol::user_press (Mackie::Button&) 
1181 {
1182         return none;
1183 }
1184 Mackie::LedState 
1185 MackieControlProtocol::user_release (Mackie::Button&) 
1186 {
1187         return none;
1188 }
1189 Mackie::LedState 
1190 MackieControlProtocol::trim_press (Mackie::Button&) 
1191 {
1192         return none;
1193 }
1194 Mackie::LedState 
1195 MackieControlProtocol::trim_release (Mackie::Button&) 
1196 {
1197         return none;
1198 }
1199 Mackie::LedState 
1200 MackieControlProtocol::latch_press (Mackie::Button&) 
1201 {
1202         return none;
1203 }
1204 Mackie::LedState 
1205 MackieControlProtocol::latch_release (Mackie::Button&) 
1206 {
1207         return none;
1208 }
1209 Mackie::LedState 
1210 MackieControlProtocol::grp_press (Mackie::Button&) 
1211 {
1212         return none;
1213 }
1214 Mackie::LedState 
1215 MackieControlProtocol::grp_release (Mackie::Button&) 
1216 {
1217         return none;
1218 }
1219 Mackie::LedState 
1220 MackieControlProtocol::nudge_press (Mackie::Button&) 
1221 {
1222         return none;
1223 }
1224 Mackie::LedState 
1225 MackieControlProtocol::nudge_release (Mackie::Button&) 
1226 {
1227         return none;
1228 }
1229 Mackie::LedState 
1230 MackieControlProtocol::replace_press (Mackie::Button&) 
1231 {
1232         return none;
1233 }
1234 Mackie::LedState 
1235 MackieControlProtocol::replace_release (Mackie::Button&) 
1236 {
1237         return none;
1238 }
1239 Mackie::LedState 
1240 MackieControlProtocol::click_press (Mackie::Button&) 
1241 {
1242         return none;
1243 }
1244 Mackie::LedState 
1245 MackieControlProtocol::click_release (Mackie::Button&) 
1246 {
1247         return none;
1248 }
1249 Mackie::LedState 
1250 MackieControlProtocol::view_press (Mackie::Button&) 
1251 {
1252         return none;
1253 }
1254 Mackie::LedState 
1255 MackieControlProtocol::view_release (Mackie::Button&) 
1256 {
1257         return none;
1258 }