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