mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-03 20:29:35 +01:00
fixes issue where MCP controller strips got stranded switching banks
This commit fixes an issue where if your controller was currently on a bank not near the first few tracks, and you then deleted tracks, the controller bank buttons would appear unresponsive because of the "if (initial >= sorted.size())" check in switch_banks(). This would occur when the difference between the _initial_bank and whatever sorted.size() returns was greater than or equal to strip_cnt. For example, if your _initial_bank was 48, your strip_cnt was 24 and you had 24 tracks after the deletion, then the above conditional would evaluate to true and exit out of switch_banks BEFORE actually switching the bank, effectively stranding the controller unless you added enough tracks back.
This commit is contained in:
parent
e89d85f776
commit
643342995d
1 changed files with 7 additions and 1 deletions
|
|
@ -111,8 +111,14 @@ MackieControlProtocol::left_press (Button &)
|
|||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("bank left with current initial = %1 nstrips = %2 tracks/busses = %3\n",
|
||||
_current_initial_bank, strip_cnt, sorted.size()));
|
||||
|
||||
if (_current_initial_bank > 0) {
|
||||
(void) switch_banks ((_current_initial_bank - 1) / strip_cnt * strip_cnt);
|
||||
uint32_t initial = (_current_initial_bank - 1) / strip_cnt * strip_cnt;
|
||||
while (initial >= sorted.size())
|
||||
{
|
||||
initial -= strip_cnt;
|
||||
}
|
||||
(void) switch_banks (initial);
|
||||
} else {
|
||||
(void) switch_banks (0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue