Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <algorithm>
+
#include "pbd/memento_command.h"
#include "ardour/debug.h"
MackieControlProtocol::left_press (Button &)
{
Sorted sorted = get_sorted_routes();
- uint32_t strip_cnt = n_strips ();
+ uint32_t strip_cnt = n_strips ();
+ uint32_t route_cnt = sorted.size();
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()));
+ _current_initial_bank, strip_cnt, route_cnt));
- if (sorted.size() > strip_cnt) {
- int new_initial = _current_initial_bank - strip_cnt;
- if (new_initial < 0) {
- new_initial = 0;
- }
-
- if (new_initial != int (_current_initial_bank)) {
- switch_banks (new_initial);
- }
-
- return on;
+ if (_current_initial_bank > strip_cnt) {
+ switch_banks (_current_initial_bank - strip_cnt);
} else {
- return flashing;
+ switch_banks (0);
}
+
+ return on;
}
LedState
{
Sorted sorted = get_sorted_routes();
uint32_t strip_cnt = n_strips();
+ 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 (sorted.size() > strip_cnt) {
- uint32_t delta = sorted.size() - (strip_cnt + _current_initial_bank);
+ uint32_t new_initial = std::min (_current_initial_bank + strip_cnt, route_cnt - 1);
+ switch_banks (new_initial);
- if (delta > strip_cnt) {
- delta = strip_cnt;
- }
-
- if (delta > 0) {
- switch_banks (_current_initial_bank + delta);
- }
-
- return on;
- } else {
- return flashing;
- }
- return off;
+ return on;
}
LedState
} else {
VerticalZoomInAll (); /* EMIT SIGNAL */
}
+ } else {
+ StepTracksUp (); /* EMIT SIGNAL */
}
return off;
}
} else {
VerticalZoomOutAll (); /* EMIT SIGNAL */
}
+ } else {
+ StepTracksDown (); /* EMIT SIGNAL */
}
return off;
}
Mackie::LedState
MackieControlProtocol::scrub_press (Mackie::Button &)
{
- _scrub_mode = !_scrub_mode;
- return (_scrub_mode ? on : off);
+ if (!surfaces.empty()) {
+ surfaces.front()->next_jog_mode ();
+ }
+ return none;
}
Mackie::LedState
MackieControlProtocol::scrub_release (Mackie::Button &)
{
- return (_scrub_mode ? on : off);
+ return none;
}
LedState
again, jump back to where we started last time
*/
- transport_play (session->transport_rolling() == 1.0);
+ transport_play (session->transport_speed() == 1.0);
return none;
}
Mackie::LedState
MackieControlProtocol::read_press (Mackie::Button&)
{
- return none;
+ _metering_active = !_metering_active;
+ notify_metering_state_changed ();
+ return _metering_active;
}
Mackie::LedState
MackieControlProtocol::read_release (Mackie::Button&)
{
- return none;
+ return _metering_active;
}
Mackie::LedState
MackieControlProtocol::write_press (Mackie::Button&)