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