summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorTérence Clastres <t.clastres@gmail.com>2018-08-09 22:13:14 +0200
committerTérence Clastres <t.clastres@gmail.com>2018-08-09 22:13:14 +0200
commit740e075803886fe12c3662a28ba596844efb4446 (patch)
tree85e494ee496b36505f8bdfab85608ad6e170effb /libs/surfaces
parent5276a9941be3a841c6842a36f1e68c10d9454563 (diff)
Turn off button led if it doesn't control a stripable
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/launch_control_xl/controllers.cc34
-rw-r--r--libs/surfaces/launch_control_xl/launch_control_xl.cc6
2 files changed, 19 insertions, 21 deletions
diff --git a/libs/surfaces/launch_control_xl/controllers.cc b/libs/surfaces/launch_control_xl/controllers.cc
index 7729d0589f..de9e0aa416 100644
--- a/libs/surfaces/launch_control_xl/controllers.cc
+++ b/libs/surfaces/launch_control_xl/controllers.cc
@@ -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]->is_selected() ) {
- b->set_color(AmberFull);
+ if (stripable[n]) {
+ if ( stripable[n]->is_selected() ) {
+ b->set_color(AmberFull);
+ } else {
+ b->set_color(AmberLow);
+ }
} else {
- b->set_color(AmberLow);
+ b->set_color(Off);
}
- write (b->state_msg());
+ write (b->state_msg());
}
boost::shared_ptr<AutomationControl>
@@ -330,12 +330,12 @@ LaunchControlXL::update_track_control_led(uint8_t n)
{
TrackButton* b = control_button_by_number(n);
- if (!stripable[n] || !b) {
+ if (!b) {
return;
}
- boost::shared_ptr<AutomationControl> ac = get_ac_by_state(n);
-
+ if (stripable[n]) {
+ boost::shared_ptr<AutomationControl> ac = get_ac_by_state(n);
switch(track_mode()) {
case TrackMute:
@@ -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
diff --git a/libs/surfaces/launch_control_xl/launch_control_xl.cc b/libs/surfaces/launch_control_xl/launch_control_xl.cc
index 699e7a84b5..0881d0647e 100644
--- a/libs/surfaces/launch_control_xl/launch_control_xl.cc
+++ b/libs/surfaces/launch_control_xl/launch_control_xl.cc
@@ -863,11 +863,9 @@ 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());
}
+ button_track_focus(n);
+ button_track_mode(track_mode());
}
}