mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
LCXL: add visual feedback for sec button functions
also add some little fixes in regard
to fixing master fader on controller
fader no 8
This commit is contained in:
parent
03c5a35a8c
commit
fdbce2e8c8
3 changed files with 129 additions and 12 deletions
|
|
@ -307,7 +307,10 @@ LaunchControlXL::button_track_focus(uint8_t n)
|
||||||
{
|
{
|
||||||
if (buttons_down.find(Device) != buttons_down.end()) {
|
if (buttons_down.find(Device) != buttons_down.end()) {
|
||||||
DEBUG_TRACE (DEBUG::LaunchControlXL, "DEVICE BUTTON HOLD\n");
|
DEBUG_TRACE (DEBUG::LaunchControlXL, "DEVICE BUTTON HOLD\n");
|
||||||
stripable[n]->solo_isolate_control()->set_value (!stripable[n]->solo_isolate_control()->get_value(), PBD::Controllable::UseGroup);
|
if (stripable[n]->solo_isolate_control()) {
|
||||||
|
bool solo_isolate_active = stripable[n]->solo_isolate_control()->get_value();
|
||||||
|
stripable[n]->solo_isolate_control()->set_value (!solo_isolate_active, PBD::Controllable::UseGroup);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -482,6 +485,72 @@ LaunchControlXL::solo_mute_rec_changed(uint32_t n) {
|
||||||
update_track_control_led(n);
|
update_track_control_led(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LaunchControlXL::solo_iso_changed(uint32_t n)
|
||||||
|
{
|
||||||
|
if (!stripable[n]) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
solo_iso_led_bank();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LaunchControlXL::solo_iso_led_bank ()
|
||||||
|
{
|
||||||
|
int stripable_counter = get_amount_of_tracks();
|
||||||
|
|
||||||
|
if (!(buttons_down.find(Device) != buttons_down.end())) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
for (int y = 0; y < stripable_counter; ++y) {
|
||||||
|
TrackButton* b = focus_button_by_column(y);
|
||||||
|
|
||||||
|
if (stripable[y]->solo_isolate_control()->get_value()) {
|
||||||
|
b->set_color(RedFull);
|
||||||
|
} else {
|
||||||
|
b->set_color(Off);
|
||||||
|
}
|
||||||
|
write (b->state_msg());
|
||||||
|
}
|
||||||
|
LaunchControlXL::set_refresh_leds_flag(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef MIXBUS
|
||||||
|
void
|
||||||
|
LaunchControlXL::master_send_changed(uint32_t n)
|
||||||
|
{
|
||||||
|
if (!stripable[n]) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
master_send_led_bank();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LaunchControlXL::master_send_led_bank ()
|
||||||
|
{
|
||||||
|
if (!(buttons_down.find(Device) != buttons_down.end())) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
int stripable_counter = LaunchControlXL::get_amount_of_tracks();
|
||||||
|
|
||||||
|
for (int n = 0; n < stripable_counter; ++n) {
|
||||||
|
TrackButton* b = control_button_by_column(n);
|
||||||
|
if (stripable[n]->master_send_enable_controllable()->get_value()) {
|
||||||
|
b->set_color(GreenFull);
|
||||||
|
} else {
|
||||||
|
b->set_color(Off);
|
||||||
|
}
|
||||||
|
write (b->state_msg());
|
||||||
|
}
|
||||||
|
LaunchControlXL::set_refresh_leds_flag(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
void
|
void
|
||||||
LaunchControlXL::button_track_control(uint8_t n) {
|
LaunchControlXL::button_track_control(uint8_t n) {
|
||||||
if (!stripable[n]) {
|
if (!stripable[n]) {
|
||||||
|
|
@ -491,10 +560,13 @@ LaunchControlXL::button_track_control(uint8_t n) {
|
||||||
if (buttons_down.find(Device) != buttons_down.end()) {
|
if (buttons_down.find(Device) != buttons_down.end()) {
|
||||||
DEBUG_TRACE (DEBUG::LaunchControlXL, "DEVICE BUTTON HOLD\n");
|
DEBUG_TRACE (DEBUG::LaunchControlXL, "DEVICE BUTTON HOLD\n");
|
||||||
#ifdef MIXBUS
|
#ifdef MIXBUS
|
||||||
if (stripable[n] != master) {
|
if (stripable[n]->master_send_enable_controllable()) {
|
||||||
|
bool master_send_active = stripable[n]->master_send_enable_controllable()->get_value();
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::LaunchControlXL, "MIXBUS Master Assign\n");
|
DEBUG_TRACE (DEBUG::LaunchControlXL, "MIXBUS Master Assign\n");
|
||||||
stripable[n]->master_send_enable_controllable()->set_value (!stripable[n]->master_send_enable_controllable()->get_value(), PBD::Controllable::UseGroup);
|
stripable[n]->master_send_enable_controllable()->set_value (!master_send_active, PBD::Controllable::UseGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
/* something useful for Ardour */
|
/* something useful for Ardour */
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -528,13 +600,13 @@ LaunchControlXL::button_track_mode(TrackMode state)
|
||||||
void
|
void
|
||||||
LaunchControlXL::button_select_left()
|
LaunchControlXL::button_select_left()
|
||||||
{
|
{
|
||||||
switch_bank (max (0, bank_start - (7 + (fader8master() ? 1 : 0))));
|
switch_bank (max (0, bank_start - (7 + (fader8master() ? 0 : 1))));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LaunchControlXL::button_select_right()
|
LaunchControlXL::button_select_right()
|
||||||
{
|
{
|
||||||
switch_bank (max (0, bank_start + 7 + (fader8master() ? 1 : 0)));
|
switch_bank (max (0, bank_start + 7 + (fader8master() ? 0 : 1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -558,7 +630,10 @@ LaunchControlXL::button_device()
|
||||||
void
|
void
|
||||||
LaunchControlXL::button_device_long_press()
|
LaunchControlXL::button_device_long_press()
|
||||||
{
|
{
|
||||||
|
solo_iso_led_bank();
|
||||||
|
#ifdef MIXBUS
|
||||||
|
master_send_led_bank();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
#include "ardour/midi_track.h"
|
#include "ardour/midi_track.h"
|
||||||
#include "ardour/midi_port.h"
|
#include "ardour/midi_port.h"
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.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_manager.h"
|
#include "ardour/vca_manager.h"
|
||||||
|
|
@ -70,6 +71,7 @@ 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)
|
||||||
|
, _refresh_leds_flag (false)
|
||||||
, bank_start (0)
|
, bank_start (0)
|
||||||
, connection_state (ConnectionState (0))
|
, connection_state (ConnectionState (0))
|
||||||
, gui (0)
|
, gui (0)
|
||||||
|
|
@ -427,6 +429,9 @@ LaunchControlXL::handle_button_message(Button* button, MIDI::EventTwoBytes* ev)
|
||||||
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()) {
|
||||||
|
switch_bank (bank_start);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
set<ButtonID>::iterator c = consumed.find(button->id());
|
set<ButtonID>::iterator c = consumed.find(button->id());
|
||||||
|
|
@ -853,13 +858,9 @@ LaunchControlXL::switch_bank (uint32_t base)
|
||||||
|
|
||||||
boost::shared_ptr<Stripable> s[8];
|
boost::shared_ptr<Stripable> s[8];
|
||||||
uint32_t different = 0;
|
uint32_t different = 0;
|
||||||
uint8_t stripable_counter;
|
|
||||||
|
|
||||||
if (fader8master ()) {
|
|
||||||
stripable_counter = 7;
|
int stripable_counter = get_amount_of_tracks();
|
||||||
} else {
|
|
||||||
stripable_counter = 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int n = 0; n < stripable_counter; ++n) {
|
for (int n = 0; n < stripable_counter; ++n) {
|
||||||
s[n] = session->get_remote_nth_stripable (base+n, PresentationInfo::Flag (PresentationInfo::Route|PresentationInfo::VCA));
|
s[n] = session->get_remote_nth_stripable (base+n, PresentationInfo::Flag (PresentationInfo::Route|PresentationInfo::VCA));
|
||||||
|
|
@ -898,6 +899,12 @@ LaunchControlXL::switch_bank (uint32_t base)
|
||||||
stripable[n]->presentation_info().PropertyChanged.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::stripable_property_change, this, _1, n), lcxl);
|
stripable[n]->presentation_info().PropertyChanged.connect (stripable_connections, MISSING_INVALIDATOR, 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]->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);
|
stripable[n]->mute_control()->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::mute_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
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
#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);
|
||||||
}
|
}
|
||||||
|
|
@ -942,6 +949,29 @@ LaunchControlXL::set_fader8master (bool yn)
|
||||||
_fader8master = yn;
|
_fader8master = yn;
|
||||||
if (_fader8master) {
|
if (_fader8master) {
|
||||||
stripable[7] = master;
|
stripable[7] = master;
|
||||||
|
bank_start -= 1;
|
||||||
|
} else {
|
||||||
|
bank_start += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_bank (bank_start);
|
switch_bank (bank_start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
LaunchControlXL::get_amount_of_tracks ()
|
||||||
|
{
|
||||||
|
int no_of_tracks;
|
||||||
|
if (fader8master ()) {
|
||||||
|
no_of_tracks = 7;
|
||||||
|
} else {
|
||||||
|
no_of_tracks = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
return no_of_tracks;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LaunchControlXL::set_refresh_leds_flag (bool yn)
|
||||||
|
{
|
||||||
|
_refresh_leds_flag = yn;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -336,6 +336,8 @@ public:
|
||||||
void *get_gui() const;
|
void *get_gui() const;
|
||||||
void tear_down_gui();
|
void tear_down_gui();
|
||||||
|
|
||||||
|
int get_amount_of_tracks();
|
||||||
|
|
||||||
int set_active(bool yn);
|
int set_active(bool yn);
|
||||||
XMLNode &get_state();
|
XMLNode &get_state();
|
||||||
int set_state(const XMLNode &node, int version);
|
int set_state(const XMLNode &node, int version);
|
||||||
|
|
@ -357,6 +359,9 @@ public:
|
||||||
void set_fader8master (bool yn);
|
void set_fader8master (bool yn);
|
||||||
bool fader8master () const { return _fader8master; }
|
bool fader8master () const { return _fader8master; }
|
||||||
|
|
||||||
|
void set_refresh_leds_flag (bool yn);
|
||||||
|
bool refresh_leds_flag () const { return _refresh_leds_flag; }
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
|
@ -368,6 +373,7 @@ private:
|
||||||
uint8_t _template_number;
|
uint8_t _template_number;
|
||||||
|
|
||||||
bool _fader8master;
|
bool _fader8master;
|
||||||
|
bool _refresh_leds_flag;
|
||||||
|
|
||||||
void do_request(LaunchControlRequest *);
|
void do_request(LaunchControlRequest *);
|
||||||
|
|
||||||
|
|
@ -514,6 +520,12 @@ 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 solo_iso_changed (uint32_t n);
|
||||||
|
void solo_iso_led_bank ();
|
||||||
|
#ifdef MIXBUS
|
||||||
|
void master_send_changed (uint32_t n);
|
||||||
|
void master_send_led_bank ();
|
||||||
|
#endif
|
||||||
void rec_changed (uint32_t n) { solo_mute_rec_changed(n); }
|
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);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue