mackie: shift-stop additionally requests MIDI Panic, as well as regular stop
[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/profile.h"
26 #include "ardour/session.h"
27 #include "ardour/route.h"
28 #include "ardour/location.h"
29 #include "ardour/rc_configuration.h"
30
31 #include "mackie_control_protocol.h"
32 #include "surface.h"
33 #include "fader.h"
34
35 #include "i18n.h"
36
37 /* handlers for all buttons, broken into a separate file to avoid clutter in
38  * mackie_control_protocol.cc
39  */
40
41 using std::string;
42 using namespace ARDOUR;
43 using namespace PBD;
44 using namespace ArdourSurface;
45 using namespace Mackie;
46
47 LedState
48 MackieControlProtocol::shift_press (Button &)
49 {
50         _modifier_state |= MODIFIER_SHIFT;
51         return on;
52 }
53 LedState
54 MackieControlProtocol::shift_release (Button &)
55 {
56         _modifier_state &= ~MODIFIER_SHIFT;
57         return off;
58 }
59 LedState
60 MackieControlProtocol::option_press (Button &)
61 {
62         _modifier_state |= MODIFIER_OPTION;
63         return on;
64 }
65 LedState
66 MackieControlProtocol::option_release (Button &)
67 {
68         _modifier_state &= ~MODIFIER_OPTION;
69         return off;
70 }
71 LedState
72 MackieControlProtocol::control_press (Button &)
73 {
74         _modifier_state |= MODIFIER_CONTROL;
75         DEBUG_TRACE (DEBUG::MackieControl, string_compose ("CONTROL Press: modifier state now set to %1\n", _modifier_state));
76         return on;
77 }
78 LedState
79 MackieControlProtocol::control_release (Button &)
80 {
81         _modifier_state &= ~MODIFIER_CONTROL;
82         DEBUG_TRACE (DEBUG::MackieControl, string_compose ("CONTROL Release: modifier state now set to %1\n", _modifier_state));
83         return off;
84 }
85 LedState
86 MackieControlProtocol::cmd_alt_press (Button &)
87 {
88         _modifier_state |= MODIFIER_CMDALT;
89         return on;
90 }
91 LedState
92 MackieControlProtocol::cmd_alt_release (Button &)
93 {
94         _modifier_state &= ~MODIFIER_CMDALT;
95         return off;
96 }
97
98 LedState
99 MackieControlProtocol::left_press (Button &)
100 {
101         if (_subview_mode != None) {
102                 return none;
103         }
104
105         Sorted sorted = get_sorted_routes();
106         uint32_t strip_cnt = n_strips ();
107
108         DEBUG_TRACE (DEBUG::MackieControl, string_compose ("bank left with current initial = %1 nstrips = %2 tracks/busses = %3\n",
109                                                            _current_initial_bank, strip_cnt, sorted.size()));
110         if (_current_initial_bank > 0) {
111                 (void) switch_banks ((_current_initial_bank - 1) / strip_cnt * strip_cnt);
112         } else {
113                 (void) switch_banks (0);
114         }
115
116
117         return on;
118 }
119
120 LedState
121 MackieControlProtocol::left_release (Button &)
122 {
123         return none;
124 }
125
126 LedState
127 MackieControlProtocol::right_press (Button &)
128 {
129         if (_subview_mode != None) {
130                 return none;
131         }
132
133         Sorted sorted = get_sorted_routes();
134         uint32_t strip_cnt = n_strips();
135         uint32_t route_cnt = sorted.size();
136         uint32_t max_bank = route_cnt / strip_cnt * strip_cnt;
137
138
139         DEBUG_TRACE (DEBUG::MackieControl, string_compose ("bank right with current initial = %1 nstrips = %2 tracks/busses = %3\n",
140                                                            _current_initial_bank, strip_cnt, route_cnt));
141
142         if (_current_initial_bank < max_bank) {
143                 uint32_t new_initial = (_current_initial_bank / strip_cnt * strip_cnt) + strip_cnt;
144                 (void) switch_banks (new_initial);
145         }
146
147         return none;
148 }
149
150 LedState
151 MackieControlProtocol::right_release (Button &)
152 {
153         return none;
154 }
155
156 LedState
157 MackieControlProtocol::cursor_left_press (Button& )
158 {
159         if (zoom_mode()) {
160
161                 if (main_modifier_state() & MODIFIER_OPTION) {
162                         /* reset selected tracks to default vertical zoom */
163                 } else {
164                         ZoomOut (); /* EMIT SIGNAL */
165                 }
166         } else {
167                 float page_fraction;
168                 if (main_modifier_state() == MODIFIER_CONTROL) {
169                         page_fraction = 1.0;
170                 } else if (main_modifier_state() == MODIFIER_OPTION) {
171                         page_fraction = 0.1;
172                 } else if (main_modifier_state() == MODIFIER_SHIFT) {
173                         page_fraction = 2.0;
174                 } else {
175                         page_fraction = 0.25;
176                 }
177
178                 ScrollTimeline (-page_fraction);
179         }
180
181         return off;
182 }
183
184 LedState
185 MackieControlProtocol::cursor_left_release (Button&)
186 {
187         return off;
188 }
189
190 LedState
191 MackieControlProtocol::cursor_right_press (Button& )
192 {
193         if (zoom_mode()) {
194
195                 if (main_modifier_state() & MODIFIER_OPTION) {
196                         /* reset selected tracks to default vertical zoom */
197                 } else {
198                         ZoomIn (); /* EMIT SIGNAL */
199                 }
200         } else {
201                 float page_fraction;
202                 if (main_modifier_state() == MODIFIER_CONTROL) {
203                         page_fraction = 1.0;
204                 } else if (main_modifier_state() == MODIFIER_OPTION) {
205                         page_fraction = 0.1;
206                 } else if (main_modifier_state() == MODIFIER_SHIFT) {
207                         page_fraction = 2.0;
208                 } else {
209                         page_fraction = 0.25;
210                 }
211
212                 ScrollTimeline (page_fraction);
213         }
214
215         return off;
216 }
217
218 LedState
219 MackieControlProtocol::cursor_right_release (Button&)
220 {
221         return off;
222 }
223
224 LedState
225 MackieControlProtocol::cursor_up_press (Button&)
226 {
227         if (zoom_mode()) {
228
229                 if (main_modifier_state() & MODIFIER_CONTROL) {
230                         VerticalZoomInSelected (); /* EMIT SIGNAL */
231                 } else {
232                         VerticalZoomInAll (); /* EMIT SIGNAL */
233                 }
234         } else {
235                 StepTracksUp (); /* EMIT SIGNAL */
236         }
237         return off;
238 }
239
240 LedState
241 MackieControlProtocol::cursor_up_release (Button&)
242 {
243         return off;
244 }
245
246 LedState
247 MackieControlProtocol::cursor_down_press (Button&)
248 {
249         if (zoom_mode()) {
250                 if (main_modifier_state() & MODIFIER_OPTION) {
251                         VerticalZoomOutSelected (); /* EMIT SIGNAL */
252                 } else {
253                         VerticalZoomOutAll (); /* EMIT SIGNAL */
254                 }
255         } else {
256                 StepTracksDown (); /* EMIT SIGNAL */
257         }
258         return off;
259 }
260
261 LedState
262 MackieControlProtocol::cursor_down_release (Button&)
263 {
264         return off;
265 }
266
267 LedState
268 MackieControlProtocol::channel_left_press (Button &)
269 {
270         if (_subview_mode != None) {
271                 return none;
272         }
273         Sorted sorted = get_sorted_routes();
274         if (sorted.size() > n_strips()) {
275                 prev_track();
276                 return on;
277         } else {
278                 return flashing;
279         }
280 }
281
282 LedState
283 MackieControlProtocol::channel_left_release (Button &)
284 {
285         return off;
286 }
287
288 LedState
289 MackieControlProtocol::channel_right_press (Button &)
290 {
291         if (_subview_mode != None) {
292                 return none;
293         }
294         Sorted sorted = get_sorted_routes();
295         if (sorted.size() > n_strips()) {
296                 next_track();
297                 return on;
298         } else {
299                 return flashing;
300         }
301 }
302
303 LedState
304 MackieControlProtocol::channel_right_release (Button &)
305 {
306         return off;
307 }
308
309 Mackie::LedState
310 MackieControlProtocol::zoom_press (Mackie::Button &)
311 {
312         return none;
313 }
314
315 Mackie::LedState
316 MackieControlProtocol::zoom_release (Mackie::Button &)
317 {
318         if (_modifier_state & MODIFIER_ZOOM) {
319                 _modifier_state &= ~MODIFIER_ZOOM;
320         } else {
321                 _modifier_state |= MODIFIER_ZOOM;
322         }
323
324         return (zoom_mode() ? on : off);
325 }
326
327 Mackie::LedState
328 MackieControlProtocol::scrub_press (Mackie::Button &)
329 {
330         if (!surfaces.empty()) {
331                 // surfaces.front()->next_jog_mode ();
332                 _master_surface->next_jog_mode ();
333         }
334         return none;
335 }
336
337 Mackie::LedState
338 MackieControlProtocol::scrub_release (Mackie::Button &)
339 {
340         return none;
341 }
342
343 LedState
344 MackieControlProtocol::undo_press (Button&)
345 {
346         if (main_modifier_state() & MODIFIER_SHIFT) {
347                 Redo(); /* EMIT SIGNAL */
348         } else {
349                 Undo(); /* EMIT SIGNAL */
350         }
351         return off;
352 }
353
354 LedState
355 MackieControlProtocol::undo_release (Button&)
356 {
357         return off;
358 }
359
360 LedState
361 MackieControlProtocol::drop_press (Button &)
362 {
363         session->remove_last_capture();
364         return on;
365 }
366
367 LedState
368 MackieControlProtocol::drop_release (Button &)
369 {
370         return off;
371 }
372
373 LedState
374 MackieControlProtocol::save_press (Button &)
375 {
376         session->save_state ("");
377         return on;
378 }
379
380 LedState
381 MackieControlProtocol::save_release (Button &)
382 {
383         return off;
384 }
385
386 LedState
387 MackieControlProtocol::timecode_beats_press (Button &)
388 {
389         switch (_timecode_type) {
390         case ARDOUR::AnyTime::BBT:
391                 _timecode_type = ARDOUR::AnyTime::Timecode;
392                 break;
393         case ARDOUR::AnyTime::Timecode:
394                 _timecode_type = ARDOUR::AnyTime::BBT;
395                 break;
396         default:
397                 return off;
398         }
399
400         update_timecode_beats_led();
401
402         return on;
403 }
404
405 LedState
406 MackieControlProtocol::timecode_beats_release (Button &)
407 {
408         return off;
409 }
410
411 /////////////////////////////////////
412 // Functions
413 /////////////////////////////////////
414 LedState
415 MackieControlProtocol::marker_press (Button &)
416 {
417         string markername;
418
419         /* Don't add another mark if one exists within 1/100th of a second of
420          * the current position and we're not rolling.
421          */
422
423
424         framepos_t where = session->audible_frame();
425
426         if (session->transport_stopped() && session->locations()->mark_at (where, session->frame_rate() / 100.0)) {
427                 return off;
428         }
429
430         session->locations()->next_available_name (markername,"marker");
431         add_marker (markername);
432
433         return on;
434 }
435
436 LedState
437 MackieControlProtocol::marker_release (Button &)
438 {
439         return off;
440 }
441
442 /////////////////////////////////////
443 // Transport Buttons
444 /////////////////////////////////////
445
446 LedState
447 MackieControlProtocol::stop_press (Button &)
448 {
449         transport_stop ();
450
451         if (main_modifier_state() == MODIFIER_SHIFT) {
452                 session->midi_panic();
453         }
454
455         return on;
456 }
457
458 LedState
459 MackieControlProtocol::stop_release (Button &)
460 {
461         return session->transport_stopped();
462 }
463
464 LedState
465 MackieControlProtocol::play_press (Button &)
466 {
467         /* if we're already rolling at normal speed, and we're pressed
468            again, jump back to where we started last time
469         */
470
471         transport_play (session->transport_speed() == 1.0);
472         return none;
473 }
474
475 LedState
476 MackieControlProtocol::play_release (Button &)
477 {
478         return none;
479 }
480
481 LedState
482 MackieControlProtocol::record_press (Button &)
483 {
484         rec_enable_toggle ();
485         return none;
486 }
487
488 LedState
489 MackieControlProtocol::record_release (Button &)
490 {
491         return none;
492 }
493
494 LedState
495 MackieControlProtocol::rewind_press (Button &)
496 {
497         if (main_modifier_state() == MODIFIER_CONTROL) {
498                 goto_start ();
499         } else {
500                 rewind ();
501         }
502         return none;
503 }
504
505 LedState
506 MackieControlProtocol::rewind_release (Button &)
507 {
508         return none;
509 }
510
511 LedState
512 MackieControlProtocol::ffwd_press (Button &)
513 {
514         if (main_modifier_state() == MODIFIER_CONTROL) {
515                 goto_end();
516         } else {
517                 ffwd ();
518         }
519         return none;
520 }
521
522 LedState
523 MackieControlProtocol::ffwd_release (Button &)
524 {
525         return none;
526 }
527
528 LedState
529 MackieControlProtocol::loop_press (Button &)
530 {
531         bool was_on = session->get_play_loop();
532         session->request_play_loop (!was_on);
533         return was_on ? off : on;
534 }
535
536 LedState
537 MackieControlProtocol::loop_release (Button &)
538 {
539         return none;
540 }
541
542 LedState
543 MackieControlProtocol::clicking_press (Button &)
544 {
545         bool state = !Config->get_clicking();
546         Config->set_clicking (state);
547         return state;
548 }
549
550 LedState
551 MackieControlProtocol::clicking_release (Button &)
552 {
553         return Config->get_clicking();
554 }
555
556 LedState
557 MackieControlProtocol::enter_press (Button &)
558 {
559         Enter(); /* EMIT SIGNAL */
560         return off;
561 }
562
563 LedState
564 MackieControlProtocol::enter_release (Button &)
565 {
566         return off;
567 }
568
569 LedState
570 MackieControlProtocol::bank_release (Button& b, uint32_t basic_bank_num)
571 {
572         if (_subview_mode != None) {
573                 return none;
574         }
575
576         uint32_t bank_num = basic_bank_num;
577
578         if (b.long_press_count() > 0) {
579                 bank_num = 8 + basic_bank_num;
580         }
581
582         (void) switch_banks (n_strips() * bank_num);
583
584         return on;
585 }
586
587 LedState
588 MackieControlProtocol::F1_press (Button &b)
589 {
590         return off;
591 }
592 LedState
593 MackieControlProtocol::F1_release (Button &b)
594 {
595         return bank_release (b, 0);
596 }
597 LedState
598 MackieControlProtocol::F2_press (Button &)
599 {
600         return off;
601 }
602 LedState
603 MackieControlProtocol::F2_release (Button &b)
604 {
605         return bank_release (b, 1);
606 }
607 LedState
608 MackieControlProtocol::F3_press (Button &)
609 {
610         return off;
611 }
612 LedState
613 MackieControlProtocol::F3_release (Button &b)
614 {
615         return bank_release (b, 2);
616 }
617 LedState
618 MackieControlProtocol::F4_press (Button &)
619 {
620         return off;
621 }
622 LedState
623 MackieControlProtocol::F4_release (Button &b)
624 {
625         return bank_release (b, 3);
626 }
627 LedState
628 MackieControlProtocol::F5_press (Button &)
629 {
630         return off;
631 }
632 LedState
633 MackieControlProtocol::F5_release (Button &)
634 {
635         return off;
636 }
637 LedState
638 MackieControlProtocol::F6_press (Button &)
639 {
640         return off;
641 }
642 LedState
643 MackieControlProtocol::F6_release (Button &)
644 {
645         return off;
646 }
647 LedState
648 MackieControlProtocol::F7_press (Button &)
649 {
650         return off;
651 }
652 LedState
653 MackieControlProtocol::F7_release (Button &)
654 {
655         return off;
656 }
657 LedState
658 MackieControlProtocol::F8_press (Button &)
659 {
660         CloseDialog (); /* EMIT SIGNAL */
661         return off;
662 }
663 LedState
664 MackieControlProtocol::F8_release (Button &)
665 {
666         return off;
667 }
668
669 /* UNIMPLEMENTED */
670
671 LedState
672 MackieControlProtocol::pan_press (Button &)
673 {
674         set_pot_mode (Pan);
675         return none;
676 }
677 LedState
678 MackieControlProtocol::pan_release (Button &)
679 {
680         return none;
681 }
682 LedState
683 MackieControlProtocol::plugin_press (Button &)
684 {
685         return off;
686 }
687 LedState
688 MackieControlProtocol::plugin_release (Button &)
689 {
690         // Do not do this yet, since it does nothing
691         // set_view_mode (Plugins);
692         return none; /* LED state set by set_view_mode */
693 }
694 LedState
695 MackieControlProtocol::eq_press (Button &)
696 {
697         boost::shared_ptr<Route> r = first_selected_route ();
698         set_subview_mode (EQ, r);
699         return none; /* led state handled by set_subview_mode() */
700
701 }
702 LedState
703 MackieControlProtocol::eq_release (Button &)
704 {
705         return none;
706 }
707 LedState
708 MackieControlProtocol::dyn_press (Button &)
709 {
710         boost::shared_ptr<Route> r = first_selected_route ();
711         set_subview_mode (Dynamics, r);
712         return none; /* led state handled by set_subview_mode() */
713 }
714
715 LedState
716 MackieControlProtocol::dyn_release (Button &)
717 {
718         return none;
719 }
720 LedState
721 MackieControlProtocol::flip_press (Button &)
722 {
723         if (_flip_mode != Normal) {
724                 set_flip_mode (Normal);
725         } else {
726                 set_flip_mode (Mirror);
727         }
728         return ((_flip_mode != Normal) ? on : off);
729 }
730 LedState
731 MackieControlProtocol::flip_release (Button &)
732 {
733         return none;
734 }
735 LedState
736 MackieControlProtocol::name_value_press (Button &)
737 {
738         return off;
739 }
740 LedState
741 MackieControlProtocol::name_value_release (Button &)
742 {
743         return off;
744 }
745 LedState
746 MackieControlProtocol::touch_press (Button &)
747 {
748         return none;
749 }
750 LedState
751 MackieControlProtocol::touch_release (Button &)
752 {
753         set_automation_state (ARDOUR::Touch);
754         return none;
755 }
756 LedState
757 MackieControlProtocol::cancel_press (Button &)
758 {
759         return off;
760 }
761 LedState
762 MackieControlProtocol::cancel_release (Button &)
763 {
764         return off;
765 }
766 LedState
767 MackieControlProtocol::user_a_press (Button &)
768 {
769         transport_play (session->transport_speed() == 1.0);
770         return off;
771 }
772 LedState
773 MackieControlProtocol::user_a_release (Button &)
774 {
775         return off;
776 }
777 LedState
778 MackieControlProtocol::user_b_press (Button &)
779 {
780         transport_stop();
781         return off;
782 }
783 LedState
784 MackieControlProtocol::user_b_release (Button &)
785 {
786         return off;
787 }
788
789 LedState
790 MackieControlProtocol::master_fader_touch_press (Mackie::Button &)
791 {
792         DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::master_fader_touch_press\n");
793
794         Fader* master_fader = _master_surface->master_fader();
795
796         boost::shared_ptr<AutomationControl> ac = master_fader->control ();
797
798         master_fader->set_in_use (true);
799         master_fader->start_touch (transport_frame());
800
801         return none;
802 }
803 LedState
804 MackieControlProtocol::master_fader_touch_release (Mackie::Button &)
805 {
806         DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::master_fader_touch_release\n");
807
808         Fader* master_fader = _master_surface->master_fader();
809
810         master_fader->set_in_use (false);
811         master_fader->stop_touch (transport_frame(), true);
812
813         return none;
814 }
815
816 Mackie::LedState
817 MackieControlProtocol::read_press (Mackie::Button&)
818 {
819         return none;
820 }
821
822 Mackie::LedState
823 MackieControlProtocol::read_release (Mackie::Button&)
824 {
825         set_automation_state (ARDOUR::Play);
826         return none;
827 }
828 Mackie::LedState
829 MackieControlProtocol::write_press (Mackie::Button&)
830 {
831         return none;
832 }
833 Mackie::LedState
834 MackieControlProtocol::write_release (Mackie::Button&)
835 {
836         set_automation_state (ARDOUR::Write);
837         return none;
838 }
839
840 Mackie::LedState
841 MackieControlProtocol::clearsolo_press (Mackie::Button&)
842 {
843         // clears all solos and listens (pfl/afl)
844         session->set_solo (session->get_routes(), false);
845         session->set_listen (session->get_routes(), false);
846         return none;
847 }
848
849 Mackie::LedState
850 MackieControlProtocol::clearsolo_release (Mackie::Button&)
851 {
852         //return session->soloing();
853         return none;
854 }
855
856 Mackie::LedState
857 MackieControlProtocol::track_press (Mackie::Button&)
858 {
859         set_pot_mode (Trim);
860         return none;
861 }
862 Mackie::LedState
863 MackieControlProtocol::track_release (Mackie::Button&)
864 {
865         return none;
866 }
867 Mackie::LedState
868 MackieControlProtocol::send_press (Mackie::Button&)
869 {
870         boost::shared_ptr<Route> r = first_selected_route ();
871         set_subview_mode (Sends, r);
872         return none; /* led state handled by set_subview_mode() */
873 }
874 Mackie::LedState
875 MackieControlProtocol::send_release (Mackie::Button&)
876 {
877         return none;
878 }
879 Mackie::LedState
880 MackieControlProtocol::miditracks_press (Mackie::Button&)
881 {
882         return none;
883 }
884 Mackie::LedState
885 MackieControlProtocol::miditracks_release (Mackie::Button&)
886 {
887         set_view_mode (MidiTracks);
888         return none;
889 }
890 Mackie::LedState
891 MackieControlProtocol::inputs_press (Mackie::Button&)
892 {
893         return none;
894 }
895 Mackie::LedState
896 MackieControlProtocol::inputs_release (Mackie::Button&)
897 {
898         return none;
899 }
900 Mackie::LedState
901 MackieControlProtocol::audiotracks_press (Mackie::Button&)
902 {
903         return none;
904 }
905 Mackie::LedState
906 MackieControlProtocol::audiotracks_release (Mackie::Button&)
907 {
908         set_view_mode (AudioTracks);
909         return none;
910 }
911 Mackie::LedState
912 MackieControlProtocol::audioinstruments_press (Mackie::Button& b)
913 {
914         return none;
915 }
916
917 Mackie::LedState
918 MackieControlProtocol::audioinstruments_release (Mackie::Button& b)
919 {
920         return none;
921
922 }
923 Mackie::LedState
924 MackieControlProtocol::aux_press (Mackie::Button&)
925 {
926         return none;
927 }
928 Mackie::LedState
929 MackieControlProtocol::aux_release (Mackie::Button&)
930 {
931         set_view_mode (Auxes);
932         return none;
933 }
934 Mackie::LedState
935 MackieControlProtocol::busses_press (Mackie::Button&)
936 {
937         return none;
938 }
939 Mackie::LedState
940 MackieControlProtocol::busses_release (Mackie::Button&)
941 {
942         set_view_mode (Busses);
943         return none;
944 }
945 Mackie::LedState
946 MackieControlProtocol::outputs_press (Mackie::Button&)
947 {
948         return none;
949 }
950 Mackie::LedState
951 MackieControlProtocol::outputs_release (Mackie::Button&)
952 {
953         set_view_mode (Hidden);
954         return none;
955 }
956 Mackie::LedState
957 MackieControlProtocol::user_press (Mackie::Button&)
958 {
959         return none;
960 }
961 Mackie::LedState
962 MackieControlProtocol::user_release (Mackie::Button&)
963 {
964         set_view_mode (Selected);
965         return none;
966 }
967 Mackie::LedState
968 MackieControlProtocol::trim_press (Mackie::Button&)
969 {
970         return none;
971 }
972 Mackie::LedState
973 MackieControlProtocol::trim_release (Mackie::Button&)
974 {
975         return none;
976 }
977 Mackie::LedState
978 MackieControlProtocol::latch_press (Mackie::Button&)
979 {
980         return none;
981 }
982 Mackie::LedState
983 MackieControlProtocol::latch_release (Mackie::Button&)
984 {
985         return none;
986 }
987 Mackie::LedState
988 MackieControlProtocol::grp_press (Mackie::Button&)
989 {
990         return none;
991 }
992 Mackie::LedState
993 MackieControlProtocol::grp_release (Mackie::Button&)
994 {
995         /* There is no "Off" button for automation,
996            so we use Group for this purpose.
997         */
998         set_automation_state (Off);
999         return none;
1000 }
1001 Mackie::LedState
1002 MackieControlProtocol::nudge_press (Mackie::Button&)
1003 {
1004         return none;
1005 }
1006 Mackie::LedState
1007 MackieControlProtocol::nudge_release (Mackie::Button&)
1008 {
1009         return none;
1010 }
1011 Mackie::LedState
1012 MackieControlProtocol::replace_press (Mackie::Button&)
1013 {
1014         return none;
1015 }
1016 Mackie::LedState
1017 MackieControlProtocol::replace_release (Mackie::Button&)
1018 {
1019         return none;
1020 }
1021 Mackie::LedState
1022 MackieControlProtocol::click_press (Mackie::Button&)
1023 {
1024         return none;
1025 }
1026 Mackie::LedState
1027 MackieControlProtocol::click_release (Mackie::Button&)
1028 {
1029         return none;
1030 }
1031 Mackie::LedState
1032 MackieControlProtocol::view_press (Mackie::Button&)
1033 {
1034         set_view_mode (Mixer);
1035         return none;
1036 }
1037 Mackie::LedState
1038 MackieControlProtocol::view_release (Mackie::Button&)
1039 {
1040         return none;
1041 }