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 {