2012-04-09 13:48:16 -04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2006,2007 John Anderson
|
|
|
|
Copyright (C) 2012 Paul Davis
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
2012-04-26 12:18:03 -04:00
|
|
|
#include <algorithm>
|
|
|
|
|
2012-04-09 14:53:51 -04:00
|
|
|
#include "pbd/memento_command.h"
|
|
|
|
|
2012-04-10 22:54:25 -04:00
|
|
|
#include "ardour/debug.h"
|
2015-12-11 11:05:57 -05:00
|
|
|
#include "ardour/profile.h"
|
2012-04-09 13:48:16 -04:00
|
|
|
#include "ardour/session.h"
|
|
|
|
#include "ardour/route.h"
|
|
|
|
#include "ardour/location.h"
|
|
|
|
#include "ardour/rc_configuration.h"
|
|
|
|
|
|
|
|
#include "mackie_control_protocol.h"
|
2012-04-10 10:27:44 -04:00
|
|
|
#include "surface.h"
|
2012-06-09 15:06:52 -04:00
|
|
|
#include "fader.h"
|
2012-04-09 13:48:16 -04:00
|
|
|
|
2016-07-14 14:44:52 -04:00
|
|
|
#include "pbd/i18n.h"
|
2012-04-09 14:53:51 -04:00
|
|
|
|
2012-04-09 13:48:16 -04:00
|
|
|
/* handlers for all buttons, broken into a separate file to avoid clutter in
|
2015-10-04 14:51:05 -04:00
|
|
|
* mackie_control_protocol.cc
|
2012-04-09 13:48:16 -04:00
|
|
|
*/
|
|
|
|
|
2015-04-15 20:37:20 -04:00
|
|
|
using std::string;
|
2012-04-09 13:48:16 -04:00
|
|
|
using namespace ARDOUR;
|
2012-04-10 22:54:25 -04:00
|
|
|
using namespace PBD;
|
2015-04-15 20:37:20 -04:00
|
|
|
using namespace ArdourSurface;
|
|
|
|
using namespace Mackie;
|
2012-04-09 13:48:16 -04:00
|
|
|
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::shift_press (Button &)
|
|
|
|
{
|
|
|
|
_modifier_state |= MODIFIER_SHIFT;
|
|
|
|
return on;
|
|
|
|
}
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::shift_release (Button &)
|
|
|
|
{
|
|
|
|
_modifier_state &= ~MODIFIER_SHIFT;
|
2015-09-20 21:26:16 -04:00
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::option_press (Button &)
|
|
|
|
{
|
|
|
|
_modifier_state |= MODIFIER_OPTION;
|
|
|
|
return on;
|
|
|
|
}
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::option_release (Button &)
|
|
|
|
{
|
|
|
|
_modifier_state &= ~MODIFIER_OPTION;
|
2015-09-20 21:26:16 -04:00
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::control_press (Button &)
|
|
|
|
{
|
|
|
|
_modifier_state |= MODIFIER_CONTROL;
|
2012-04-11 21:14:43 -04:00
|
|
|
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("CONTROL Press: modifier state now set to %1\n", _modifier_state));
|
2012-04-09 13:48:16 -04:00
|
|
|
return on;
|
|
|
|
}
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::control_release (Button &)
|
|
|
|
{
|
|
|
|
_modifier_state &= ~MODIFIER_CONTROL;
|
2012-04-11 21:14:43 -04:00
|
|
|
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("CONTROL Release: modifier state now set to %1\n", _modifier_state));
|
2015-09-20 21:26:16 -04:00
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::cmd_alt_press (Button &)
|
|
|
|
{
|
|
|
|
_modifier_state |= MODIFIER_CMDALT;
|
|
|
|
return on;
|
|
|
|
}
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::cmd_alt_release (Button &)
|
|
|
|
{
|
|
|
|
_modifier_state &= ~MODIFIER_CMDALT;
|
2015-09-20 21:26:16 -04:00
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 14:53:51 -04:00
|
|
|
MackieControlProtocol::left_press (Button &)
|
|
|
|
{
|
2015-12-14 22:22:34 -05:00
|
|
|
if (_subview_mode != None) {
|
|
|
|
return none;
|
|
|
|
}
|
|
|
|
|
2016-05-16 16:45:37 -04:00
|
|
|
Sorted sorted = get_sorted_stripables();
|
2015-10-04 14:51:05 -04:00
|
|
|
uint32_t strip_cnt = n_strips ();
|
2012-04-10 20:10:31 -04:00
|
|
|
|
2012-04-10 22:54:25 -04:00
|
|
|
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("bank left with current initial = %1 nstrips = %2 tracks/busses = %3\n",
|
2012-06-13 11:38:15 -04:00
|
|
|
_current_initial_bank, strip_cnt, sorted.size()));
|
2015-05-27 08:57:16 -04:00
|
|
|
if (_current_initial_bank > 0) {
|
2016-01-28 16:27:33 -05:00
|
|
|
(void) switch_banks ((_current_initial_bank - 1) / strip_cnt * strip_cnt);
|
2015-05-27 08:57:16 -04:00
|
|
|
} else {
|
2016-01-28 16:27:33 -05:00
|
|
|
(void) switch_banks (0);
|
2015-05-27 08:57:16 -04:00
|
|
|
}
|
|
|
|
|
2012-04-27 16:35:45 -04:00
|
|
|
|
|
|
|
return on;
|
2012-04-09 14:53:51 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 14:53:51 -04:00
|
|
|
MackieControlProtocol::left_release (Button &)
|
|
|
|
{
|
2016-01-28 16:27:33 -05:00
|
|
|
return none;
|
2012-04-09 14:53:51 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 14:53:51 -04:00
|
|
|
MackieControlProtocol::right_press (Button &)
|
|
|
|
{
|
2015-12-14 22:22:34 -05:00
|
|
|
if (_subview_mode != None) {
|
|
|
|
return none;
|
|
|
|
}
|
|
|
|
|
2016-05-16 16:45:37 -04:00
|
|
|
Sorted sorted = get_sorted_stripables();
|
2012-04-10 10:27:44 -04:00
|
|
|
uint32_t strip_cnt = n_strips();
|
2012-04-26 12:18:03 -04:00
|
|
|
uint32_t route_cnt = sorted.size();
|
2015-05-26 10:21:55 -04:00
|
|
|
uint32_t max_bank = route_cnt / strip_cnt * strip_cnt;
|
|
|
|
|
2012-04-09 15:47:06 -04:00
|
|
|
|
2012-04-10 22:54:25 -04:00
|
|
|
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("bank right with current initial = %1 nstrips = %2 tracks/busses = %3\n",
|
2012-04-27 16:35:45 -04:00
|
|
|
_current_initial_bank, strip_cnt, route_cnt));
|
2012-04-10 22:54:25 -04:00
|
|
|
|
2015-05-26 10:21:55 -04:00
|
|
|
if (_current_initial_bank < max_bank) {
|
|
|
|
uint32_t new_initial = (_current_initial_bank / strip_cnt * strip_cnt) + strip_cnt;
|
2016-01-28 16:27:33 -05:00
|
|
|
(void) switch_banks (new_initial);
|
2015-05-26 10:21:55 -04:00
|
|
|
}
|
2012-04-26 12:18:03 -04:00
|
|
|
|
2016-01-28 16:27:33 -05:00
|
|
|
return none;
|
2012-04-09 14:53:51 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 14:53:51 -04:00
|
|
|
MackieControlProtocol::right_release (Button &)
|
|
|
|
{
|
2016-01-28 16:27:33 -05:00
|
|
|
return none;
|
2012-04-09 14:53:51 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::cursor_left_press (Button& )
|
|
|
|
{
|
2015-10-02 07:31:31 -04:00
|
|
|
if (zoom_mode()) {
|
2012-04-09 14:53:51 -04:00
|
|
|
|
2015-10-02 07:31:31 -04:00
|
|
|
if (main_modifier_state() & MODIFIER_OPTION) {
|
2012-04-09 14:53:51 -04:00
|
|
|
/* reset selected tracks to default vertical zoom */
|
|
|
|
} else {
|
|
|
|
ZoomOut (); /* EMIT SIGNAL */
|
|
|
|
}
|
2012-04-11 18:47:02 -04:00
|
|
|
} else {
|
|
|
|
float page_fraction;
|
2015-10-02 07:31:31 -04:00
|
|
|
if (main_modifier_state() == MODIFIER_CONTROL) {
|
2012-04-11 18:47:02 -04:00
|
|
|
page_fraction = 1.0;
|
2015-10-02 07:31:31 -04:00
|
|
|
} else if (main_modifier_state() == MODIFIER_OPTION) {
|
2012-04-11 18:47:02 -04:00
|
|
|
page_fraction = 0.1;
|
2015-10-02 07:31:31 -04:00
|
|
|
} else if (main_modifier_state() == MODIFIER_SHIFT) {
|
2012-04-11 18:47:02 -04:00
|
|
|
page_fraction = 2.0;
|
|
|
|
} else {
|
|
|
|
page_fraction = 0.25;
|
|
|
|
}
|
|
|
|
|
2012-04-11 18:57:01 -04:00
|
|
|
ScrollTimeline (-page_fraction);
|
2012-04-09 14:53:51 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return off;
|
|
|
|
}
|
|
|
|
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::cursor_left_release (Button&)
|
|
|
|
{
|
|
|
|
return off;
|
|
|
|
}
|
|
|
|
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::cursor_right_press (Button& )
|
|
|
|
{
|
2015-10-02 07:31:31 -04:00
|
|
|
if (zoom_mode()) {
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2015-10-02 07:31:31 -04:00
|
|
|
if (main_modifier_state() & MODIFIER_OPTION) {
|
2012-04-09 14:53:51 -04:00
|
|
|
/* reset selected tracks to default vertical zoom */
|
|
|
|
} else {
|
|
|
|
ZoomIn (); /* EMIT SIGNAL */
|
|
|
|
}
|
2012-04-11 18:47:02 -04:00
|
|
|
} else {
|
|
|
|
float page_fraction;
|
2015-10-02 07:31:31 -04:00
|
|
|
if (main_modifier_state() == MODIFIER_CONTROL) {
|
2012-04-11 18:47:02 -04:00
|
|
|
page_fraction = 1.0;
|
2015-10-02 07:31:31 -04:00
|
|
|
} else if (main_modifier_state() == MODIFIER_OPTION) {
|
2012-04-11 18:47:02 -04:00
|
|
|
page_fraction = 0.1;
|
2015-10-02 07:31:31 -04:00
|
|
|
} else if (main_modifier_state() == MODIFIER_SHIFT) {
|
2012-04-11 18:47:02 -04:00
|
|
|
page_fraction = 2.0;
|
|
|
|
} else {
|
|
|
|
page_fraction = 0.25;
|
|
|
|
}
|
2012-04-09 14:53:51 -04:00
|
|
|
|
2012-04-11 18:47:02 -04:00
|
|
|
ScrollTimeline (page_fraction);
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-04-09 14:53:51 -04:00
|
|
|
return off;
|
|
|
|
}
|
|
|
|
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::cursor_right_release (Button&)
|
|
|
|
{
|
|
|
|
return off;
|
|
|
|
}
|
|
|
|
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::cursor_up_press (Button&)
|
|
|
|
{
|
2015-10-02 07:31:31 -04:00
|
|
|
if (zoom_mode()) {
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2015-10-02 07:31:31 -04:00
|
|
|
if (main_modifier_state() & MODIFIER_CONTROL) {
|
2012-04-11 18:32:02 -04:00
|
|
|
VerticalZoomInSelected (); /* EMIT SIGNAL */
|
2012-04-09 14:53:51 -04:00
|
|
|
} else {
|
2012-04-11 18:32:02 -04:00
|
|
|
VerticalZoomInAll (); /* EMIT SIGNAL */
|
2012-04-09 14:53:51 -04:00
|
|
|
}
|
2012-04-25 23:46:18 -04:00
|
|
|
} else {
|
2016-02-03 19:11:21 -05:00
|
|
|
access_action ("Editor/select-prev-route");
|
2012-04-09 14:53:51 -04:00
|
|
|
}
|
|
|
|
return off;
|
|
|
|
}
|
|
|
|
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::cursor_up_release (Button&)
|
|
|
|
{
|
|
|
|
return off;
|
|
|
|
}
|
|
|
|
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::cursor_down_press (Button&)
|
|
|
|
{
|
2015-10-02 07:31:31 -04:00
|
|
|
if (zoom_mode()) {
|
|
|
|
if (main_modifier_state() & MODIFIER_OPTION) {
|
2012-04-11 18:32:02 -04:00
|
|
|
VerticalZoomOutSelected (); /* EMIT SIGNAL */
|
2012-04-09 14:53:51 -04:00
|
|
|
} else {
|
2012-04-11 18:32:02 -04:00
|
|
|
VerticalZoomOutAll (); /* EMIT SIGNAL */
|
2012-04-09 14:53:51 -04:00
|
|
|
}
|
2012-04-25 23:46:18 -04:00
|
|
|
} else {
|
2016-02-03 19:11:21 -05:00
|
|
|
access_action ("Editor/select-next-route");
|
2012-04-09 14:53:51 -04:00
|
|
|
}
|
|
|
|
return off;
|
|
|
|
}
|
|
|
|
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::cursor_down_release (Button&)
|
|
|
|
{
|
|
|
|
return off;
|
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 14:53:51 -04:00
|
|
|
MackieControlProtocol::channel_left_press (Button &)
|
|
|
|
{
|
2015-12-14 22:22:34 -05:00
|
|
|
if (_subview_mode != None) {
|
|
|
|
return none;
|
|
|
|
}
|
2016-05-16 16:45:37 -04:00
|
|
|
Sorted sorted = get_sorted_stripables();
|
2012-04-10 10:27:44 -04:00
|
|
|
if (sorted.size() > n_strips()) {
|
2012-04-09 14:53:51 -04:00
|
|
|
prev_track();
|
|
|
|
return on;
|
|
|
|
} else {
|
|
|
|
return flashing;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 14:53:51 -04:00
|
|
|
MackieControlProtocol::channel_left_release (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 14:53:51 -04:00
|
|
|
MackieControlProtocol::channel_right_press (Button &)
|
|
|
|
{
|
2015-12-14 22:22:34 -05:00
|
|
|
if (_subview_mode != None) {
|
|
|
|
return none;
|
|
|
|
}
|
2016-05-16 16:45:37 -04:00
|
|
|
Sorted sorted = get_sorted_stripables();
|
2012-04-10 10:27:44 -04:00
|
|
|
if (sorted.size() > n_strips()) {
|
2012-04-09 14:53:51 -04:00
|
|
|
next_track();
|
|
|
|
return on;
|
|
|
|
} else {
|
|
|
|
return flashing;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 14:53:51 -04:00
|
|
|
MackieControlProtocol::channel_right_release (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
2012-04-09 15:47:06 -04:00
|
|
|
MackieControlProtocol::zoom_press (Mackie::Button &)
|
|
|
|
{
|
2015-10-02 07:31:31 -04:00
|
|
|
return none;
|
2012-04-09 15:47:06 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
2012-04-09 15:47:06 -04:00
|
|
|
MackieControlProtocol::zoom_release (Mackie::Button &)
|
|
|
|
{
|
2015-10-02 07:31:31 -04:00
|
|
|
if (_modifier_state & MODIFIER_ZOOM) {
|
|
|
|
_modifier_state &= ~MODIFIER_ZOOM;
|
|
|
|
} else {
|
|
|
|
_modifier_state |= MODIFIER_ZOOM;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (zoom_mode() ? on : off);
|
2012-04-09 15:47:06 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
2012-04-09 15:47:06 -04:00
|
|
|
MackieControlProtocol::scrub_press (Mackie::Button &)
|
|
|
|
{
|
2012-04-22 13:37:52 -04:00
|
|
|
if (!surfaces.empty()) {
|
2015-09-08 23:47:16 -04:00
|
|
|
// surfaces.front()->next_jog_mode ();
|
|
|
|
_master_surface->next_jog_mode ();
|
2012-04-22 13:37:52 -04:00
|
|
|
}
|
|
|
|
return none;
|
2012-04-09 15:47:06 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
2012-04-09 15:47:06 -04:00
|
|
|
MackieControlProtocol::scrub_release (Mackie::Button &)
|
|
|
|
{
|
2012-04-22 13:37:52 -04:00
|
|
|
return none;
|
2012-04-09 15:47:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::undo_press (Button&)
|
|
|
|
{
|
2016-02-03 19:11:21 -05:00
|
|
|
if (main_modifier_state() == MODIFIER_SHIFT) {
|
|
|
|
redo();
|
|
|
|
} else {
|
|
|
|
undo ();
|
|
|
|
}
|
2016-02-01 12:20:55 -05:00
|
|
|
return none;
|
2012-04-09 15:47:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::undo_release (Button&)
|
|
|
|
{
|
2016-02-01 12:20:55 -05:00
|
|
|
return none;
|
2012-04-09 15:47:06 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 15:47:06 -04:00
|
|
|
MackieControlProtocol::drop_press (Button &)
|
|
|
|
{
|
2016-02-03 19:11:21 -05:00
|
|
|
if (main_modifier_state() == MODIFIER_SHIFT) {
|
|
|
|
toggle_punch_in();
|
2016-02-04 12:44:23 -05:00
|
|
|
return none;
|
2016-02-03 19:11:21 -05:00
|
|
|
} else {
|
|
|
|
access_action ("Editor/start-range-from-playhead");
|
|
|
|
}
|
2016-02-01 12:20:55 -05:00
|
|
|
return none;
|
2012-04-09 15:47:06 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 15:47:06 -04:00
|
|
|
MackieControlProtocol::drop_release (Button &)
|
|
|
|
{
|
2016-01-31 11:02:21 -05:00
|
|
|
return none;
|
2012-04-09 15:47:06 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 15:47:06 -04:00
|
|
|
MackieControlProtocol::save_press (Button &)
|
|
|
|
{
|
2016-02-03 19:11:21 -05:00
|
|
|
if (main_modifier_state() == MODIFIER_SHIFT) {
|
|
|
|
quick_snapshot_switch();
|
|
|
|
} else {
|
|
|
|
save_state ();
|
|
|
|
}
|
2016-04-08 16:49:47 -04:00
|
|
|
|
2016-02-01 12:22:01 -05:00
|
|
|
return none;
|
2012-04-09 15:47:06 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 15:47:06 -04:00
|
|
|
MackieControlProtocol::save_release (Button &)
|
|
|
|
{
|
2016-02-01 12:22:01 -05:00
|
|
|
return none;
|
2012-04-09 15:47:06 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 15:47:06 -04:00
|
|
|
MackieControlProtocol::timecode_beats_press (Button &)
|
|
|
|
{
|
|
|
|
switch (_timecode_type) {
|
|
|
|
case ARDOUR::AnyTime::BBT:
|
|
|
|
_timecode_type = ARDOUR::AnyTime::Timecode;
|
|
|
|
break;
|
|
|
|
case ARDOUR::AnyTime::Timecode:
|
|
|
|
_timecode_type = ARDOUR::AnyTime::BBT;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return off;
|
|
|
|
}
|
|
|
|
|
|
|
|
update_timecode_beats_led();
|
|
|
|
|
|
|
|
return on;
|
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 15:47:06 -04:00
|
|
|
MackieControlProtocol::timecode_beats_release (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
|
|
|
}
|
|
|
|
|
2012-04-09 14:53:51 -04:00
|
|
|
/////////////////////////////////////
|
|
|
|
// Functions
|
|
|
|
/////////////////////////////////////
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 14:53:51 -04:00
|
|
|
MackieControlProtocol::marker_press (Button &)
|
|
|
|
{
|
2016-02-04 10:30:37 -05:00
|
|
|
if (main_modifier_state() & MODIFIER_SHIFT) {
|
2016-02-06 15:47:27 -05:00
|
|
|
access_action ("Editor/remove-location-from-playhead");
|
2016-02-04 10:30:37 -05:00
|
|
|
return off;
|
|
|
|
} else {
|
|
|
|
_modifier_state |= MODIFIER_MARKER;
|
|
|
|
marker_modifier_consumed_by_button = false;
|
|
|
|
return on;
|
|
|
|
}
|
2016-01-31 11:01:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::marker_release (Button &)
|
|
|
|
{
|
2016-01-31 23:28:13 -05:00
|
|
|
_modifier_state &= ~MODIFIER_MARKER;
|
|
|
|
|
2016-02-04 12:17:45 -05:00
|
|
|
if (main_modifier_state() & MODIFIER_SHIFT)
|
|
|
|
return off; //if shift was held, we already did the action
|
|
|
|
|
2016-01-31 11:01:41 -05:00
|
|
|
if (marker_modifier_consumed_by_button) {
|
|
|
|
/* marker was used a modifier for some other button(s), so do
|
|
|
|
nothing
|
|
|
|
*/
|
|
|
|
return off;
|
|
|
|
}
|
|
|
|
|
2012-04-09 14:53:51 -04:00
|
|
|
string markername;
|
2012-04-11 16:18:01 -04:00
|
|
|
|
2015-12-10 09:17:05 -05:00
|
|
|
/* Don't add another mark if one exists within 1/100th of a second of
|
2015-12-10 10:58:03 -05:00
|
|
|
* the current position and we're not rolling.
|
2015-12-10 09:17:05 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
framepos_t where = session->audible_frame();
|
|
|
|
|
2015-12-10 10:58:03 -05:00
|
|
|
if (session->transport_stopped() && session->locations()->mark_at (where, session->frame_rate() / 100.0)) {
|
2015-12-10 09:17:05 -05:00
|
|
|
return off;
|
|
|
|
}
|
|
|
|
|
|
|
|
session->locations()->next_available_name (markername,"marker");
|
2012-04-11 16:18:01 -04:00
|
|
|
add_marker (markername);
|
|
|
|
|
2012-04-09 14:53:51 -04:00
|
|
|
return off;
|
|
|
|
}
|
|
|
|
|
2012-04-09 13:48:16 -04:00
|
|
|
/////////////////////////////////////
|
|
|
|
// Transport Buttons
|
|
|
|
/////////////////////////////////////
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 13:48:16 -04:00
|
|
|
MackieControlProtocol::stop_press (Button &)
|
|
|
|
{
|
2012-04-10 22:30:35 -04:00
|
|
|
transport_stop ();
|
2016-01-31 09:11:37 -05:00
|
|
|
|
|
|
|
if (main_modifier_state() == MODIFIER_SHIFT) {
|
|
|
|
session->midi_panic();
|
|
|
|
}
|
|
|
|
|
2012-04-09 13:48:16 -04:00
|
|
|
return on;
|
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 13:48:16 -04:00
|
|
|
MackieControlProtocol::stop_release (Button &)
|
|
|
|
{
|
|
|
|
return session->transport_stopped();
|
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 13:48:16 -04:00
|
|
|
MackieControlProtocol::play_press (Button &)
|
|
|
|
{
|
2012-04-11 21:51:57 -04:00
|
|
|
/* if we're already rolling at normal speed, and we're pressed
|
2012-04-11 16:25:14 -04:00
|
|
|
again, jump back to where we started last time
|
|
|
|
*/
|
|
|
|
|
2012-04-26 17:57:47 -04:00
|
|
|
transport_play (session->transport_speed() == 1.0);
|
2012-04-10 23:24:20 -04:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 13:48:16 -04:00
|
|
|
MackieControlProtocol::play_release (Button &)
|
|
|
|
{
|
2012-04-10 23:24:20 -04:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 13:48:16 -04:00
|
|
|
MackieControlProtocol::record_press (Button &)
|
|
|
|
{
|
2012-04-10 22:30:35 -04:00
|
|
|
rec_enable_toggle ();
|
2012-04-10 23:24:20 -04:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 13:48:16 -04:00
|
|
|
MackieControlProtocol::record_release (Button &)
|
|
|
|
{
|
2012-04-10 23:24:20 -04:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 13:48:16 -04:00
|
|
|
MackieControlProtocol::rewind_press (Button &)
|
|
|
|
{
|
2016-01-31 11:01:41 -05:00
|
|
|
if (modifier_state() & MODIFIER_MARKER) {
|
|
|
|
prev_marker ();
|
2016-01-31 11:17:23 -05:00
|
|
|
} else if (modifier_state() & MODIFIER_NUDGE) {
|
2016-02-01 12:20:55 -05:00
|
|
|
access_action ("Editor/nudge-playhead-backward");
|
2016-02-01 22:52:16 -05:00
|
|
|
} else if (main_modifier_state() & MODIFIER_SHIFT) {
|
2012-04-21 22:15:24 -04:00
|
|
|
goto_start ();
|
|
|
|
} else {
|
|
|
|
rewind ();
|
|
|
|
}
|
2012-04-10 23:24:20 -04:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 13:48:16 -04:00
|
|
|
MackieControlProtocol::rewind_release (Button &)
|
|
|
|
{
|
2012-04-10 23:24:20 -04:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 13:48:16 -04:00
|
|
|
MackieControlProtocol::ffwd_press (Button &)
|
|
|
|
{
|
2016-01-31 11:01:41 -05:00
|
|
|
if (modifier_state() & MODIFIER_MARKER) {
|
|
|
|
next_marker ();
|
2016-01-31 11:17:23 -05:00
|
|
|
} else if (modifier_state() & MODIFIER_NUDGE) {
|
2016-02-01 12:20:55 -05:00
|
|
|
access_action ("Editor/nudge-playhead-forward");
|
2016-02-01 22:52:16 -05:00
|
|
|
} else if (main_modifier_state() & MODIFIER_SHIFT) {
|
2012-04-21 22:15:24 -04:00
|
|
|
goto_end();
|
|
|
|
} else {
|
|
|
|
ffwd ();
|
|
|
|
}
|
2012-04-10 23:24:20 -04:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 13:48:16 -04:00
|
|
|
MackieControlProtocol::ffwd_release (Button &)
|
|
|
|
{
|
2012-04-10 23:24:20 -04:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 13:48:16 -04:00
|
|
|
MackieControlProtocol::loop_press (Button &)
|
|
|
|
{
|
2016-02-03 19:11:21 -05:00
|
|
|
if (main_modifier_state() & MODIFIER_SHIFT) {
|
|
|
|
access_action ("Editor/set-loop-from-edit-range");
|
|
|
|
return off;
|
|
|
|
} else {
|
|
|
|
bool was_on = session->get_play_loop();
|
|
|
|
session->request_play_loop (!was_on);
|
|
|
|
return was_on ? off : on;
|
|
|
|
}
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
LedState
|
2012-04-09 13:48:16 -04:00
|
|
|
MackieControlProtocol::loop_release (Button &)
|
|
|
|
{
|
2012-04-10 23:24:20 -04:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::enter_press (Button &)
|
|
|
|
{
|
2016-02-03 19:11:21 -05:00
|
|
|
if (main_modifier_state() & MODIFIER_SHIFT) {
|
|
|
|
access_action ("Transport/ToggleFollowEdits");
|
|
|
|
} else {
|
|
|
|
access_action ("Editor/select-all-tracks");
|
|
|
|
}
|
2016-02-01 12:22:01 -05:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::enter_release (Button &)
|
|
|
|
{
|
2016-02-01 12:22:01 -05:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
2012-04-16 09:06:39 -04:00
|
|
|
|
2012-04-09 13:48:16 -04:00
|
|
|
LedState
|
2015-10-07 15:12:09 -04:00
|
|
|
MackieControlProtocol::bank_release (Button& b, uint32_t basic_bank_num)
|
2015-10-04 14:51:05 -04:00
|
|
|
{
|
2015-12-14 22:22:34 -05:00
|
|
|
if (_subview_mode != None) {
|
|
|
|
return none;
|
|
|
|
}
|
|
|
|
|
2015-10-07 15:12:09 -04:00
|
|
|
uint32_t bank_num = basic_bank_num;
|
|
|
|
|
|
|
|
if (b.long_press_count() > 0) {
|
|
|
|
bank_num = 8 + basic_bank_num;
|
|
|
|
}
|
|
|
|
|
2016-01-28 16:27:33 -05:00
|
|
|
(void) switch_banks (n_strips() * bank_num);
|
2015-10-07 15:12:09 -04:00
|
|
|
|
|
|
|
return on;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
2015-10-07 15:12:09 -04:00
|
|
|
|
2012-04-09 13:48:16 -04:00
|
|
|
LedState
|
2015-10-07 15:12:09 -04:00
|
|
|
MackieControlProtocol::F1_press (Button &b)
|
2015-10-04 14:51:05 -04:00
|
|
|
{
|
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-07 15:12:09 -04:00
|
|
|
MackieControlProtocol::F1_release (Button &b)
|
|
|
|
{
|
|
|
|
return bank_release (b, 0);
|
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::F2_press (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-07 15:12:09 -04:00
|
|
|
MackieControlProtocol::F2_release (Button &b)
|
2015-10-04 14:51:05 -04:00
|
|
|
{
|
2015-10-07 15:12:09 -04:00
|
|
|
return bank_release (b, 1);
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::F3_press (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-07 15:12:09 -04:00
|
|
|
MackieControlProtocol::F3_release (Button &b)
|
2015-10-04 14:51:05 -04:00
|
|
|
{
|
2015-10-07 15:12:09 -04:00
|
|
|
return bank_release (b, 2);
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::F4_press (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-07 15:12:09 -04:00
|
|
|
MackieControlProtocol::F4_release (Button &b)
|
2015-10-04 14:51:05 -04:00
|
|
|
{
|
2015-10-07 15:12:09 -04:00
|
|
|
return bank_release (b, 3);
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::F5_press (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::F5_release (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::F6_press (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::F6_release (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::F7_press (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::F7_release (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::F8_press (Button &)
|
|
|
|
{
|
2012-04-10 22:30:35 -04:00
|
|
|
CloseDialog (); /* EMIT SIGNAL */
|
2015-10-04 14:51:05 -04:00
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::F8_release (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
2012-04-10 22:30:35 -04:00
|
|
|
|
|
|
|
/* UNIMPLEMENTED */
|
|
|
|
|
2012-04-09 13:48:16 -04:00
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::pan_press (Button &)
|
|
|
|
{
|
2016-02-01 22:52:16 -05:00
|
|
|
/* XXX eventually pan may have its own subview mode */
|
2016-05-16 16:45:37 -04:00
|
|
|
set_subview_mode (MackieControlProtocol::None, boost::shared_ptr<Stripable>());
|
2015-10-13 15:34:53 -04:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::pan_release (Button &)
|
|
|
|
{
|
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::plugin_press (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::plugin_release (Button &)
|
|
|
|
{
|
2016-01-27 19:00:21 -05:00
|
|
|
// Do not do this yet, since it does nothing
|
|
|
|
// set_view_mode (Plugins);
|
2015-10-13 15:34:53 -04:00
|
|
|
return none; /* LED state set by set_view_mode */
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::eq_press (Button &)
|
|
|
|
{
|
2016-05-16 16:45:37 -04:00
|
|
|
set_subview_mode (EQ, first_selected_stripable ());
|
2016-01-27 19:00:21 -05:00
|
|
|
return none; /* led state handled by set_subview_mode() */
|
2015-12-11 11:05:57 -05:00
|
|
|
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::eq_release (Button &)
|
|
|
|
{
|
2012-04-11 14:51:01 -04:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::dyn_press (Button &)
|
|
|
|
{
|
2016-05-16 16:45:37 -04:00
|
|
|
set_subview_mode (Dynamics, first_selected_stripable ());
|
2016-01-27 19:00:21 -05:00
|
|
|
return none; /* led state handled by set_subview_mode() */
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
2015-12-11 11:46:39 -05:00
|
|
|
|
2012-04-09 13:48:16 -04:00
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::dyn_release (Button &)
|
|
|
|
{
|
2012-04-11 14:51:01 -04:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::flip_press (Button &)
|
|
|
|
{
|
2016-02-02 12:38:55 -05:00
|
|
|
if (subview_mode() == MackieControlProtocol::Sends) {
|
|
|
|
if (_flip_mode != Normal) {
|
|
|
|
set_flip_mode (Normal);
|
|
|
|
} else {
|
|
|
|
set_flip_mode (Mirror);
|
|
|
|
}
|
|
|
|
return ((_flip_mode != Normal) ? on : off);
|
2013-08-24 11:45:31 -04:00
|
|
|
}
|
2016-02-02 18:30:28 -05:00
|
|
|
|
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
2016-02-02 18:30:28 -05:00
|
|
|
|
2012-04-09 13:48:16 -04:00
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::flip_release (Button &)
|
|
|
|
{
|
2012-04-11 14:51:01 -04:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::name_value_press (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::name_value_release (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::touch_press (Button &)
|
|
|
|
{
|
2016-01-29 16:29:52 -05:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::touch_release (Button &)
|
|
|
|
{
|
2016-01-29 16:29:52 -05:00
|
|
|
set_automation_state (ARDOUR::Touch);
|
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::cancel_press (Button &)
|
|
|
|
{
|
2016-02-03 19:11:21 -05:00
|
|
|
if (main_modifier_state() & MODIFIER_SHIFT) {
|
|
|
|
access_action ("Transport/ToggleExternalSync");
|
|
|
|
} else {
|
2016-06-12 08:43:24 -04:00
|
|
|
access_action ("Main/Escape");
|
2016-02-03 19:11:21 -05:00
|
|
|
}
|
2016-02-01 12:22:01 -05:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::cancel_release (Button &)
|
|
|
|
{
|
2016-02-01 12:22:01 -05:00
|
|
|
return none;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::user_a_press (Button &)
|
|
|
|
{
|
2012-04-11 21:51:57 -04:00
|
|
|
transport_play (session->transport_speed() == 1.0);
|
2015-10-04 14:51:05 -04:00
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::user_a_release (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::user_b_press (Button &)
|
|
|
|
{
|
2012-04-11 21:51:57 -04:00
|
|
|
transport_stop();
|
2015-10-04 14:51:05 -04:00
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
|
|
|
LedState
|
2015-10-04 14:51:05 -04:00
|
|
|
MackieControlProtocol::user_b_release (Button &)
|
|
|
|
{
|
|
|
|
return off;
|
2012-04-09 13:48:16 -04:00
|
|
|
}
|
2012-04-15 09:28:45 -04:00
|
|
|
|
2012-06-09 15:06:52 -04:00
|
|
|
LedState
|
|
|
|
MackieControlProtocol::master_fader_touch_press (Mackie::Button &)
|
|
|
|
{
|
|
|
|
DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::master_fader_touch_press\n");
|
|
|
|
|
2015-09-08 23:47:16 -04:00
|
|
|
Fader* master_fader = _master_surface->master_fader();
|
2012-06-09 15:06:52 -04:00
|
|
|
|
|
|
|
boost::shared_ptr<AutomationControl> ac = master_fader->control ();
|
|
|
|
|
|
|
|
master_fader->set_in_use (true);
|
|
|
|
master_fader->start_touch (transport_frame());
|
|
|
|
|
|
|
|
return none;
|
|
|
|
}
|
|
|
|
LedState
|
|
|
|
MackieControlProtocol::master_fader_touch_release (Mackie::Button &)
|
|
|
|
{
|
|
|
|
DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::master_fader_touch_release\n");
|
|
|
|
|
2015-09-08 23:47:16 -04:00
|
|
|
Fader* master_fader = _master_surface->master_fader();
|
2012-06-09 15:06:52 -04:00
|
|
|
|
|
|
|
master_fader->set_in_use (false);
|
|
|
|
master_fader->stop_touch (transport_frame(), true);
|
|
|
|
|
|
|
|
return none;
|
|
|
|
}
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::read_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2016-01-29 16:29:52 -05:00
|
|
|
return none;
|
2012-04-15 09:28:45 -04:00
|
|
|
}
|
2016-01-29 16:29:52 -05:00
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::read_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2016-01-29 18:37:03 -05:00
|
|
|
set_automation_state (ARDOUR::Play);
|
2016-01-29 16:29:52 -05:00
|
|
|
return none;
|
2012-04-15 09:28:45 -04:00
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::write_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::write_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2016-01-29 16:29:52 -05:00
|
|
|
set_automation_state (ARDOUR::Write);
|
2012-04-15 09:28:45 -04:00
|
|
|
return none;
|
|
|
|
}
|
2016-01-14 16:06:14 -05:00
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::clearsolo_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2016-01-14 16:06:14 -05:00
|
|
|
// clears all solos and listens (pfl/afl)
|
2016-01-31 11:36:46 -05:00
|
|
|
|
2016-02-06 15:47:27 -05:00
|
|
|
if (main_modifier_state() & MODIFIER_SHIFT) {
|
|
|
|
access_action ("Editor/set-session-from-edit-range");
|
|
|
|
return none;
|
|
|
|
}
|
2016-01-31 11:36:46 -05:00
|
|
|
|
2016-06-16 23:31:31 -04:00
|
|
|
cancel_all_solo ();
|
2012-04-15 09:28:45 -04:00
|
|
|
return none;
|
|
|
|
}
|
2016-01-14 16:06:14 -05:00
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::clearsolo_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2016-01-14 16:06:14 -05:00
|
|
|
//return session->soloing();
|
2012-04-15 09:28:45 -04:00
|
|
|
return none;
|
|
|
|
}
|
2016-01-14 16:06:14 -05:00
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::track_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2016-05-16 16:45:37 -04:00
|
|
|
set_subview_mode (TrackView, first_selected_stripable());
|
2015-10-13 15:34:53 -04:00
|
|
|
return none;
|
2012-04-15 09:28:45 -04:00
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::track_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::send_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2016-05-16 16:45:37 -04:00
|
|
|
set_subview_mode (Sends, first_selected_stripable());
|
2016-01-27 19:00:21 -05:00
|
|
|
return none; /* led state handled by set_subview_mode() */
|
2012-04-15 09:28:45 -04:00
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::send_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::miditracks_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::miditracks_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2015-10-13 15:34:53 -04:00
|
|
|
set_view_mode (MidiTracks);
|
2012-04-15 09:28:45 -04:00
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::inputs_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::inputs_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::audiotracks_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::audiotracks_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2015-10-13 15:34:53 -04:00
|
|
|
set_view_mode (AudioTracks);
|
2012-04-15 09:28:45 -04:00
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
2015-12-15 08:35:30 -05:00
|
|
|
MackieControlProtocol::audioinstruments_press (Mackie::Button& b)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2016-01-28 23:05:14 -05:00
|
|
|
return none;
|
2012-04-15 09:28:45 -04:00
|
|
|
}
|
2015-12-15 08:35:30 -05:00
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
2015-12-15 08:35:30 -05:00
|
|
|
MackieControlProtocol::audioinstruments_release (Mackie::Button& b)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2016-01-28 23:05:14 -05:00
|
|
|
return none;
|
2015-12-15 08:35:30 -05:00
|
|
|
|
2012-04-15 09:28:45 -04:00
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::aux_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::aux_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2015-10-13 15:34:53 -04:00
|
|
|
set_view_mode (Auxes);
|
2012-04-15 09:28:45 -04:00
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::busses_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::busses_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2015-10-13 15:34:53 -04:00
|
|
|
set_view_mode (Busses);
|
2012-04-15 09:28:45 -04:00
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::outputs_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::outputs_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2016-01-16 10:32:30 -05:00
|
|
|
set_view_mode (Hidden);
|
2012-04-15 09:28:45 -04:00
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::user_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::user_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2015-10-20 21:54:56 -04:00
|
|
|
set_view_mode (Selected);
|
2012-04-15 09:28:45 -04:00
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::trim_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::trim_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::latch_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::latch_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::grp_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::grp_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2016-01-29 18:37:03 -05:00
|
|
|
/* There is no "Off" button for automation,
|
|
|
|
so we use Group for this purpose.
|
|
|
|
*/
|
|
|
|
set_automation_state (Off);
|
|
|
|
return none;
|
2012-04-15 09:28:45 -04:00
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::nudge_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2016-01-31 11:17:23 -05:00
|
|
|
_modifier_state |= MODIFIER_NUDGE;
|
|
|
|
nudge_modifier_consumed_by_button = false;
|
|
|
|
return on;
|
2012-04-15 09:28:45 -04:00
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::nudge_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2016-01-31 11:17:23 -05:00
|
|
|
_modifier_state &= ~MODIFIER_NUDGE;
|
|
|
|
|
|
|
|
/* XXX these action names are stupid, because the action can affect
|
2016-04-08 16:49:47 -04:00
|
|
|
* regions, markers or the playhead depending on selection state.
|
2016-01-31 11:17:23 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
if (main_modifier_state() & MODIFIER_SHIFT) {
|
2016-02-01 12:20:55 -05:00
|
|
|
access_action ("Region/nudge-backward");
|
2016-01-31 11:17:23 -05:00
|
|
|
} else {
|
2016-02-01 12:20:55 -05:00
|
|
|
access_action ("Region/nudge-forward");
|
2016-01-31 11:17:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
return off;
|
2012-04-15 09:28:45 -04:00
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::replace_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2016-02-03 19:11:21 -05:00
|
|
|
if (main_modifier_state() == MODIFIER_SHIFT) {
|
|
|
|
toggle_punch_out();
|
2016-02-04 12:44:23 -05:00
|
|
|
return none;
|
2016-02-03 19:11:21 -05:00
|
|
|
} else {
|
|
|
|
access_action ("Editor/finish-range-from-playhead");
|
|
|
|
}
|
2016-02-04 12:44:23 -05:00
|
|
|
return none;
|
2012-04-15 09:28:45 -04:00
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::replace_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::click_press (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
2016-02-03 19:11:21 -05:00
|
|
|
if (main_modifier_state() & MODIFIER_SHIFT) {
|
|
|
|
access_action ("Editor/set-punch-from-edit-range");
|
|
|
|
return off;
|
|
|
|
} else {
|
|
|
|
bool state = !Config->get_clicking();
|
|
|
|
Config->set_clicking (state);
|
|
|
|
return state;
|
|
|
|
}
|
2012-04-15 09:28:45 -04:00
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::click_release (Mackie::Button&)
|
2012-04-15 09:28:45 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::view_press (Mackie::Button&)
|
2012-04-15 09:41:20 -04:00
|
|
|
{
|
2015-10-17 19:23:46 -04:00
|
|
|
set_view_mode (Mixer);
|
2012-04-15 09:41:20 -04:00
|
|
|
return none;
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
Mackie::LedState
|
|
|
|
MackieControlProtocol::view_release (Mackie::Button&)
|
2012-04-15 09:41:20 -04:00
|
|
|
{
|
|
|
|
return none;
|
|
|
|
}
|