From c59dddfdaea789ed3b30ffdabff3034eabe57240 Mon Sep 17 00:00:00 2001 From: Franke Burgarino Date: Fri, 8 Aug 2025 16:57:24 -0500 Subject: [PATCH] MCU: add scrolling in eq subview --- libs/surfaces/mackie/subview.cc | 28 +++++++++++++++++++++++++--- libs/surfaces/mackie/subview.h | 4 ++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/libs/surfaces/mackie/subview.cc b/libs/surfaces/mackie/subview.cc index f5e0ffc271..a9eb36324d 100644 --- a/libs/surfaces/mackie/subview.cc +++ b/libs/surfaces/mackie/subview.cc @@ -278,6 +278,7 @@ void NoneSubview::setup_vpot( EQSubview::EQSubview(MackieControlProtocol& mcp, std::shared_ptr subview_stripable) : Subview(mcp, subview_stripable) + , _current_bank(0) {} EQSubview::~EQSubview() @@ -308,8 +309,8 @@ void EQSubview::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; @@ -414,7 +415,7 @@ void EQSubview::notify_change (std::weak_ptr pc, uint 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; } @@ -428,6 +429,27 @@ void EQSubview::notify_change (std::weak_ptr pc, uint } } +bool EQSubview::handle_cursor_left_press() +{ + if (_current_bank >= 1) + { + _current_bank -= 1; + mcp().redisplay_subview_mode(); + } + + return true; +} + +bool EQSubview::handle_cursor_right_press() +{ + if (/* todo: generate this value on redisplay */ 14 > _current_bank + 1) { + _current_bank += 1; + mcp().redisplay_subview_mode(); + } + + return true; +} + DynamicsSubview::DynamicsSubview(MackieControlProtocol& mcp, std::shared_ptr subview_stripable) diff --git a/libs/surfaces/mackie/subview.h b/libs/surfaces/mackie/subview.h index 4b0a1987ee..25ea4511b8 100644 --- a/libs/surfaces/mackie/subview.h +++ b/libs/surfaces/mackie/subview.h @@ -127,6 +127,10 @@ class EQSubview : public Subview { Pot* vpot, std::string pending_display[2]); void notify_change (std::weak_ptr, uint32_t global_strip_position, bool force); + virtual bool handle_cursor_left_press(); + virtual bool handle_cursor_right_press(); + protected: + uint32_t _current_bank; }; class DynamicsSubview : public Subview {