summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTérence Clastres <t.clastres@gmail.com>2018-08-19 18:38:42 +0200
committerTérence Clastres <t.clastres@gmail.com>2018-08-22 22:33:00 +0200
commit65cadf2cb65bab0c924a89a7df132fbec89f484a (patch)
tree1fb9e9b5192ab87c4b91d746c8211d36847a9e05
parent3f77c1245cb08551bf80fb0f2628bcb67cd82663 (diff)
LCXL: Make knobs' leds' color constant when controlling master bus
-rw-r--r--libs/surfaces/launch_control_xl/controllers.cc72
1 files changed, 39 insertions, 33 deletions
diff --git a/libs/surfaces/launch_control_xl/controllers.cc b/libs/surfaces/launch_control_xl/controllers.cc
index 92967ae36d..4dc1cdaa71 100644
--- a/libs/surfaces/launch_control_xl/controllers.cc
+++ b/libs/surfaces/launch_control_xl/controllers.cc
@@ -368,41 +368,47 @@ LaunchControlXL::update_knob_led(uint8_t n)
uint32_t absolute_strip_num = (n + bank_start) % 8;
- switch (absolute_strip_num) {
- case 0:
- case 4:
- if (stripable[n] && stripable[n]->is_selected()) {
- color = RedFull;
- } else {
- color = RedLow;
- }
- break;
+ if (stripable[n]) {
+ switch (absolute_strip_num) {
+ case 0:
+ case 4:
+ if (stripable[n]->is_selected()) {
+ color = RedFull;
+ } else {
+ color = RedLow;
+ }
+ break;
- case 1:
- case 5:
- if (stripable[n] && stripable[n]->is_selected()) {
- color = YellowFull;
- } else {
- color = YellowLow;
- }
- break;
+ case 1:
+ case 5:
+ if (stripable[n]->is_selected()) {
+ color = YellowFull;
+ } else {
+ color = YellowLow;
+ }
+ break;
- case 2:
- case 6:
- if (stripable[n] && stripable[n]->is_selected()) {
- color = GreenFull;
- } else {
- color = GreenLow;
- }
- break;
+ case 2:
+ case 6:
+ if (stripable[n]->is_selected()) {
+ color = GreenFull;
+ } else {
+ color = GreenLow;
+ }
+ break;
- case 3:
- case 7:
- if (stripable[n] && stripable[n]->is_selected()) {
- color = AmberFull;
- } else {
- color = AmberLow;
- }
+ case 3:
+ case 7:
+ if (stripable[n]->is_master()) {
+ color = RedFull;
+ } else {
+ if (stripable[n]->is_selected()) {
+ color = AmberFull;
+ } else {
+ color = AmberLow;
+ }
+ }
+ }
}
Knob* knobs_col[3];
@@ -440,7 +446,7 @@ LaunchControlXL::update_track_control_led(uint8_t n)
}
break;
case TrackSolo:
- if (ac && stripable[n] != master ) {
+ if (ac && !(stripable[n]->is_master())) {
if (ac->get_value()) {
b->set_color(GreenFull);
} else {