Turn off button led if it doesn't control a stripable

This commit is contained in:
Térence Clastres 2018-08-09 22:13:14 +02:00
parent 5276a9941b
commit 740e075803
2 changed files with 19 additions and 21 deletions

View file

@ -282,23 +282,23 @@ LaunchControlXL::track_button_by_number(uint8_t n, uint8_t first, uint8_t middle
void
LaunchControlXL::button_track_focus(uint8_t n)
{
if (!stripable[n]) {
return;
}
TrackButton* b = focus_button_by_number(n);
if (b == 0) {
if (!b) {
return;
}
if (stripable[n]) {
if ( stripable[n]->is_selected() ) {
b->set_color(AmberFull);
} else {
b->set_color(AmberLow);
}
write (b->state_msg());
} else {
b->set_color(Off);
}
write (b->state_msg());
}
boost::shared_ptr<AutomationControl>
@ -330,13 +330,13 @@ LaunchControlXL::update_track_control_led(uint8_t n)
{
TrackButton* b = control_button_by_number(n);
if (!stripable[n] || !b) {
if (!b) {
return;
}
if (stripable[n]) {
boost::shared_ptr<AutomationControl> ac = get_ac_by_state(n);
switch(track_mode()) {
case TrackMute:
if (ac->get_value()) {
@ -345,7 +345,6 @@ LaunchControlXL::update_track_control_led(uint8_t n)
b->set_color(AmberLow);
}
break;
case TrackSolo:
if (ac && stripable[n] != master ) {
if (ac->get_value()) {
@ -357,7 +356,6 @@ LaunchControlXL::update_track_control_led(uint8_t n)
b->set_color(Off);
}
break;
case TrackRecord:
if (ac) {
if (ac->get_value()) {
@ -373,9 +371,11 @@ LaunchControlXL::update_track_control_led(uint8_t n)
default:
break;
}
if (ac) {
write (b->state_msg());
} else {
b->set_color(Off);
}
write (b->state_msg());
}
void

View file

@ -863,12 +863,10 @@ LaunchControlXL::switch_bank (uint32_t base)
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);
}
}
button_track_focus(n);
button_track_mode(track_mode());
}
}
}
void