mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
MCP: maybe handle multiple MCUs better; add support for modifier keys; rearrange source so that all button handlesr are in mcp_buttons.cc
git-svn-id: svn://localhost/ardour2/branches/3.0@11855 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
086a6c56f3
commit
db5258fea3
11 changed files with 862 additions and 354 deletions
34
libs/surfaces/mackie/button.cc
Normal file
34
libs/surfaces/mackie/button.cc
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
/*
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "button.h"
|
||||||
|
#include "surface.h"
|
||||||
|
#include "control_group.h"
|
||||||
|
|
||||||
|
using namespace Mackie;
|
||||||
|
|
||||||
|
Control*
|
||||||
|
Button::factory (Surface& surface, int id, int ordinal, const char* name, Group& group)
|
||||||
|
{
|
||||||
|
Button* b = new Button (id, ordinal, name, group);
|
||||||
|
surface.buttons[id] = b;
|
||||||
|
surface.controls.push_back (b);
|
||||||
|
group.add (*b);
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
@ -90,26 +90,6 @@ ostream & Mackie::operator << (ostream & os, const Mackie::Control & control)
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
Control*
|
|
||||||
Button::factory (Surface& surface, int id, int ordinal, const char* name, Group& group)
|
|
||||||
{
|
|
||||||
Button* b = new Button (id, ordinal, name, group);
|
|
||||||
surface.buttons[id] = b;
|
|
||||||
surface.controls.push_back (b);
|
|
||||||
group.add (*b);
|
|
||||||
return b;
|
|
||||||
}
|
|
||||||
|
|
||||||
Control*
|
|
||||||
Fader::factory (Surface& surface, int id, int ordinal, const char* name, Group& group)
|
|
||||||
{
|
|
||||||
Fader* f = new Fader (id, ordinal, name, group);
|
|
||||||
surface.faders[id] = f;
|
|
||||||
surface.controls.push_back (f);
|
|
||||||
group.add (*f);
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
|
|
||||||
Control*
|
Control*
|
||||||
Pot::factory (Surface& surface, int id, int ordinal, const char* name, Group& group)
|
Pot::factory (Surface& surface, int id, int ordinal, const char* name, Group& group)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
38
libs/surfaces/mackie/fader.cc
Normal file
38
libs/surfaces/mackie/fader.cc
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "fader.h"
|
||||||
|
#include "surface.h"
|
||||||
|
#include "control_group.h"
|
||||||
|
|
||||||
|
using namespace Mackie;
|
||||||
|
|
||||||
|
Control*
|
||||||
|
Fader::factory (Surface& surface, int id, int ordinal, const char* name, Group& group)
|
||||||
|
{
|
||||||
|
Fader* f = new Fader (id, ordinal, name, group);
|
||||||
|
|
||||||
|
std::cerr << "Registering fader " << id << " ord " << ordinal << std::endl;
|
||||||
|
|
||||||
|
surface.faders[id] = f;
|
||||||
|
surface.controls.push_back (f);
|
||||||
|
group.add (*f);
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -90,6 +90,11 @@ MackieMidiBuilder builder;
|
||||||
extern PBD::EventLoop::InvalidationRecord* __invalidator (sigc::trackable& trackable, const char*, int);
|
extern PBD::EventLoop::InvalidationRecord* __invalidator (sigc::trackable& trackable, const char*, int);
|
||||||
#define invalidator(x) __invalidator ((x), __FILE__, __LINE__)
|
#define invalidator(x) __invalidator ((x), __FILE__, __LINE__)
|
||||||
|
|
||||||
|
const int MackieControlProtocol::MODIFIER_OPTION = 0x1;
|
||||||
|
const int MackieControlProtocol::MODIFIER_CONTROL = 0x2;
|
||||||
|
const int MackieControlProtocol::MODIFIER_SHIFT = 0x3;
|
||||||
|
const int MackieControlProtocol::MODIFIER_CMDALT = 0x4;
|
||||||
|
|
||||||
MackieControlProtocol::MackieControlProtocol (Session& session)
|
MackieControlProtocol::MackieControlProtocol (Session& session)
|
||||||
: ControlProtocol (session, X_("Mackie"), MidiControlUI::instance())
|
: ControlProtocol (session, X_("Mackie"), MidiControlUI::instance())
|
||||||
, AbstractUI<MackieControlUIRequest> ("mackie")
|
, AbstractUI<MackieControlUIRequest> ("mackie")
|
||||||
|
|
@ -486,7 +491,7 @@ MackieControlProtocol::handle_strip_button (SurfacePort & port, Control & contro
|
||||||
} else if (control.name() == "select") {
|
} else if (control.name() == "select") {
|
||||||
Strip* strip = const_cast<Strip*>(dynamic_cast<const Strip*>(&control.group()));
|
Strip* strip = const_cast<Strip*>(dynamic_cast<const Strip*>(&control.group()));
|
||||||
if (strip) {
|
if (strip) {
|
||||||
if (strip->index() < route_table.size()) {
|
if ((uint32_t) strip->index() < route_table.size()) {
|
||||||
boost::shared_ptr<Route> r = route_table[strip->index()];
|
boost::shared_ptr<Route> r = route_table[strip->index()];
|
||||||
if (r->remote_control_id() == _current_selected_track) {
|
if (r->remote_control_id() == _current_selected_track) {
|
||||||
UnselectTrack (); /* EMIT SIGNAL */
|
UnselectTrack (); /* EMIT SIGNAL */
|
||||||
|
|
@ -1165,249 +1170,6 @@ MackieControlProtocol::update_timecode_display()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////
|
|
||||||
// Transport Buttons
|
|
||||||
/////////////////////////////////////
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::frm_left_press (Button &)
|
|
||||||
{
|
|
||||||
// can use first_mark_before/after as well
|
|
||||||
unsigned long elapsed = _frm_left_last.restart();
|
|
||||||
|
|
||||||
Location * loc = session->locations()->first_location_before (
|
|
||||||
session->transport_frame()
|
|
||||||
);
|
|
||||||
|
|
||||||
// allow a quick double to go past a previous mark
|
|
||||||
if (session->transport_rolling() && elapsed < 500 && loc != 0) {
|
|
||||||
Location * loc_two_back = session->locations()->first_location_before (loc->start());
|
|
||||||
if (loc_two_back != 0)
|
|
||||||
{
|
|
||||||
loc = loc_two_back;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// move to the location, if it's valid
|
|
||||||
if (loc != 0) {
|
|
||||||
session->request_locate (loc->start(), session->transport_rolling());
|
|
||||||
}
|
|
||||||
|
|
||||||
return on;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::frm_left_release (Button &)
|
|
||||||
{
|
|
||||||
return off;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::frm_right_press (Button &)
|
|
||||||
{
|
|
||||||
// can use first_mark_before/after as well
|
|
||||||
Location * loc = session->locations()->first_location_after (session->transport_frame());
|
|
||||||
|
|
||||||
if (loc != 0) {
|
|
||||||
session->request_locate (loc->start(), session->transport_rolling());
|
|
||||||
}
|
|
||||||
|
|
||||||
return on;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::frm_right_release (Button &)
|
|
||||||
{
|
|
||||||
return off;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::stop_press (Button &)
|
|
||||||
{
|
|
||||||
session->request_stop();
|
|
||||||
return on;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::stop_release (Button &)
|
|
||||||
{
|
|
||||||
return session->transport_stopped();
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::play_press (Button &)
|
|
||||||
{
|
|
||||||
session->request_transport_speed (1.0);
|
|
||||||
return on;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::play_release (Button &)
|
|
||||||
{
|
|
||||||
return session->transport_rolling();
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::record_press (Button &)
|
|
||||||
{
|
|
||||||
if (session->get_record_enabled()) {
|
|
||||||
session->disable_record (false);
|
|
||||||
} else {
|
|
||||||
session->maybe_enable_record();
|
|
||||||
}
|
|
||||||
return on;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::record_release (Button &)
|
|
||||||
{
|
|
||||||
if (session->get_record_enabled()) {
|
|
||||||
if (session->transport_rolling()) {
|
|
||||||
return on;
|
|
||||||
} else {
|
|
||||||
return flashing;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return off;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::rewind_press (Button &)
|
|
||||||
{
|
|
||||||
_jog_wheel.push (JogWheel::speed);
|
|
||||||
_jog_wheel.transport_direction (-1);
|
|
||||||
session->request_transport_speed (-_jog_wheel.transport_speed());
|
|
||||||
return on;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::rewind_release (Button &)
|
|
||||||
{
|
|
||||||
_jog_wheel.pop();
|
|
||||||
_jog_wheel.transport_direction (0);
|
|
||||||
if (_transport_previously_rolling) {
|
|
||||||
session->request_transport_speed (1.0);
|
|
||||||
} else {
|
|
||||||
session->request_stop();
|
|
||||||
}
|
|
||||||
return off;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::ffwd_press (Button &)
|
|
||||||
{
|
|
||||||
_jog_wheel.push (JogWheel::speed);
|
|
||||||
_jog_wheel.transport_direction (1);
|
|
||||||
session->request_transport_speed (_jog_wheel.transport_speed());
|
|
||||||
return on;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::ffwd_release (Button &)
|
|
||||||
{
|
|
||||||
_jog_wheel.pop();
|
|
||||||
_jog_wheel.transport_direction (0);
|
|
||||||
if (_transport_previously_rolling) {
|
|
||||||
session->request_transport_speed (1.0);
|
|
||||||
} else {
|
|
||||||
session->request_stop();
|
|
||||||
}
|
|
||||||
return off;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::loop_press (Button &)
|
|
||||||
{
|
|
||||||
session->request_play_loop (!session->get_play_loop());
|
|
||||||
return on;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::loop_release (Button &)
|
|
||||||
{
|
|
||||||
return session->get_play_loop();
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::punch_in_press (Button &)
|
|
||||||
{
|
|
||||||
bool const state = !session->config.get_punch_in();
|
|
||||||
session->config.set_punch_in (state);
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::punch_in_release (Button &)
|
|
||||||
{
|
|
||||||
return session->config.get_punch_in();
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::punch_out_press (Button &)
|
|
||||||
{
|
|
||||||
bool const state = !session->config.get_punch_out();
|
|
||||||
session->config.set_punch_out (state);
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::punch_out_release (Button &)
|
|
||||||
{
|
|
||||||
return session->config.get_punch_out();
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::home_press (Button &)
|
|
||||||
{
|
|
||||||
session->goto_start();
|
|
||||||
return on;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::home_release (Button &)
|
|
||||||
{
|
|
||||||
return off;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::end_press (Button &)
|
|
||||||
{
|
|
||||||
session->goto_end();
|
|
||||||
return on;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::end_release (Button &)
|
|
||||||
{
|
|
||||||
return off;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::clicking_press (Button &)
|
|
||||||
{
|
|
||||||
bool state = !Config->get_clicking();
|
|
||||||
Config->set_clicking (state);
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState
|
|
||||||
MackieControlProtocol::clicking_release (Button &)
|
|
||||||
{
|
|
||||||
return Config->get_clicking();
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState MackieControlProtocol::global_solo_press (Button &)
|
|
||||||
{
|
|
||||||
bool state = !session->soloing();
|
|
||||||
session->set_solo (session->get_routes(), state);
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
LedState MackieControlProtocol::global_solo_release (Button &)
|
|
||||||
{
|
|
||||||
return session->soloing();
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////
|
///////////////////////////////////////////
|
||||||
// Session signals
|
// Session signals
|
||||||
|
|
@ -1556,7 +1318,7 @@ MackieControlProtocol::cursor_left_press (Button& )
|
||||||
{
|
{
|
||||||
if (_zoom_mode) {
|
if (_zoom_mode) {
|
||||||
|
|
||||||
if (false) { // button_down (BUTTON_OPTION)) {
|
if (_modifier_state & MODIFIER_OPTION) {
|
||||||
/* reset selected tracks to default vertical zoom */
|
/* reset selected tracks to default vertical zoom */
|
||||||
} else {
|
} else {
|
||||||
ZoomOut (); /* EMIT SIGNAL */
|
ZoomOut (); /* EMIT SIGNAL */
|
||||||
|
|
@ -1576,8 +1338,8 @@ LedState
|
||||||
MackieControlProtocol::cursor_right_press (Button& )
|
MackieControlProtocol::cursor_right_press (Button& )
|
||||||
{
|
{
|
||||||
if (_zoom_mode) {
|
if (_zoom_mode) {
|
||||||
|
|
||||||
if (false) { // button_down (BUTTON_OPTION)) {
|
if (_modifier_state & MODIFIER_OPTION) {
|
||||||
/* reset selected tracks to default vertical zoom */
|
/* reset selected tracks to default vertical zoom */
|
||||||
} else {
|
} else {
|
||||||
ZoomIn (); /* EMIT SIGNAL */
|
ZoomIn (); /* EMIT SIGNAL */
|
||||||
|
|
|
||||||
|
|
@ -200,87 +200,85 @@ class MackieControlProtocol
|
||||||
Mackie::LedState undo_release (Mackie::Button &);
|
Mackie::LedState undo_release (Mackie::Button &);
|
||||||
Mackie::LedState redo_press (Mackie::Button &);
|
Mackie::LedState redo_press (Mackie::Button &);
|
||||||
Mackie::LedState redo_release (Mackie::Button &);
|
Mackie::LedState redo_release (Mackie::Button &);
|
||||||
|
Mackie::LedState shift_press (Mackie::Button &);
|
||||||
|
Mackie::LedState shift_release (Mackie::Button &);
|
||||||
|
Mackie::LedState option_press (Mackie::Button &);
|
||||||
|
Mackie::LedState option_release (Mackie::Button &);
|
||||||
|
Mackie::LedState control_press (Mackie::Button &);
|
||||||
|
Mackie::LedState control_release (Mackie::Button &);
|
||||||
|
Mackie::LedState cmd_alt_press (Mackie::Button &);
|
||||||
|
Mackie::LedState cmd_alt_release (Mackie::Button &);
|
||||||
|
|
||||||
/* unimplemented button handlers */
|
Mackie::LedState io_press (Mackie::Button &);
|
||||||
|
Mackie::LedState io_release (Mackie::Button &);
|
||||||
Mackie::LedState io_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState sends_press (Mackie::Button &);
|
||||||
Mackie::LedState io_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState sends_release (Mackie::Button &);
|
||||||
Mackie::LedState sends_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState pan_press (Mackie::Button &);
|
||||||
Mackie::LedState sends_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState pan_release (Mackie::Button &);
|
||||||
Mackie::LedState pan_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState plugin_press (Mackie::Button &);
|
||||||
Mackie::LedState pan_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState plugin_release (Mackie::Button &);
|
||||||
Mackie::LedState plugin_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState eq_press (Mackie::Button &);
|
||||||
Mackie::LedState plugin_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState eq_release (Mackie::Button &);
|
||||||
Mackie::LedState eq_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState dyn_press (Mackie::Button &);
|
||||||
Mackie::LedState eq_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState dyn_release (Mackie::Button &);
|
||||||
Mackie::LedState dyn_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState flip_press (Mackie::Button &);
|
||||||
Mackie::LedState dyn_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState flip_release (Mackie::Button &);
|
||||||
Mackie::LedState flip_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState edit_press (Mackie::Button &);
|
||||||
Mackie::LedState flip_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState edit_release (Mackie::Button &);
|
||||||
Mackie::LedState edit_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState name_value_press (Mackie::Button &);
|
||||||
Mackie::LedState edit_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState name_value_release (Mackie::Button &);
|
||||||
Mackie::LedState name_value_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F1_press (Mackie::Button &);
|
||||||
Mackie::LedState name_value_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F1_release (Mackie::Button &);
|
||||||
Mackie::LedState F1_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F2_press (Mackie::Button &);
|
||||||
Mackie::LedState F1_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F2_release (Mackie::Button &);
|
||||||
Mackie::LedState F2_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F3_press (Mackie::Button &);
|
||||||
Mackie::LedState F2_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F3_release (Mackie::Button &);
|
||||||
Mackie::LedState F3_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F4_press (Mackie::Button &);
|
||||||
Mackie::LedState F3_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F4_release (Mackie::Button &);
|
||||||
Mackie::LedState F4_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F5_press (Mackie::Button &);
|
||||||
Mackie::LedState F4_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F5_release (Mackie::Button &);
|
||||||
Mackie::LedState F5_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F6_press (Mackie::Button &);
|
||||||
Mackie::LedState F5_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F6_release (Mackie::Button &);
|
||||||
Mackie::LedState F6_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F7_press (Mackie::Button &);
|
||||||
Mackie::LedState F6_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F7_release (Mackie::Button &);
|
||||||
Mackie::LedState F7_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F8_press (Mackie::Button &);
|
||||||
Mackie::LedState F7_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F8_release (Mackie::Button &);
|
||||||
Mackie::LedState F8_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F9_press (Mackie::Button &);
|
||||||
Mackie::LedState F8_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F9_release (Mackie::Button &);
|
||||||
Mackie::LedState F9_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F10_press (Mackie::Button &);
|
||||||
Mackie::LedState F9_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F10_release (Mackie::Button &);
|
||||||
Mackie::LedState F10_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F11_press (Mackie::Button &);
|
||||||
Mackie::LedState F10_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F11_release (Mackie::Button &);
|
||||||
Mackie::LedState F11_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F12_press (Mackie::Button &);
|
||||||
Mackie::LedState F11_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F12_release (Mackie::Button &);
|
||||||
Mackie::LedState F12_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F13_press (Mackie::Button &);
|
||||||
Mackie::LedState F12_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F13_release (Mackie::Button &);
|
||||||
Mackie::LedState F13_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F14_press (Mackie::Button &);
|
||||||
Mackie::LedState F13_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F14_release (Mackie::Button &);
|
||||||
Mackie::LedState F14_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F15_press (Mackie::Button &);
|
||||||
Mackie::LedState F14_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F15_release (Mackie::Button &);
|
||||||
Mackie::LedState F15_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F16_press (Mackie::Button &);
|
||||||
Mackie::LedState F15_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState F16_release (Mackie::Button &);
|
||||||
Mackie::LedState F16_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState on_press (Mackie::Button &);
|
||||||
Mackie::LedState F16_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState on_release (Mackie::Button &);
|
||||||
Mackie::LedState shift_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState rec_ready_press (Mackie::Button &);
|
||||||
Mackie::LedState shift_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState rec_ready_release (Mackie::Button &);
|
||||||
Mackie::LedState option_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState snapshot_press (Mackie::Button &);
|
||||||
Mackie::LedState option_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState snapshot_release (Mackie::Button &);
|
||||||
Mackie::LedState control_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState touch_press (Mackie::Button &);
|
||||||
Mackie::LedState control_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState touch_release (Mackie::Button &);
|
||||||
Mackie::LedState cmd_alt_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState enter_press (Mackie::Button &);
|
||||||
Mackie::LedState cmd_alt_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState enter_release (Mackie::Button &);
|
||||||
Mackie::LedState on_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState cancel_press (Mackie::Button &);
|
||||||
Mackie::LedState on_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState cancel_release (Mackie::Button &);
|
||||||
Mackie::LedState rec_ready_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState mixer_press (Mackie::Button &);
|
||||||
Mackie::LedState rec_ready_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState mixer_release (Mackie::Button &);
|
||||||
Mackie::LedState snapshot_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState user_a_press (Mackie::Button &);
|
||||||
Mackie::LedState snapshot_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState user_a_release (Mackie::Button &);
|
||||||
Mackie::LedState touch_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState user_b_press (Mackie::Button &);
|
||||||
Mackie::LedState touch_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState user_b_release (Mackie::Button &);
|
||||||
Mackie::LedState enter_press (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState fader_touch_press (Mackie::Button &);
|
||||||
Mackie::LedState enter_release (Mackie::Button &) { return Mackie::off; }
|
Mackie::LedState fader_touch_release (Mackie::Button &);
|
||||||
Mackie::LedState cancel_press (Mackie::Button &) { return Mackie::off; }
|
|
||||||
Mackie::LedState cancel_release (Mackie::Button &) { return Mackie::off; }
|
|
||||||
Mackie::LedState mixer_press (Mackie::Button &) { return Mackie::off; }
|
|
||||||
Mackie::LedState mixer_release (Mackie::Button &) { return Mackie::off; }
|
|
||||||
Mackie::LedState user_a_press (Mackie::Button &) { return Mackie::off; }
|
|
||||||
Mackie::LedState user_a_release (Mackie::Button &) { return Mackie::off; }
|
|
||||||
Mackie::LedState user_b_press (Mackie::Button &) { return Mackie::off; }
|
|
||||||
Mackie::LedState user_b_release (Mackie::Button &) { return Mackie::off; }
|
|
||||||
Mackie::LedState fader_touch_press (Mackie::Button &) { return Mackie::off; }
|
|
||||||
Mackie::LedState fader_touch_release (Mackie::Button &) { return Mackie::off; }
|
|
||||||
|
|
||||||
|
|
||||||
/// This is the main MCU port, ie not an extender port
|
/// This is the main MCU port, ie not an extender port
|
||||||
|
|
@ -431,6 +429,13 @@ class MackieControlProtocol
|
||||||
|
|
||||||
bool _zoom_mode;
|
bool _zoom_mode;
|
||||||
int _current_selected_track;
|
int _current_selected_track;
|
||||||
|
|
||||||
|
static const int MODIFIER_OPTION;
|
||||||
|
static const int MODIFIER_CONTROL;
|
||||||
|
static const int MODIFIER_SHIFT;
|
||||||
|
static const int MODIFIER_CMDALT;
|
||||||
|
|
||||||
|
int _modifier_state;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ardour_mackie_control_protocol_h
|
#endif // ardour_mackie_control_protocol_h
|
||||||
|
|
|
||||||
|
|
@ -190,15 +190,18 @@ void MackiePort::probe_emulation (const MidiByteArray &)
|
||||||
cout << "MackiePort::probe_emulation: " << bytes.size() << ", " << bytes << endl;
|
cout << "MackiePort::probe_emulation: " << bytes.size() << ", " << bytes << endl;
|
||||||
|
|
||||||
MidiByteArray version_string;
|
MidiByteArray version_string;
|
||||||
for (int i = 6; i < 11; ++i) version_string << bytes[i];
|
|
||||||
|
for (int i = 6; i < 11; ++i) {
|
||||||
|
version_string << bytes[i];
|
||||||
|
}
|
||||||
|
|
||||||
cout << "version_string: " << version_string << endl;
|
cout << "version_string: " << version_string << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO investigate using serial number. Also, possibly size of bytes might
|
// TODO investigate using serial number. Also, possibly size of bytes might
|
||||||
// give an indication. Also, apparently MCU sends non-documented messages
|
// give an indication. Also, apparently MCU sends non-documented messages
|
||||||
// sometimes.
|
// sometimes.
|
||||||
if (!_initialising)
|
if (!_initialising) {
|
||||||
{
|
|
||||||
//cout << "MackiePort::probe_emulation out of sequence." << endl;
|
//cout << "MackiePort::probe_emulation out of sequence." << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
681
libs/surfaces/mackie/mcp_buttons.cc
Normal file
681
libs/surfaces/mackie/mcp_buttons.cc
Normal file
|
|
@ -0,0 +1,681 @@
|
||||||
|
/*
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ardour/session.h"
|
||||||
|
#include "ardour/route.h"
|
||||||
|
#include "ardour/location.h"
|
||||||
|
#include "ardour/rc_configuration.h"
|
||||||
|
|
||||||
|
#include "mackie_control_protocol.h"
|
||||||
|
|
||||||
|
/* handlers for all buttons, broken into a separate file to avoid clutter in
|
||||||
|
* mackie_control_protocol.cc
|
||||||
|
*/
|
||||||
|
|
||||||
|
using namespace Mackie;
|
||||||
|
using namespace ARDOUR;
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::shift_press (Button &)
|
||||||
|
{
|
||||||
|
_modifier_state |= MODIFIER_SHIFT;
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::shift_release (Button &)
|
||||||
|
{
|
||||||
|
_modifier_state &= ~MODIFIER_SHIFT;
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::option_press (Button &)
|
||||||
|
{
|
||||||
|
_modifier_state |= MODIFIER_OPTION;
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::option_release (Button &)
|
||||||
|
{
|
||||||
|
_modifier_state &= ~MODIFIER_OPTION;
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::control_press (Button &)
|
||||||
|
{
|
||||||
|
_modifier_state |= MODIFIER_CONTROL;
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::control_release (Button &)
|
||||||
|
{
|
||||||
|
_modifier_state &= ~MODIFIER_CONTROL;
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::cmd_alt_press (Button &)
|
||||||
|
{
|
||||||
|
_modifier_state |= MODIFIER_CMDALT;
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::cmd_alt_release (Button &)
|
||||||
|
{
|
||||||
|
_modifier_state &= ~MODIFIER_CMDALT;
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////
|
||||||
|
// Transport Buttons
|
||||||
|
/////////////////////////////////////
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::frm_left_press (Button &)
|
||||||
|
{
|
||||||
|
// can use first_mark_before/after as well
|
||||||
|
unsigned long elapsed = _frm_left_last.restart();
|
||||||
|
|
||||||
|
Location * loc = session->locations()->first_location_before (
|
||||||
|
session->transport_frame()
|
||||||
|
);
|
||||||
|
|
||||||
|
// allow a quick double to go past a previous mark
|
||||||
|
if (session->transport_rolling() && elapsed < 500 && loc != 0) {
|
||||||
|
Location * loc_two_back = session->locations()->first_location_before (loc->start());
|
||||||
|
if (loc_two_back != 0)
|
||||||
|
{
|
||||||
|
loc = loc_two_back;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// move to the location, if it's valid
|
||||||
|
if (loc != 0) {
|
||||||
|
session->request_locate (loc->start(), session->transport_rolling());
|
||||||
|
}
|
||||||
|
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::frm_left_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::frm_right_press (Button &)
|
||||||
|
{
|
||||||
|
// can use first_mark_before/after as well
|
||||||
|
Location * loc = session->locations()->first_location_after (session->transport_frame());
|
||||||
|
|
||||||
|
if (loc != 0) {
|
||||||
|
session->request_locate (loc->start(), session->transport_rolling());
|
||||||
|
}
|
||||||
|
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::frm_right_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::stop_press (Button &)
|
||||||
|
{
|
||||||
|
session->request_stop();
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::stop_release (Button &)
|
||||||
|
{
|
||||||
|
return session->transport_stopped();
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::play_press (Button &)
|
||||||
|
{
|
||||||
|
session->request_transport_speed (1.0);
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::play_release (Button &)
|
||||||
|
{
|
||||||
|
return session->transport_rolling();
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::record_press (Button &)
|
||||||
|
{
|
||||||
|
if (session->get_record_enabled()) {
|
||||||
|
session->disable_record (false);
|
||||||
|
} else {
|
||||||
|
session->maybe_enable_record();
|
||||||
|
}
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::record_release (Button &)
|
||||||
|
{
|
||||||
|
if (session->get_record_enabled()) {
|
||||||
|
if (session->transport_rolling()) {
|
||||||
|
return on;
|
||||||
|
} else {
|
||||||
|
return flashing;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::rewind_press (Button &)
|
||||||
|
{
|
||||||
|
_jog_wheel.push (JogWheel::speed);
|
||||||
|
_jog_wheel.transport_direction (-1);
|
||||||
|
session->request_transport_speed (-_jog_wheel.transport_speed());
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::rewind_release (Button &)
|
||||||
|
{
|
||||||
|
_jog_wheel.pop();
|
||||||
|
_jog_wheel.transport_direction (0);
|
||||||
|
if (_transport_previously_rolling) {
|
||||||
|
session->request_transport_speed (1.0);
|
||||||
|
} else {
|
||||||
|
session->request_stop();
|
||||||
|
}
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::ffwd_press (Button &)
|
||||||
|
{
|
||||||
|
_jog_wheel.push (JogWheel::speed);
|
||||||
|
_jog_wheel.transport_direction (1);
|
||||||
|
session->request_transport_speed (_jog_wheel.transport_speed());
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::ffwd_release (Button &)
|
||||||
|
{
|
||||||
|
_jog_wheel.pop();
|
||||||
|
_jog_wheel.transport_direction (0);
|
||||||
|
if (_transport_previously_rolling) {
|
||||||
|
session->request_transport_speed (1.0);
|
||||||
|
} else {
|
||||||
|
session->request_stop();
|
||||||
|
}
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::loop_press (Button &)
|
||||||
|
{
|
||||||
|
session->request_play_loop (!session->get_play_loop());
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::loop_release (Button &)
|
||||||
|
{
|
||||||
|
return session->get_play_loop();
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::punch_in_press (Button &)
|
||||||
|
{
|
||||||
|
bool const state = !session->config.get_punch_in();
|
||||||
|
session->config.set_punch_in (state);
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::punch_in_release (Button &)
|
||||||
|
{
|
||||||
|
return session->config.get_punch_in();
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::punch_out_press (Button &)
|
||||||
|
{
|
||||||
|
bool const state = !session->config.get_punch_out();
|
||||||
|
session->config.set_punch_out (state);
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::punch_out_release (Button &)
|
||||||
|
{
|
||||||
|
return session->config.get_punch_out();
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::home_press (Button &)
|
||||||
|
{
|
||||||
|
session->goto_start();
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::home_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::end_press (Button &)
|
||||||
|
{
|
||||||
|
session->goto_end();
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::end_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::clicking_press (Button &)
|
||||||
|
{
|
||||||
|
bool state = !Config->get_clicking();
|
||||||
|
Config->set_clicking (state);
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::clicking_release (Button &)
|
||||||
|
{
|
||||||
|
return Config->get_clicking();
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState MackieControlProtocol::global_solo_press (Button &)
|
||||||
|
{
|
||||||
|
bool state = !session->soloing();
|
||||||
|
session->set_solo (session->get_routes(), state);
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState MackieControlProtocol::global_solo_release (Button &)
|
||||||
|
{
|
||||||
|
return session->soloing();
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::enter_press (Button &)
|
||||||
|
{
|
||||||
|
Enter(); /* EMIT SIGNAL */
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::enter_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* UNIMPLEMENTED */
|
||||||
|
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::io_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::io_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::sends_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::sends_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::pan_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::pan_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::plugin_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::plugin_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::eq_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::eq_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::dyn_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::dyn_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::flip_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::flip_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::edit_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::edit_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::name_value_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::name_value_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F1_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F1_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F2_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F2_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F3_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F3_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F4_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F4_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F5_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F5_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F6_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F6_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F7_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F7_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F8_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F8_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F9_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F9_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F10_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F10_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F11_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F11_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F12_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F12_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F13_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F13_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F14_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F14_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F15_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F15_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F16_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::F16_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::on_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::on_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::rec_ready_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::rec_ready_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::snapshot_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::snapshot_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::touch_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::touch_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::cancel_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::cancel_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::mixer_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::mixer_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::user_a_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::user_a_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::user_b_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::user_b_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::fader_touch_press (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
LedState
|
||||||
|
MackieControlProtocol::fader_touch_release (Button &)
|
||||||
|
{
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
|
@ -47,7 +47,7 @@ Strip::Strip (const std::string& name, int index)
|
||||||
/* master strip only */
|
/* master strip only */
|
||||||
}
|
}
|
||||||
|
|
||||||
Strip::Strip (Surface& surface, const std::string& name, int index, int unit_index, StripControlDefinition* ctls)
|
Strip::Strip (Surface& surface, const std::string& name, int surface_number, int index, int unit_index, StripControlDefinition* ctls)
|
||||||
: Group (name)
|
: Group (name)
|
||||||
, _solo (0)
|
, _solo (0)
|
||||||
, _recenable (0)
|
, _recenable (0)
|
||||||
|
|
@ -64,7 +64,7 @@ Strip::Strip (Surface& surface, const std::string& name, int index, int unit_ind
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (uint32_t i = 0; ctls[i].name[0]; ++i) {
|
for (uint32_t i = 0; ctls[i].name[0]; ++i) {
|
||||||
ctls[i].factory (surface, ctls[i].base_id + unit_index, unit_index+1, ctls[i].name, *this);
|
ctls[i].factory (surface, ctls[i].base_id + (8*surface_number) + unit_index, unit_index+1, ctls[i].name, *this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class Strip : public Group
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Strip (const std::string& name, int index); /* master strip only */
|
Strip (const std::string& name, int index); /* master strip only */
|
||||||
Strip (Surface&, const std::string & name, int index, int unit_index, StripControlDefinition* ctls);
|
Strip (Surface&, const std::string & name, int surface_number, int index, int unit_index, StripControlDefinition* ctls);
|
||||||
|
|
||||||
virtual bool is_strip() const { return true; }
|
virtual bool is_strip() const { return true; }
|
||||||
virtual void add (Control & control);
|
virtual void add (Control & control);
|
||||||
|
|
|
||||||
|
|
@ -179,8 +179,10 @@ Surface::init_strips ()
|
||||||
uint32_t unit_index = i % _unit_strips;
|
uint32_t unit_index = i % _unit_strips;
|
||||||
|
|
||||||
snprintf (name, sizeof (name), "strip_%d", unit_index+1);
|
snprintf (name, sizeof (name), "strip_%d", unit_index+1);
|
||||||
|
|
||||||
|
cerr << "Register strip " << i << " unit index " << unit_index << endl;
|
||||||
|
|
||||||
Strip* strip = new Strip (*this, name, i, unit_index, mackie_strip_controls);
|
Strip* strip = new Strip (*this, name, i/8, i, unit_index, mackie_strip_controls);
|
||||||
|
|
||||||
groups[name] = strip;
|
groups[name] = strip;
|
||||||
strips[i] = strip;
|
strips[i] = strip;
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,10 @@ def build(bld):
|
||||||
obj = bld(features = 'cxx cxxshlib')
|
obj = bld(features = 'cxx cxxshlib')
|
||||||
obj.source = '''
|
obj.source = '''
|
||||||
bcf_surface.cc
|
bcf_surface.cc
|
||||||
|
button.cc
|
||||||
controls.cc
|
controls.cc
|
||||||
dummy_port.cc
|
dummy_port.cc
|
||||||
|
fader.cc
|
||||||
gui.cc
|
gui.cc
|
||||||
interface.cc
|
interface.cc
|
||||||
mackie_control_protocol.cc
|
mackie_control_protocol.cc
|
||||||
|
|
@ -32,6 +34,7 @@ def build(bld):
|
||||||
mackie_midi_builder.cc
|
mackie_midi_builder.cc
|
||||||
mackie_port.cc
|
mackie_port.cc
|
||||||
mackie_surface.cc
|
mackie_surface.cc
|
||||||
|
mcp_buttons.cc
|
||||||
meter.cc
|
meter.cc
|
||||||
midi_byte_array.cc
|
midi_byte_array.cc
|
||||||
route_signal.cc
|
route_signal.cc
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue