LCXL: complete overhaul and Mixbus support

This commit is contained in:
Jan Lentfer 2018-09-21 16:06:16 +02:00 committed by Robin Gareus
parent a33a5cdeaf
commit 05d3539591
3 changed files with 1805 additions and 428 deletions

File diff suppressed because it is too large Load diff

View file

@ -32,17 +32,21 @@
#include "ardour/amp.h" #include "ardour/amp.h"
#include "ardour/async_midi_port.h" #include "ardour/async_midi_port.h"
#include "ardour/audioengine.h" #include "ardour/audioengine.h"
#include "ardour/audio_track.h"
#include "ardour/debug.h" #include "ardour/debug.h"
#include "ardour/midiport_manager.h" #include "ardour/midiport_manager.h"
#include "ardour/midi_track.h" #include "ardour/midi_track.h"
#include "ardour/midi_port.h" #include "ardour/midi_port.h"
#include "ardour/route.h"
#include "ardour/session.h" #include "ardour/session.h"
#include "ardour/solo_isolate_control.h" #include "ardour/solo_isolate_control.h"
#include "ardour/tempo.h" #include "ardour/tempo.h"
#include "ardour/types_convert.h" #include "ardour/types_convert.h"
#include "ardour/vca.h"
#include "ardour/vca_manager.h" #include "ardour/vca_manager.h"
#include "gtkmm2ext/gui_thread.h" #include "gtkmm2ext/gui_thread.h"
#include "gui.h" #include "gui.h"
@ -71,7 +75,12 @@ LaunchControlXL::LaunchControlXL (ARDOUR::Session& s)
, _track_mode(TrackMute) , _track_mode(TrackMute)
, _template_number(8) // default template (factory 1) , _template_number(8) // default template (factory 1)
, _fader8master (false) , _fader8master (false)
, _device_mode (false)
#ifdef MIXBUS32C
, _fss_is_mixbus (false)
#endif
, _refresh_leds_flag (false) , _refresh_leds_flag (false)
, _send_bank_base (0)
, bank_start (0) , bank_start (0)
, connection_state (ConnectionState (0)) , connection_state (ConnectionState (0))
, gui (0) , gui (0)
@ -80,8 +89,6 @@ LaunchControlXL::LaunchControlXL (ARDOUR::Session& s)
lcxl = this; lcxl = this;
/* we're going to need this */ /* we're going to need this */
build_maps ();
/* master cannot be removed, so no need to connect to going-away signal */ /* master cannot be removed, so no need to connect to going-away signal */
master = session->master_out (); master = session->master_out ();
@ -91,19 +98,11 @@ LaunchControlXL::LaunchControlXL (ARDOUR::Session& s)
ports_acquire (); ports_acquire ();
/* catch arrival and departure of LaunchControlXL itself */
ARDOUR::AudioEngine::instance()->PortRegisteredOrUnregistered.connect (port_reg_connection, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::port_registration_handler, this), this);
/* Catch port connections and disconnections */ /* Catch port connections and disconnections */
ARDOUR::AudioEngine::instance()->PortConnectedOrDisconnected.connect (port_connection, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::connection_handler, this, _1, _2, _3, _4, _5), this); ARDOUR::AudioEngine::instance()->PortConnectedOrDisconnected.connect (port_connection, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::connection_handler, this, _1, _2, _3, _4, _5), this);
/* Launch Control XL ports might already be there */
port_registration_handler ();
session->RouteAdded.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::stripables_added, this), lcxl); session->RouteAdded.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::stripables_added, this), lcxl);
session->vca_manager().VCAAdded.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::stripables_added, this), lcxl); session->vca_manager().VCAAdded.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::stripables_added, this), lcxl);
switch_bank (bank_start);
} }
LaunchControlXL::~LaunchControlXL () LaunchControlXL::~LaunchControlXL ()
@ -147,7 +146,14 @@ LaunchControlXL::begin_using_device ()
connect_session_signals (); connect_session_signals ();
build_maps();
reset(template_number());
init_buttons (true); init_buttons (true);
init_knobs ();
button_track_mode(track_mode());
set_send_bank(0);
in_use = true; in_use = true;
@ -249,14 +255,159 @@ LaunchControlXL::bundles ()
return b; return b;
} }
void
LaunchControlXL::init_knobs_and_buttons()
{
init_knobs();
init_buttons();
}
void
LaunchControlXL::init_buttons()
{
init_buttons(false);
}
void
LaunchControlXL::init_buttons (ButtonID buttons[], uint8_t i)
{
for (uint8_t n = 0; n < i; ++n) {
boost::shared_ptr<TrackButton> button = boost::dynamic_pointer_cast<TrackButton> (id_note_button_map[buttons[n]]);
if (button) {
switch ((button->check_method)()) {
case (dev_nonexistant):
button->set_color(Off);
break ;
case (dev_inactive):
button->set_color(button->color_disabled());
break;
case (dev_active):
button->set_color(button->color_enabled());
break;
}
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("Button %1 check_method returned: %2\n", n, (int)button->check_method()));
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("Write state_msg for Button:%1\n", n));
write (button->state_msg());
}
}
/* set "Track Select" LEDs always on - we cycle through stripables */
boost::shared_ptr<SelectButton> sl = boost::dynamic_pointer_cast<SelectButton>(id_controller_button_map[SelectLeft]);
boost::shared_ptr<SelectButton> sr = boost::dynamic_pointer_cast<SelectButton>(id_controller_button_map[SelectRight]);
if (sl && sr) {
write(sl->state_msg(true));
write(sr->state_msg(true));
}
boost::shared_ptr<TrackStateButton> db = boost::dynamic_pointer_cast<TrackStateButton>(id_note_button_map[Device]);
if (db) {
write(db->state_msg(device_mode()));
}
}
void void
LaunchControlXL::init_buttons (bool startup) LaunchControlXL::init_buttons (bool startup)
{ {
reset(template_number()); if (startup && !device_mode()) {
if (startup) {
switch_bank(bank_start); switch_bank(bank_start);
return;
}
if (device_mode()) {
ButtonID buttons[] = { Focus1, Focus2, Focus3, Focus4, Focus5, Focus6, Focus7, Focus8,
Control1, Control2, Control3, Control4, Control5, Control6, Control7, Control8 };
for (size_t n = 0; n < sizeof (buttons) / sizeof (buttons[0]); ++n) {
boost::shared_ptr<TrackButton> button = boost::dynamic_pointer_cast<TrackButton> (id_note_button_map[buttons[n]]);
if (button) {
switch ((button->check_method)()) {
case (dev_nonexistant):
button->set_color(Off);
break;
case (dev_inactive):
button->set_color(button->color_disabled());
break;
case (dev_active):
button->set_color(button->color_enabled());
break;
}
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("Button %1 check_method returned: %2\n", n, (int)button->check_method()));
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("Write state_msg for Button:%1\n", n));
write (button->state_msg());
}
}
}
/* set "Track Select" LEDs always on - we cycle through stripables */
boost::shared_ptr<SelectButton> sl = boost::dynamic_pointer_cast<SelectButton>(id_controller_button_map[SelectLeft]);
boost::shared_ptr<SelectButton> sr = boost::dynamic_pointer_cast<SelectButton>(id_controller_button_map[SelectRight]);
if (sl && sr) {
write(sl->state_msg(true));
write(sr->state_msg(true));
}
#ifdef MIXBUS // for now we only offer a device mode for Mixbus
boost::shared_ptr<TrackStateButton> db = boost::dynamic_pointer_cast<TrackStateButton>(id_note_button_map[Device]);
if (db) {
write(db->state_msg(device_mode()));
}
#endif
}
void
LaunchControlXL::init_knobs (KnobID knobs[], uint8_t i)
{
for (uint8_t n = 0; n < i ; ++n) {
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("init_knobs from array - n:%1\n", n));
boost::shared_ptr<Knob> knob = id_knob_map[knobs[n]];
if (knob) {
switch ((knob->check_method)()) {
case (dev_nonexistant):
knob->set_color(Off);
break;
case (dev_inactive):
knob->set_color(knob->color_disabled());
break;
case (dev_active):
knob->set_color(knob->color_enabled());
break;
}
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("Write state_msg for Knob:%1\n", n));
write (knob->state_msg());
}
}
}
void
LaunchControlXL::init_knobs ()
{
if (!device_mode()) {
for (int n = 0; n < 8; ++n) {
update_knob_led_by_strip(n);
}
} else {
KnobID knobs[] = { SendA1, SendA2, SendA3, SendA4, SendA5, SendA6, SendA7, SendA8,
SendB1, SendB2, SendB3, SendB4, SendB5, SendB6, SendB7, SendB8,
Pan1, Pan2, Pan3, Pan4, Pan5, Pan6, Pan7, Pan8 };
for (size_t n = 0; n < sizeof (knobs) / sizeof (knobs[0]); ++n) {
boost::shared_ptr<Knob> knob = id_knob_map[knobs[n]];
if (knob) {
switch ((knob->check_method)()) {
case (dev_nonexistant):
knob->set_color(Off);
break;
case (dev_inactive):
knob->set_color(knob->color_disabled());
break;
case (dev_active):
knob->set_color(knob->color_enabled());
break;
}
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("Write state_msg for Knob:%1\n", n));
write (knob->state_msg());
}
}
} }
} }
@ -402,8 +553,14 @@ LaunchControlXL::handle_midi_sysex (MIDI::Parser&, MIDI::byte* raw_bytes, size_t
switch (msg[6]) { switch (msg[6]) {
case 0x77: /* template change */ case 0x77: /* template change */
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("Template change: %1 n", msg[7])); DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("Template change: %1\n", (int)msg[7]));
_template_number = msg[7]; _template_number = msg[7];
bank_start = 0;
if (!device_mode ()) {
switch_bank(bank_start);
} else {
init_device_mode();
}
break; break;
} }
} }
@ -412,44 +569,45 @@ LaunchControlXL::handle_midi_sysex (MIDI::Parser&, MIDI::byte* raw_bytes, size_t
void void
LaunchControlXL::handle_button_message(boost::shared_ptr<Button> button, MIDI::EventTwoBytes* ev) LaunchControlXL::handle_button_message(boost::shared_ptr<Button> button, MIDI::EventTwoBytes* ev)
{ {
if (ev->value) { if (ev->value) {
/* any press cancels any pending long press timeouts */ /* any press cancels any pending long press timeouts */
for (set<ButtonID>::iterator x = buttons_down.begin(); x != buttons_down.end(); ++x) { for (set<ButtonID>::iterator x = buttons_down.begin(); x != buttons_down.end(); ++x) {
boost::shared_ptr<ControllerButton> cb = id_controller_button_map[*x]; boost::shared_ptr<ControllerButton> cb = id_controller_button_map[*x];
boost::shared_ptr<NoteButton> nb = id_note_button_map[*x]; boost::shared_ptr<NoteButton> nb = id_note_button_map[*x];
if (cb != 0) { if (cb != 0) {
cb->timeout_connection.disconnect(); cb->timeout_connection.disconnect();
} else if (nb != 0) { } else if (nb != 0) {
nb->timeout_connection.disconnect(); nb->timeout_connection.disconnect();
} }
} }
buttons_down.insert(button->id()); buttons_down.insert(button->id());
DEBUG_TRACE(DEBUG::LaunchControlXL, string_compose("button pressed: %1\n", LaunchControlXL::button_name_by_id(button->id()))); DEBUG_TRACE(DEBUG::LaunchControlXL, string_compose("button pressed: %1\n", LaunchControlXL::button_name_by_id(button->id())));
start_press_timeout(button, button->id()); start_press_timeout(button, button->id());
} else { } else {
DEBUG_TRACE(DEBUG::LaunchControlXL, string_compose("button depressed: %1\n", LaunchControlXL::button_name_by_id(button->id()))); DEBUG_TRACE(DEBUG::LaunchControlXL, string_compose("button depressed: %1\n", LaunchControlXL::button_name_by_id(button->id())));
buttons_down.erase(button->id()); buttons_down.erase(button->id());
button->timeout_connection.disconnect(); button->timeout_connection.disconnect();
if (button == id_note_button_map[Device] && refresh_leds_flag()) { if (button == id_note_button_map[Device] && refresh_leds_flag()) {
switch_bank (bank_start); switch_bank (bank_start);
} }
} }
set<ButtonID>::iterator c = consumed.find(button->id()); set<ButtonID>::iterator c = consumed.find(button->id());
if (c == consumed.end()) { if (c == consumed.end()) {
if (ev->value == 0) { if (ev->value == 0) {
(this->*button->release_method)(); (button->release_method)();
} else { } else {
(this->*button->press_method)(); (button->press_method)();
} }
} else { } else {
DEBUG_TRACE(DEBUG::LaunchControlXL, "button was consumed, ignored\n"); DEBUG_TRACE(DEBUG::LaunchControlXL, "button was consumed, ignored\n");
consumed.erase(c); consumed.erase(c);
} }
} }
bool bool
LaunchControlXL::check_pick_up(boost::shared_ptr<Controller> controller, boost::shared_ptr<AutomationControl> ac) LaunchControlXL::check_pick_up(boost::shared_ptr<Controller> controller, boost::shared_ptr<AutomationControl> ac)
{ {
@ -477,11 +635,11 @@ LaunchControlXL::handle_midi_controller_message (MIDI::Parser& parser, MIDI::Eve
} else if (f != cc_fader_map.end()) { } else if (f != cc_fader_map.end()) {
boost::shared_ptr<Fader> fader = f->second; boost::shared_ptr<Fader> fader = f->second;
fader->set_value(ev->value); fader->set_value(ev->value);
(this->*fader->action_method)(); (fader->action_method)();
} else if (k != cc_knob_map.end()) { } else if (k != cc_knob_map.end()) {
boost::shared_ptr<Knob> knob = k->second; boost::shared_ptr<Knob> knob = k->second;
knob->set_value(ev->value); knob->set_value(ev->value);
(this->*knob->action_method)(); (knob->action_method)();
} }
} }
@ -647,47 +805,6 @@ LaunchControlXL::set_state (const XMLNode & node, int version)
return retval; return retval;
} }
void
LaunchControlXL::port_registration_handler ()
{
if (!_async_in || !_async_out || !_input_port || !_output_port) {
/* ports not registered yet */
return;
}
if (_async_in->connected() && _async_out->connected()) {
/* don't waste cycles here */
return;
}
#ifdef __APPLE__
/* the origin of the numeric magic identifiers is known only to Ableton
and may change in time. This is part of how CoreMIDI works.
*/
string input_port_name = X_("system:midi_capture_1319078870");
string output_port_name = X_("system:midi_playback_3409210341");
#else
string input_port_name = X_("Novation Launch Control XL MIDI 1 in");
string output_port_name = X_("Novation Launch Control XL MIDI 1 out");
#endif
vector<string> in;
vector<string> out;
AudioEngine::instance()->get_ports (string_compose (".*%1", input_port_name), DataType::MIDI, PortFlags (IsPhysical|IsOutput), in);
AudioEngine::instance()->get_ports (string_compose (".*%1", output_port_name), DataType::MIDI, PortFlags (IsPhysical|IsInput), out);
if (!in.empty() && !out.empty()) {
cerr << "LaunchControlXL: both ports found\n";
cerr << "\tconnecting to " << in.front() << " + " << out.front() << endl;
if (!_async_in->connected()) {
AudioEngine::instance()->connect (_async_in->name(), in.front());
}
if (!_async_out->connected()) {
AudioEngine::instance()->connect (_async_out->name(), out.front());
}
}
}
bool bool
LaunchControlXL::connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, boost::weak_ptr<ARDOUR::Port>, std::string name2, bool yn) LaunchControlXL::connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, boost::weak_ptr<ARDOUR::Port>, std::string name2, bool yn)
{ {
@ -760,29 +877,164 @@ LaunchControlXL::input_port()
/* Stripables handling */ /* Stripables handling */
void void
LaunchControlXL::stripable_selection_changed () // we don't need it but it's needs to be declared... LaunchControlXL::stripable_selection_changed ()
{ {
if (!device_mode()) {
switch_bank (bank_start);
} else {
#ifdef MIXBUS32C
if (first_selected_stripable()) {
bool fss_unchanged;
fss_unchanged = (fss_is_mixbus() == (first_selected_stripable()->mixbus() || first_selected_stripable()->is_master()));
if (!fss_unchanged) {
reset(template_number());
build_maps();
store_fss_type();
}
}
#endif
init_knobs_and_buttons();
init_dm_callbacks();
}
} }
void void
LaunchControlXL::stripable_property_change (PropertyChange const& what_changed, uint32_t which) LaunchControlXL::stripable_property_change (PropertyChange const& what_changed, uint32_t which)
{ {
if (!device_mode()) {
if (what_changed.contains (Properties::hidden)) {
switch_bank (bank_start);
}
if (what_changed.contains (Properties::hidden)) { if (what_changed.contains (Properties::selected)) {
switch_bank (bank_start);
if (!stripable[which]) {
return;
}
if (which < 8) {
update_track_focus_led ((uint8_t) which);
update_knob_led_by_strip((uint8_t) which);
}
}
} else {
init_knobs_and_buttons();
}
}
/* strip filter definitions */
static bool flt_default (boost::shared_ptr<Stripable> s) {
if (s->is_master() || s->is_monitor()) {
return false;
}
return (boost::dynamic_pointer_cast<Route>(s) != 0 ||
boost::dynamic_pointer_cast<VCA>(s) != 0);
}
static bool flt_track (boost::shared_ptr<Stripable> s) {
return boost::dynamic_pointer_cast<Track>(s) != 0;
}
static bool flt_auxbus (boost::shared_ptr<Stripable> s) {
if (s->is_master() || s->is_monitor()) {
return false;
}
if (boost::dynamic_pointer_cast<Route>(s) == 0) {
return false;
}
#ifdef MIXBUS
if (s->mixbus () > 0) {
return false;
}
#endif
return boost::dynamic_pointer_cast<Track>(s) == 0;
}
#ifdef MIXBUS
static bool flt_mixbus (boost::shared_ptr<Stripable> s) {
if (s->mixbus () == 0) {
return false;
}
return boost::dynamic_pointer_cast<Track>(s) == 0;
}
#endif
static bool flt_vca (boost::shared_ptr<Stripable> s) {
return boost::dynamic_pointer_cast<VCA>(s) != 0;
}
static bool flt_selected (boost::shared_ptr<Stripable> s) {
return s->is_selected ();
}
#ifdef MIXBUS
#else
static bool flt_rec_armed (boost::shared_ptr<Stripable> s) {
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(s);
if (!t) {
return false;
}
return t->rec_enable_control ()->get_value () > 0;
}
#endif
static bool flt_mains (boost::shared_ptr<Stripable> s) {
return (s->is_master() || s->is_monitor());
}
void
LaunchControlXL::filter_stripables(StripableList& strips) const
{
typedef bool (*FilterFunction)(boost::shared_ptr<Stripable>);
FilterFunction flt;
switch ((int)template_number()) {
case 8:
flt = &flt_default;
break;
case 9:
flt = &flt_track;
break;
case 10:
flt = &flt_auxbus;
break;
#ifdef MIXBUS
case 11:
flt = &flt_mixbus;
break;
case 12:
flt = &flt_vca;
break;
#else
case 11:
flt = &flt_vca;
break;
case 12:
flt = &flt_rec_armed;
break;
#endif
case 13:
flt = &flt_selected;
break;
case 14: // Factory Template 7 behaves strange
break; // don't map it to anyhting
case 15:
flt = &flt_mains;
break;
} }
if (what_changed.contains (Properties::selected)) { StripableList all;
session->get_stripables (all);
if (!stripable[which]) { for (StripableList::const_iterator s = all.begin(); s != all.end(); ++s) {
return; if ((*s)->is_auditioner ()) { continue; }
} if ((*s)->is_hidden ()) { continue; }
if (which < 8) {
update_track_focus_led ((uint8_t) which); if ((*flt)(*s)) {
update_knob_led((uint8_t) which); strips.push_back (*s);
} }
} }
strips.sort (Stripable::Sorter(true));
} }
void void
@ -795,78 +1047,197 @@ LaunchControlXL::switch_template (uint8_t t)
void void
LaunchControlXL::switch_bank (uint32_t base) LaunchControlXL::switch_bank (uint32_t base)
{ {
if (device_mode()) { return; }
reset(template_number());
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("switch_bank bank_start:%1\n", bank_start));
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("switch_bank base:%1\n", base));
StripableList strips;
filter_stripables (strips);
set_send_bank(0);
set_send_bank(0);
boost::shared_ptr<SelectButton> sl = boost::dynamic_pointer_cast<SelectButton>(id_controller_button_map[SelectLeft]); boost::shared_ptr<SelectButton> sl = boost::dynamic_pointer_cast<SelectButton>(id_controller_button_map[SelectLeft]);
boost::shared_ptr<SelectButton> sr = boost::dynamic_pointer_cast<SelectButton>(id_controller_button_map[SelectRight]); boost::shared_ptr<SelectButton> sr = boost::dynamic_pointer_cast<SelectButton>(id_controller_button_map[SelectRight]);
/* work backwards so we can tell if we should actually switch banks */
boost::shared_ptr<Stripable> s[8]; boost::shared_ptr<Stripable> s[8];
uint32_t different = 0; boost::shared_ptr<Stripable> next_base = 0;
uint32_t stripable_counter = get_amount_of_tracks();
uint32_t skip = base;
uint32_t n = 0;
for (StripableList::const_iterator strip = strips.begin(); strip != strips.end(); ++strip) {
int stripable_counter = get_amount_of_tracks(); DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("StripableList iterator - skip: %1, n: %2\n", skip, n));
if (skip > 0) {
for (int n = 0; n < stripable_counter; ++n) { --skip;
s[n] = session->get_remote_nth_stripable (base+n, PresentationInfo::Flag (PresentationInfo::Route|PresentationInfo::VCA)); continue;
if (s[n] != stripable[n]) {
different++;
} }
if (n < stripable_counter) {
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("StripableList iterator - assigning stripable for n: %1\n", n));
s[n] = *strip;
}
if (n == stripable_counter) { /* last strip +1 -> another bank exists */
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("StripableList iterator - n: %1. Filling next_base\n", n));
next_base = *strip;
bank_start = base;
break;
}
++n;
} }
if (!s[0]) { if (!s[0]) {
/* not even the first stripable exists, do nothing */ /* not even the first stripable exists, do nothing */
DEBUG_TRACE (DEBUG::LaunchControlXL, "not even first stripable exists.. returning\n");
return; return;
} }
if (sl && sr) { if (sl && sr) {
boost::shared_ptr<Stripable> next_base = session->get_remote_nth_stripable (base+8, PresentationInfo::Flag (PresentationInfo::Route|PresentationInfo::VCA)); write(sl->state_msg(base));
write(sl->state_msg((base))); write(sr->state_msg(next_base != 0));
write(sr->state_msg((next_base != 0)));
} }
stripable_connections.drop_connections (); stripable_connections.drop_connections ();
for (int n = 0; n < stripable_counter; ++n) { for (uint32_t n = 0; n < stripable_counter; ++n) {
stripable[n] = s[n]; stripable[n] = s[n];
} }
/* at least one stripable in this bank */
bank_start = base;
for (int n = 0; n < 8; ++n) { for (int n = 0; n < 8; ++n) {
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("Binding Callbacks for n: %1\n", n));
if (stripable[n]) { if (stripable[n]) {
/* stripable goes away? refill the bank, starting at the same point */ DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("Binding Callbacks stripable[%1] exists\n", n));
stripable[n]->DropReferences.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::switch_bank, this, bank_start), lcxl); stripable[n]->DropReferences.connect (stripable_connections, MISSING_INVALIDATOR,
stripable[n]->presentation_info().PropertyChanged.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::stripable_property_change, this, _1, n), lcxl); boost::bind (&LaunchControlXL::switch_bank, this, bank_start), lcxl);
stripable[n]->solo_control()->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::solo_changed, this, n), lcxl); stripable[n]->presentation_info().PropertyChanged.connect (stripable_connections, MISSING_INVALIDATOR,
stripable[n]->mute_control()->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::mute_changed, this, n), lcxl); boost::bind (&LaunchControlXL::stripable_property_change, this, _1, n), lcxl);
stripable[n]->solo_control()->Changed.connect (stripable_connections, MISSING_INVALIDATOR,
boost::bind (&LaunchControlXL::solo_changed, this, n), lcxl);
stripable[n]->mute_control()->Changed.connect (stripable_connections, MISSING_INVALIDATOR,
boost::bind (&LaunchControlXL::mute_changed, this, n), lcxl);
if (stripable[n]->solo_isolate_control()) { /*VCAs are stripables without isolate solo */ if (stripable[n]->solo_isolate_control()) { /*VCAs are stripables without isolate solo */
stripable[n]->solo_isolate_control()->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::solo_iso_changed, this,n ), lcxl); stripable[n]->solo_isolate_control()->Changed.connect (stripable_connections, MISSING_INVALIDATOR,
boost::bind (&LaunchControlXL::solo_iso_changed, this,n ), lcxl);
} }
#ifdef MIXBUS #ifdef MIXBUS
if (stripable[n]->master_send_enable_controllable()) { if (stripable[n]->master_send_enable_controllable()) {
stripable[n]->master_send_enable_controllable()->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::master_send_changed, this,n ), lcxl); stripable[n]->master_send_enable_controllable()->Changed.connect (stripable_connections, MISSING_INVALIDATOR,
boost::bind (&LaunchControlXL::master_send_changed, this,n ), lcxl);
} }
#endif #endif
if (stripable[n]->rec_enable_control()) { if (stripable[n]->rec_enable_control()) {
stripable[n]->rec_enable_control()->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::rec_changed, this, n), lcxl); stripable[n]->rec_enable_control()->Changed.connect (stripable_connections, MISSING_INVALIDATOR,
boost::bind (&LaunchControlXL::rec_changed, this, n), lcxl);
} }
} }
update_track_focus_led(n); update_track_focus_led(n);
button_track_mode(track_mode()); update_track_control_led(n);
update_knob_led(n); update_knob_led_by_strip(n);
} }
button_track_mode(track_mode());
}
void
LaunchControlXL::init_dm_callbacks()
{
stripable_connections.drop_connections ();
if (!first_selected_stripable()) {
return;
}
if (first_selected_stripable()->mute_control()) {
first_selected_stripable()->mute_control()->Changed.connect (stripable_connections,
MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_buttons,this), lcxl);
}
if (first_selected_stripable()->solo_control()) {
first_selected_stripable()->solo_control()->Changed.connect (stripable_connections,
MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_buttons,this), lcxl);
}
if (first_selected_stripable()->rec_enable_control()) {
first_selected_stripable()->rec_enable_control()->Changed.connect (stripable_connections,
MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_buttons,this), lcxl);
}
#ifdef MIXBUS
if (first_selected_stripable()->eq_enable_controllable()) {
first_selected_stripable()->eq_enable_controllable()->Changed.connect (stripable_connections,
MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_knobs_and_buttons,this), lcxl);
}
if (first_selected_stripable()->eq_shape_controllable(0)) {
first_selected_stripable()->eq_shape_controllable(0)->Changed.connect (stripable_connections,
MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_buttons,this), lcxl);
}
if (first_selected_stripable()->eq_shape_controllable(3)) {
first_selected_stripable()->eq_shape_controllable(3)->Changed.connect (stripable_connections,
MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_buttons,this), lcxl);
}
if (first_selected_stripable()->comp_enable_controllable()) {
first_selected_stripable()->comp_enable_controllable()->Changed.connect (stripable_connections,
MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_knobs_and_buttons,this), lcxl);
}
if (first_selected_stripable()->filter_enable_controllable(true)) { // only handle one case, as Mixbus only has one
first_selected_stripable()->filter_enable_controllable(true)->Changed.connect (stripable_connections,
MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_knobs_and_buttons, this), lcxl);
}
if (first_selected_stripable()->master_send_enable_controllable()) {
first_selected_stripable()->master_send_enable_controllable()->Changed.connect (stripable_connections,
MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_knobs_and_buttons, this), lcxl);
}
for (uint8_t se = 0; se < 12 ; ++se) {
if (first_selected_stripable()->send_enable_controllable(se)) {
first_selected_stripable()->send_enable_controllable(se)->Changed.connect (stripable_connections,
MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_knobs_and_buttons, this), lcxl);
}
}
#endif
}
#ifdef MIXBUS32C
void
LaunchControlXL::store_fss_type()
{
if (first_selected_stripable()) {
if (first_selected_stripable()->mixbus() || first_selected_stripable()->is_master()) {
_fss_is_mixbus = true;
} else {
_fss_is_mixbus = false;
}
}
}
#endif
void
LaunchControlXL::init_device_mode()
{
DEBUG_TRACE (DEBUG::LaunchControlXL, "Initializing device mode\n");
init_knobs();
init_buttons(false);
#ifdef MIXBUS32C
store_fss_type();
#endif
init_dm_callbacks();
} }
void void
LaunchControlXL::stripables_added () LaunchControlXL::stripables_added ()
{ {
DEBUG_TRACE (DEBUG::LaunchControlXL, "LaunchControlXL::new stripable added!\n"); DEBUG_TRACE (DEBUG::LaunchControlXL, "LaunchControlXL::new stripable added!\n");
/* reload current bank */ if (!device_mode()) {
switch_bank (bank_start); /* reload current bank */
switch_bank (bank_start);
} else {
return;
}
} }
@ -874,21 +1245,54 @@ void LaunchControlXL::set_track_mode (TrackMode mode) {
_track_mode = mode; _track_mode = mode;
// now do led stuffs to signify the change // now do led stuffs to signify the change
ButtonID trk_cntrl_btns[] = { Control1, Control2, Control3, Control4,
Control5, Control6, Control7, Control8 };
LEDColor color_on, color_off;
switch(mode) { switch(mode) {
case TrackMute: case TrackMute:
color_on = YellowFull;
color_off = YellowLow;
break; break;
case TrackSolo: case TrackSolo:
color_on = GreenFull;
color_off = GreenLow;
break; break;
case TrackRecord: case TrackRecord:
color_on = RedFull;
color_off = RedLow;
break; break;
default: default:
break; break;
} }
for ( size_t n = 0 ; n < sizeof (trk_cntrl_btns) / sizeof (trk_cntrl_btns[0]); ++n) {
boost::shared_ptr<TrackButton> b = boost::dynamic_pointer_cast<TrackButton> (id_note_button_map[trk_cntrl_btns[n]]);
if (b) {
b->set_color_enabled(color_on);
b->set_color_disabled(color_off);
}
}
} }
void
LaunchControlXL::set_device_mode (bool yn)
{
_device_mode = yn;
reset(template_number());
boost::shared_ptr<TrackStateButton> db = boost::dynamic_pointer_cast<TrackStateButton>(id_note_button_map[Device]);
write(db->state_msg(_device_mode));
set_send_bank(0);
build_maps();
if (device_mode()) {
init_device_mode();
} else {
switch_bank (bank_start);
}
}
void void
LaunchControlXL::set_fader8master (bool yn) LaunchControlXL::set_fader8master (bool yn)
{ {
@ -907,6 +1311,58 @@ LaunchControlXL::set_fader8master (bool yn)
switch_bank (bank_start); switch_bank (bank_start);
} }
void
LaunchControlXL::set_send_bank (int offset)
{
if ((_send_bank_base == 0 && offset < 0) || (_send_bank_base == 4 && offset > 0)) {
return;
}
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("set_send_bank - _send_bank_base: %1 \n", send_bank_base()));
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("set_send_bank - applying offset %1 \n", offset));
boost::shared_ptr<SelectButton> sbu = boost::dynamic_pointer_cast<SelectButton>(id_controller_button_map[SelectUp]);
boost::shared_ptr<SelectButton> sbd = boost::dynamic_pointer_cast<SelectButton>(id_controller_button_map[SelectDown]);
if (!sbu || !sbd ) {
return;
}
_send_bank_base = _send_bank_base + offset;
_send_bank_base = max (0, min (4, _send_bank_base));
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose ("set_send_bank - _send_bank_base: %1 \n", send_bank_base()));
#ifdef MIXBUS
if (device_mode()) { /* in device mode rebuild send led bindings */
build_maps();
//init_knobs_and_buttons();
KnobID knobs[] = { Pan1, Pan2, Pan3, Pan4, Pan5, Pan6, Pan7, Pan8 };
ButtonID buttons[] = { Focus1, Focus2, Focus3, Focus4, Focus5, Focus6, Focus7, Focus8 };
init_knobs (knobs, 8);
init_buttons (buttons, 8);
}
#endif
switch (_send_bank_base) {
case 0:
case 1:
write (sbu->state_msg(false));
write (sbd->state_msg(true));
break;
case 2:
case 3:
write (sbu->state_msg(true));
write (sbd->state_msg(true));
break;
case 4:
case 5:
write (sbu->state_msg(true));
write (sbd->state_msg(false));
break;
}
}
int int
LaunchControlXL::get_amount_of_tracks () LaunchControlXL::get_amount_of_tracks ()
{ {

View file

@ -137,13 +137,26 @@ public:
Pan8 Pan8
}; };
enum LEDFlag { Normal = 0xC, Blink = 0x8, DoubleBuffering = 0x0 }; enum DeviceStatus {
dev_nonexistant = 0,
dev_inactive,
dev_active
};
enum LEDFlag { Normal = 0xC, Blink = 0x8, DoubleBuffering = 0x0 };
enum LEDColor { Off=0, RedLow = 1, RedFull = 3, GreenLow = 16, GreenFull = 48, YellowLow = 34, YellowFull = 51, AmberLow = 18, AmberFull = 35}; enum LEDColor { Off=0, RedLow = 1, RedFull = 3, GreenLow = 16, GreenFull = 48, YellowLow = 34, YellowFull = 51, AmberLow = 18, AmberFull = 35};
#ifdef MIXBUS
enum CompParam {
CompMakeup,
CompMode,
CompSpeed
};
#endif
struct Controller { struct Controller {
Controller(uint8_t cn, uint8_t val, void (LaunchControlXL::*action)()) Controller(uint8_t cn, uint8_t val, boost::function<void ()> action)
: _controller_number(cn) : _controller_number(cn)
, _value(val) , _value(val)
, action_method(action) {} , action_method(action) {}
@ -157,7 +170,7 @@ public:
uint8_t _value; uint8_t _value;
public: public:
void (LaunchControlXL::*action_method)(); boost::function<void ()> action_method;
}; };
struct LED { struct LED {
@ -189,31 +202,20 @@ public:
}; };
struct Button { struct Button {
Button(ButtonID id) Button(ButtonID id, boost::function<void ()> press, boost::function<void ()> release,
: press_method(&LaunchControlXL::relax) boost::function<void ()> long_press)
, release_method(&LaunchControlXL::relax)
, long_press_method(&LaunchControlXL::relax), _id(id) {}
Button(ButtonID id, void (LaunchControlXL::*press)())
: press_method(press) : press_method(press)
, release_method(&LaunchControlXL::relax) , release_method(release)
, long_press_method(&LaunchControlXL::relax), _id(id) {} , long_press_method(long_press),
_id(id) {}
Button(ButtonID id, void (LaunchControlXL::*press)(), void (LaunchControlXL::*release)())
: press_method(press), release_method(release)
, long_press_method(&LaunchControlXL::relax), _id(id) {}
Button(ButtonID id, void (LaunchControlXL::*press)(), void (LaunchControlXL::*release)(), void (LaunchControlXL::*long_press)())
: press_method(press), release_method(release)
, long_press_method(long_press), _id(id) {}
virtual ~Button() {} virtual ~Button() {}
ButtonID id() const { return _id; } ButtonID id() const { return _id; }
void (LaunchControlXL::*press_method)(); boost::function<void ()> press_method;
void (LaunchControlXL::*release_method)(); boost::function<void ()> release_method;
void (LaunchControlXL::*long_press_method)(); boost::function<void ()> long_press_method;
sigc::connection timeout_connection; sigc::connection timeout_connection;
@ -222,15 +224,12 @@ public:
}; };
struct ControllerButton : public Button { struct ControllerButton : public Button {
ControllerButton(ButtonID id, uint8_t cn, ControllerButton(ButtonID id, uint8_t cn,
void (LaunchControlXL::*press)()) boost::function<void ()> press,
: Button(id, press), _controller_number(cn) {} boost::function<void ()> release,
boost::function<void ()> long_release)
: Button(id, press, release, long_release), _controller_number(cn) {}
ControllerButton(ButtonID id, uint8_t cn,
void (LaunchControlXL::*press)(),
void (LaunchControlXL::*release)())
: Button(id, press, release), _controller_number(cn) {}
uint8_t controller_number() const { return _controller_number; } uint8_t controller_number() const { return _controller_number; }
@ -240,18 +239,10 @@ public:
}; };
struct NoteButton : public Button { struct NoteButton : public Button {
NoteButton(ButtonID id, uint8_t cn, void (LaunchControlXL::*press)())
: Button(id, press), _note_number(cn) {}
NoteButton(ButtonID id, uint8_t cn, NoteButton(ButtonID id, uint8_t cn,
void (LaunchControlXL::*press)(), boost::function<void ()> press,
void (LaunchControlXL::*release)()) boost::function<void ()> release,
: Button(id, press, release), _note_number(cn) {} boost::function<void ()> release_long)
NoteButton(ButtonID id, uint8_t cn,
void (LaunchControlXL::*press)(),
void (LaunchControlXL::*release)(),
void (LaunchControlXL::*release_long)())
: Button(id, press, release, release_long), _note_number(cn) {} : Button(id, press, release, release_long), _note_number(cn) {}
uint8_t note_number() const { return _note_number; } uint8_t note_number() const { return _note_number; }
@ -261,40 +252,52 @@ public:
}; };
struct TrackButton : public NoteButton, public MultiColorLED { struct TrackButton : public NoteButton, public MultiColorLED {
TrackButton(ButtonID id, uint8_t nn, uint8_t index, LEDColor color, TrackButton(ButtonID id, uint8_t nn, uint8_t index, LEDColor c_on, LEDColor c_off,
void (LaunchControlXL::*press)(), LaunchControlXL& l) boost::function<void ()> press,
: NoteButton(id, nn, press), MultiColorLED(index, color, l) {} boost::function<void ()> release,
boost::function<void ()> release_long,
TrackButton(ButtonID id, uint8_t nn, uint8_t index, LEDColor color, boost::function<uint8_t ()> check,
void (LaunchControlXL::*press)(),
void (LaunchControlXL::*release)(),
LaunchControlXL& l) LaunchControlXL& l)
: NoteButton(id, nn, press, release), MultiColorLED(index, color, l) {} : NoteButton(id, nn, press, release, release_long)
, MultiColorLED(index, Off, l)
, check_method(check)
, _color_enabled (c_on)
, _color_disabled (c_off) {}
LEDColor color_enabled() const { return _color_enabled; }
LEDColor color_disabled() const { return _color_disabled; }
void set_color_enabled (LEDColor c_on) { _color_enabled = c_on; }
void set_color_disabled (LEDColor c_off) { _color_disabled = c_off; }
boost::function<uint8_t ()> check_method;
MidiByteArray state_msg(bool light = true) const; MidiByteArray state_msg(bool light = true) const;
private:
LEDColor _color_enabled;
LEDColor _color_disabled;
}; };
struct SelectButton : public ControllerButton, public LED { struct SelectButton : public ControllerButton, public LED {
SelectButton(ButtonID id, uint8_t cn, uint8_t index, void (LaunchControlXL::*press)(), LaunchControlXL& l) SelectButton(ButtonID id, uint8_t cn, uint8_t index,
: ControllerButton(id, cn, press), LED(index, RedFull, l) {} boost::function<void ()> press,
boost::function<void ()> release,
boost::function<void ()> long_release,
LaunchControlXL& l)
: ControllerButton(id, cn, press, release, long_release), LED(index, RedFull, l) {}
MidiByteArray state_msg(bool light) const; MidiByteArray state_msg(bool light) const;
}; };
struct TrackStateButton : public NoteButton, public LED { struct TrackStateButton : public NoteButton, public LED {
TrackStateButton(ButtonID id, uint8_t nn, uint8_t index, void (LaunchControlXL::*press)(), LaunchControlXL& l) TrackStateButton(ButtonID id, uint8_t nn, uint8_t index,
: NoteButton(id, nn, press) boost::function<void ()> press,
, LED(index, YellowLow, l) {} boost::function<void ()> release,
boost::function<void ()> release_long,
TrackStateButton(ButtonID id, uint8_t nn, uint8_t index, void (LaunchControlXL::*press)(),
void (LaunchControlXL::*release)(),
LaunchControlXL& l)
: NoteButton(id, nn, press, release)
, LED(index, YellowLow, l) {}
TrackStateButton(ButtonID id, uint8_t nn, uint8_t index, void (LaunchControlXL::*press)(),
void (LaunchControlXL::*release)(),
void (LaunchControlXL::*release_long)(),
LaunchControlXL& l) LaunchControlXL& l)
: NoteButton(id, nn, press, release, release_long) : NoteButton(id, nn, press, release, release_long)
, LED(index, YellowLow, l) {} , LED(index, YellowLow, l) {}
@ -303,7 +306,7 @@ public:
}; };
struct Fader : public Controller { struct Fader : public Controller {
Fader(FaderID id, uint8_t cn, void (LaunchControlXL::*action)()) Fader(FaderID id, uint8_t cn, boost::function<void ()> action)
: Controller(cn, 0, action), _id(id) {} // minimal value : Controller(cn, 0, action), _id(id) {} // minimal value
FaderID id() const { return _id; } FaderID id() const { return _id; }
@ -315,17 +318,36 @@ public:
}; };
struct Knob : public Controller, public MultiColorLED { struct Knob : public Controller, public MultiColorLED {
Knob(KnobID id, uint8_t cn, uint8_t index, void (LaunchControlXL::*action)(), LaunchControlXL &l) Knob(KnobID id, uint8_t cn, uint8_t index, LEDColor c_on, LEDColor c_off, boost::function<void ()> action,
LaunchControlXL &l)
: Controller(cn, 64, action) : Controller(cn, 64, action)
, MultiColorLED(index, Off, l) , MultiColorLED(index, Off, l)
, _id(id) {} // knob 50/50 value , _id(id)
, _color_enabled (c_on)
, _color_disabled (c_off) {} // knob 50/50 value
Knob(KnobID id, uint8_t cn, uint8_t index, LEDColor c_on, LEDColor c_off, boost::function<void ()> action,
boost::function<uint8_t ()> check, LaunchControlXL &l)
: Controller(cn, 64, action)
, MultiColorLED(index, Off, l)
, check_method(check)
, _id(id)
, _color_enabled (c_on)
, _color_disabled (c_off) {} // knob 50/50 value
KnobID id() const { return _id; } KnobID id() const { return _id; }
LEDColor color_enabled() const { return _color_enabled; }
LEDColor color_disabled() const { return _color_disabled; }
boost::function<uint8_t ()> check_method;
MidiByteArray state_msg(bool light = true) const; MidiByteArray state_msg(bool light = true) const;
private: private:
KnobID _id; KnobID _id;
LEDColor _color_enabled;
LEDColor _color_disabled;
}; };
public: public:
@ -368,19 +390,36 @@ public:
void set_refresh_leds_flag (bool yn); void set_refresh_leds_flag (bool yn);
bool refresh_leds_flag () const { return _refresh_leds_flag; } bool refresh_leds_flag () const { return _refresh_leds_flag; }
void set_device_mode (bool yn);
bool device_mode () const { return _device_mode; }
#ifdef MIXBUS32C
void store_fss_type();
bool fss_is_mixbus() const { return _fss_is_mixbus; }
#endif
TrackMode track_mode() const { return _track_mode; } TrackMode track_mode() const { return _track_mode; }
void set_track_mode(TrackMode mode); void set_track_mode(TrackMode mode);
uint8_t template_number() const { return _template_number; } uint8_t template_number() const { return _template_number; }
void set_send_bank (int offset);
void send_bank_switch(bool up);
int send_bank_base () const { return _send_bank_base; }
private: private:
bool in_use; bool in_use;
TrackMode _track_mode; TrackMode _track_mode;
uint8_t _template_number; uint8_t _template_number;
bool _fader8master; bool _fader8master;
bool _device_mode;
#ifdef MIXBUS32C
bool _fss_is_mixbus;
#endif
bool _refresh_leds_flag; bool _refresh_leds_flag;
int _send_bank_base;
void do_request(LaunchControlRequest *); void do_request(LaunchControlRequest *);
int begin_using_device(); int begin_using_device();
@ -426,9 +465,18 @@ private:
bool button_long_press_timeout(ButtonID id, boost::shared_ptr<Button> button); bool button_long_press_timeout(ButtonID id, boost::shared_ptr<Button> button);
void start_press_timeout(boost::shared_ptr<Button> , ButtonID); void start_press_timeout(boost::shared_ptr<Button> , ButtonID);
void init_buttons();
void init_buttons(bool startup); void init_buttons(bool startup);
void init_buttons (ButtonID buttons[], uint8_t i);
void init_knobs();
void init_knobs(KnobID knobs[], uint8_t i);
void init_knobs_and_buttons();
void init_device_mode();
void init_dm_callbacks();
void switch_template(uint8_t t); void switch_template(uint8_t t);
void filter_stripables (ARDOUR::StripableList& strips) const;
void build_maps(); void build_maps();
@ -463,57 +511,63 @@ private:
void notify_parameter_changed(std::string); void notify_parameter_changed(std::string);
/* Knob methods */ /* Knob methods */
boost::shared_ptr<Knob> knob_by_id(KnobID id);
boost::shared_ptr<Knob>* knobs_by_column(uint8_t col, boost::shared_ptr<Knob>* knob_col); boost::shared_ptr<Knob>* knobs_by_column(uint8_t col, boost::shared_ptr<Knob>* knob_col);
void update_knob_led(uint8_t n); void update_knob_led_by_strip(uint8_t n);
void update_knob_led_by_id(uint8_t id, LEDColor color);
void knob_sendA(uint8_t n); void knob_sendA(uint8_t n);
void knob_sendB(uint8_t n); void knob_sendB(uint8_t n);
void knob_pan(uint8_t n); void knob_pan(uint8_t n);
uint8_t dm_check_dummy(DeviceStatus ds);
void knob_sendA1() { knob_sendA(0); } void dm_fader(FaderID id);
void knob_sendA2() { knob_sendA(1); } uint8_t dm_check_pan_azi ();
void knob_sendA3() { knob_sendA(2); } void dm_pan_azi(KnobID k);
void knob_sendA4() { knob_sendA(3); } uint8_t dm_check_pan_width();
void knob_sendA5() { knob_sendA(4); } void dm_pan_width (KnobID k);
void knob_sendA6() { knob_sendA(5); } uint8_t dm_check_trim ();
void knob_sendA7() { knob_sendA(6); } void dm_trim(KnobID k);
void knob_sendA8() { knob_sendA(7); } uint8_t dm_mute_enabled();
void dm_mute_switch();
uint8_t dm_solo_enabled();
void dm_solo_switch();
uint8_t dm_recenable_enabled();
void dm_recenable_switch();
void dm_select_prev_strip();
void dm_select_next_strip();
void knob_sendB1() { knob_sendB(0); } #ifdef MIXBUS
void knob_sendB2() { knob_sendB(1); } void dm_mb_eq_switch();
void knob_sendB3() { knob_sendB(2); } void dm_mb_eq (KnobID k, bool gain, uint8_t band);
void knob_sendB4() { knob_sendB(3); } uint8_t dm_mb_eq_freq_enabled();
void knob_sendB5() { knob_sendB(4); } uint8_t dm_mb_eq_gain_enabled(uint8_t band);
void knob_sendB6() { knob_sendB(5); } void dm_mb_eq_shape_switch(uint8_t band);
void knob_sendB7() { knob_sendB(6); } uint8_t dm_mb_eq_shape_enabled(uint8_t band);
void knob_sendB8() { knob_sendB(7); } uint8_t dm_mb_flt_enabled();
void dm_mb_flt_frq (KnobID k, bool hpf);
void knob_pan1() { knob_pan(0); } void dm_mb_flt_switch();
void knob_pan2() { knob_pan(1); } void dm_mb_send_enabled(KnobID k);
void knob_pan3() { knob_pan(2); } uint8_t dm_mb_check_send_knob(KnobID k);
void knob_pan4() { knob_pan(3); } uint8_t dm_mb_check_send_button(uint8_t s);
void knob_pan5() { knob_pan(4); } void dm_mb_sends (KnobID k);
void knob_pan6() { knob_pan(5); } void dm_mb_send_switch (ButtonID b);
void knob_pan7() { knob_pan(6); } uint8_t dm_mb_comp_enabled();
void knob_pan8() { knob_pan(7); } void dm_mb_comp_switch();
void dm_mb_comp (KnobID k, CompParam c);
void dm_mb_comp_thresh (FaderID id);
uint8_t dm_mb_has_tapedrive();
void dm_mb_tapedrive (KnobID k);
uint8_t dm_mb_master_assign_enabled();
void dm_mb_master_assign_switch();
#endif
/* Fader methods */ /* Fader methods */
void fader(uint8_t n); void fader(uint8_t n);
void fader_1() { fader(0); }
void fader_2() { fader(1); }
void fader_3() { fader(2); }
void fader_4() { fader(3); }
void fader_5() { fader(4); }
void fader_6() { fader(5); }
void fader_7() { fader(6); }
void fader_8() { fader(7); }
/* Button methods */ /* Button methods */
boost::shared_ptr<TrackButton> track_button_by_range(uint8_t n, uint8_t first, uint8_t middle); boost::shared_ptr<TrackButton> track_button_by_range(uint8_t n, uint8_t first, uint8_t middle);
boost::shared_ptr<TrackButton> focus_button_by_column(uint8_t col) { return track_button_by_range(col, 41, 57) ; } boost::shared_ptr<TrackButton> focus_button_by_column(uint8_t col) { return track_button_by_range(col, 41, 57) ; }
boost::shared_ptr<TrackButton> control_button_by_column(uint8_t col) { return track_button_by_range(col, 73, 89) ; } boost::shared_ptr<TrackButton> control_button_by_column(uint8_t col) { return track_button_by_range(col, 73, 89) ; }
@ -523,7 +577,9 @@ private:
void button_device_long_press(); void button_device_long_press();
void button_track_mode(TrackMode state); void button_track_mode(TrackMode state);
void button_mute(); void button_mute();
void button_mute_long_press();
void button_solo(); void button_solo();
void button_solo_long_press();
void button_record(); void button_record();
void button_select_up(); void button_select_up();
void button_select_down(); void button_select_down();
@ -531,29 +587,15 @@ private:
void button_select_right(); void button_select_right();
void button_track_focus(uint8_t n); void button_track_focus(uint8_t n);
void button_track_control(uint8_t n); void button_press_track_control(uint8_t n);
void button_release_track_control(uint8_t n);
boost::shared_ptr<ARDOUR::AutomationControl> get_ac_by_state(uint8_t n); boost::shared_ptr<ARDOUR::AutomationControl> get_ac_by_state(uint8_t n);
void update_track_focus_led(uint8_t n); void update_track_focus_led(uint8_t n);
void update_track_control_led(uint8_t n); void update_track_control_led(uint8_t n);
void button_track_focus_1() { button_track_focus(0); } void send_bank_switch_0() { send_bank_switch(0); }
void button_track_focus_2() { button_track_focus(1); } void send_bank_switch_1() { send_bank_switch(1); }
void button_track_focus_3() { button_track_focus(2); }
void button_track_focus_4() { button_track_focus(3); }
void button_track_focus_5() { button_track_focus(4); }
void button_track_focus_6() { button_track_focus(5); }
void button_track_focus_7() { button_track_focus(6); }
void button_track_focus_8() { button_track_focus(7); }
void button_track_control_1() { button_track_control(0); }
void button_track_control_2() { button_track_control(1); }
void button_track_control_3() { button_track_control(2); }
void button_track_control_4() { button_track_control(3); }
void button_track_control_5() { button_track_control(4); }
void button_track_control_6() { button_track_control(5); }
void button_track_control_7() { button_track_control(6); }
void button_track_control_8() { button_track_control(7); }
/* stripables */ /* stripables */
@ -569,13 +611,14 @@ private:
void solo_changed (uint32_t n) { solo_mute_rec_changed(n); } void solo_changed (uint32_t n) { solo_mute_rec_changed(n); }
void mute_changed (uint32_t n) { solo_mute_rec_changed(n); } void mute_changed (uint32_t n) { solo_mute_rec_changed(n); }
void rec_changed (uint32_t n) { solo_mute_rec_changed(n); }
void solo_iso_changed (uint32_t n); void solo_iso_changed (uint32_t n);
void solo_iso_led_bank (); void solo_iso_led_bank ();
#ifdef MIXBUS #ifdef MIXBUS
void master_send_changed (uint32_t n); void master_send_changed (uint32_t n);
void master_send_led_bank (); void master_send_led_bank ();
#endif #endif
void rec_changed (uint32_t n) { solo_mute_rec_changed(n); }
void solo_mute_rec_changed (uint32_t n); void solo_mute_rec_changed (uint32_t n);
/* special Stripable */ /* special Stripable */