From e3710bd0a2a5c61a5607b755720b372d420ee2db Mon Sep 17 00:00:00 2001 From: Franke Burgarino Date: Thu, 7 Aug 2025 16:16:19 -0500 Subject: [PATCH] MCU: allow scrolling to gate controls in the dynamics subview --- libs/surfaces/mackie/subview.cc | 31 +++++++++++++++++++++++++++---- libs/surfaces/mackie/subview.h | 5 +++++ 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/libs/surfaces/mackie/subview.cc b/libs/surfaces/mackie/subview.cc index a4f8b82ac4..7398f2db7f 100644 --- a/libs/surfaces/mackie/subview.cc +++ b/libs/surfaces/mackie/subview.cc @@ -420,6 +420,7 @@ void EQSubview::notify_change (std::weak_ptr pc, uint DynamicsSubview::DynamicsSubview(MackieControlProtocol& mcp, std::shared_ptr subview_stripable) : Subview(mcp, subview_stripable) + , _current_bank(0) {} DynamicsSubview::~DynamicsSubview() @@ -450,13 +451,15 @@ void DynamicsSubview::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; } + available.clear(); + std::shared_ptr hpfc = _subview_stripable->mapped_control (HPF_Freq); std::shared_ptr lpfc = _subview_stripable->mapped_control (LPF_Freq); std::shared_ptr fec = _subview_stripable->mapped_control (HPF_Enable); // shared HP/LP @@ -478,7 +481,6 @@ void DynamicsSubview::setup_vpot( * order shown above. */ - std::vector, std::string > > available; std::vector params; //Mixbus32C needs to spill the filter controls into the comp section @@ -535,7 +537,7 @@ DynamicsSubview::notify_change (std::weak_ptr pc, uin 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; } @@ -556,6 +558,27 @@ DynamicsSubview::notify_change (std::weak_ptr pc, uin } } +bool DynamicsSubview::handle_cursor_left_press() +{ + if (_current_bank >= 1) + { + _current_bank -= 1; + mcp().redisplay_subview_mode(); + } + + return true; +} + +bool DynamicsSubview::handle_cursor_right_press() +{ + if (available.size() > _current_bank + 1) { + _current_bank += 1; + mcp().redisplay_subview_mode(); + } + + return true; +} + SendsSubview::SendsSubview(MackieControlProtocol& mcp, std::shared_ptr subview_stripable) diff --git a/libs/surfaces/mackie/subview.h b/libs/surfaces/mackie/subview.h index 5a5135cd82..4b0a1987ee 100644 --- a/libs/surfaces/mackie/subview.h +++ b/libs/surfaces/mackie/subview.h @@ -142,6 +142,11 @@ class DynamicsSubview : public Subview { Pot* vpot, std::string pending_display[2]); void notify_change (std::weak_ptr, uint32_t global_strip_position, bool force, bool propagate_mode_change); + virtual bool handle_cursor_left_press(); + virtual bool handle_cursor_right_press(); + protected: + uint32_t _current_bank; + std::vector, std::string>> available; }; class SendsSubview : public Subview {