MCP: failure to rebank for cases where num_routes < num_strips but we're not on bank 0
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 27 Apr 2012 20:35:45 +0000 (20:35 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 27 Apr 2012 20:35:45 +0000 (20:35 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@12112 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/surfaces/mackie/mackie_control_protocol.cc
libs/surfaces/mackie/mcp_buttons.cc

index a5bcefcb1785a1c98ffc69017261935fbb455ac8..85b92cbeabe72a8f6d676e8bbf59ea57f39e757e 100644 (file)
@@ -316,8 +316,10 @@ MackieControlProtocol::switch_banks (uint32_t initial, bool force)
        uint32_t strip_cnt = n_strips (false); // do not include locked strips
                                               // in this count
 
-       if (sorted.size() <= strip_cnt && !force) {
-               /* no banking - not enough routes to fill all strips */
+       if (sorted.size() <= strip_cnt && _current_initial_bank == 0 && !force) {
+               /* no banking - not enough routes to fill all strips and we're
+                * not at the first one.
+                */
                return;
        }
 
index f87e0fa4fd41b9202533c166395919705a18c31f..c864b5b87126ca2d6f19b80a03a1ba7b642fef79 100644 (file)
@@ -102,16 +102,13 @@ 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, route_cnt));
 
-       if (route_cnt && route_cnt > strip_cnt) {
-               if (_current_initial_bank > strip_cnt) {
-                       switch_banks (_current_initial_bank - strip_cnt);
-               } else {
-                       switch_banks (0);
-               }
-
-               return on;
+       if (_current_initial_bank > strip_cnt) {
+               switch_banks (_current_initial_bank - strip_cnt);
+       } else {
+               switch_banks (0);
        }
-       return off;
+
+       return on;
 }
 
 LedState 
@@ -128,15 +125,12 @@ MackieControlProtocol::right_press (Button &)
        uint32_t route_cnt = sorted.size();
 
        DEBUG_TRACE (DEBUG::MackieControl, string_compose ("bank right with current initial = %1 nstrips = %2 tracks/busses = %3\n",
-                                                          _current_initial_bank, strip_cnt, sorted.size()));
+                                                          _current_initial_bank, strip_cnt, route_cnt));
 
-       if (route_cnt && route_cnt > strip_cnt) {
-               uint32_t new_initial = std::min (_current_initial_bank + strip_cnt, route_cnt - 1);
-               switch_banks (new_initial);
-               return on;
-       }
+       uint32_t new_initial = std::min (_current_initial_bank + strip_cnt, route_cnt - 1);
+       switch_banks (new_initial);
 
-       return off;
+       return on;
 }
 
 LedState