From e52c8e376a068c11a9a771a15977a65c067c71e6 Mon Sep 17 00:00:00 2001 From: Jan Lentfer Date: Sat, 22 Sep 2018 11:10:45 +0200 Subject: [PATCH] LCXL: fix off by one cause by fader8master --- libs/surfaces/launch_control_xl/launch_control_xl.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libs/surfaces/launch_control_xl/launch_control_xl.cc b/libs/surfaces/launch_control_xl/launch_control_xl.cc index 15bd40580b..c220c3f6dc 100644 --- a/libs/surfaces/launch_control_xl/launch_control_xl.cc +++ b/libs/surfaces/launch_control_xl/launch_control_xl.cc @@ -152,7 +152,9 @@ LaunchControlXL::begin_using_device () in_use = true; DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose("fader8master inital value '%1'\n", fader8master())); - set_fader8master (fader8master()); + if (fader8master()) { + set_fader8master (fader8master()); + } return 0; } @@ -951,9 +953,13 @@ LaunchControlXL::set_fader8master (bool yn) _fader8master = yn; if (_fader8master) { stripable[7] = master; - bank_start -= 1; + if (bank_start > 0) { + bank_start -= 1; + } } else { - bank_start += 1; + if (bank_start > 0) { + bank_start += 1; + } } switch_bank (bank_start);