From 17a7dbe06dd94822a809fe047c185717e1f2e577 Mon Sep 17 00:00:00 2001 From: Caleb Potter Date: Fri, 8 Apr 2022 12:42:41 -0500 Subject: [PATCH] adds ability to bank over in mackie sends subview The cursor_left and cursor_right mackie control buttons will now move the sends subview left and right like it does in the plugin subview. Previously, if you had more than 8 sends (which is almost always the case for Mixbus), then sends 9+ were unreachable on an 8 channel controller. --- libs/surfaces/mackie/subview.cc | 24 +++++++++++++++++++++--- libs/surfaces/mackie/subview.h | 5 +++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/libs/surfaces/mackie/subview.cc b/libs/surfaces/mackie/subview.cc index 9335c09df0..5c7e15718b 100644 --- a/libs/surfaces/mackie/subview.cc +++ b/libs/surfaces/mackie/subview.cc @@ -584,6 +584,7 @@ DynamicsSubview::notify_change (boost::weak_ptr pc, u SendsSubview::SendsSubview(MackieControlProtocol& mcp, boost::shared_ptr subview_stripable) : Subview(mcp, subview_stripable) + , _current_bank(0) {} SendsSubview::~SendsSubview() @@ -614,8 +615,8 @@ void SendsSubview::setup_vpot( Pot* vpot, std::string pending_display[2]) { - const uint32_t global_strip_position = _mcp.global_index (*strip); - store_pointers(strip, vpot, pending_display, global_strip_position); + const uint32_t global_strip_position = _mcp.global_index (*strip) + _current_bank; + store_pointers(strip, vpot, pending_display, global_strip_position - _current_bank); if (!_subview_stripable) { return; @@ -649,7 +650,7 @@ SendsSubview::notify_send_level_change (uint32_t global_strip_position, bool for Strip* strip = 0; Pot* vpot = 0; std::string* pending_display = 0; - if (!retrieve_pointers(&strip, &vpot, &pending_display, global_strip_position)) + if (!retrieve_pointers(&strip, &vpot, &pending_display, global_strip_position - _current_bank)) { return; } @@ -717,6 +718,23 @@ void SendsSubview::handle_vselect_event(uint32_t global_strip_position) } } +bool SendsSubview::handle_cursor_left_press() +{ + if (_current_bank >= 1) + { + _current_bank -= 1; + } + mcp().redisplay_subview_mode(); + + return true; +} + +bool SendsSubview::handle_cursor_right_press() +{ + _current_bank += 1; + mcp().redisplay_subview_mode(); + return true; +} TrackViewSubview::TrackViewSubview(MackieControlProtocol& mcp, boost::shared_ptr subview_stripable) diff --git a/libs/surfaces/mackie/subview.h b/libs/surfaces/mackie/subview.h index 364d0abb8d..b055b89b5c 100644 --- a/libs/surfaces/mackie/subview.h +++ b/libs/surfaces/mackie/subview.h @@ -163,6 +163,11 @@ class SendsSubview : public Subview { void notify_send_level_change (uint32_t global_strip_position, bool force); virtual void handle_vselect_event(uint32_t global_strip_position); + virtual bool handle_cursor_right_press(); + virtual bool handle_cursor_left_press(); + protected: + uint32_t _current_bank; + }; class TrackViewSubview : public Subview {