From c8ea24d2f4e06807f497d319b22bcee3c1c7100e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 11 Apr 2012 22:47:02 +0000 Subject: [PATCH] MCP: cursor left/right should scroll; maybe fix vpots git-svn-id: svn://localhost/ardour2/branches/3.0@11921 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/surfaces/mackie/mcp_buttons.cc | 28 +++++++++++++++++++++++++++- libs/surfaces/mackie/surface.cc | 3 ++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/libs/surfaces/mackie/mcp_buttons.cc b/libs/surfaces/mackie/mcp_buttons.cc index 6e8ad5f198..4954fda199 100644 --- a/libs/surfaces/mackie/mcp_buttons.cc +++ b/libs/surfaces/mackie/mcp_buttons.cc @@ -166,6 +166,19 @@ MackieControlProtocol::cursor_left_press (Button& ) } else { ZoomOut (); /* EMIT SIGNAL */ } + } else { + float page_fraction; + if (_modifier_state == MODIFIER_CONTROL) { + page_fraction = 1.0; + } else if (_modifier_state == MODIFIER_OPTION) { + page_fraction = 0.1; + } else if (_modifier_state == MODIFIER_SHIFT) { + page_fraction = 2.0; + } else { + page_fraction = 0.25; + } + + ScrollTimeline (page_fraction); } return off; @@ -187,8 +200,21 @@ MackieControlProtocol::cursor_right_press (Button& ) } else { ZoomIn (); /* EMIT SIGNAL */ } - } + } else { + float page_fraction; + if (_modifier_state == MODIFIER_CONTROL) { + page_fraction = 1.0; + } else if (_modifier_state == MODIFIER_OPTION) { + page_fraction = 0.1; + } else if (_modifier_state == MODIFIER_SHIFT) { + page_fraction = 2.0; + } else { + page_fraction = 0.25; + } + ScrollTimeline (page_fraction); + } + return off; } diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc index 157b781531..6210e37e7b 100644 --- a/libs/surfaces/mackie/surface.cc +++ b/libs/surfaces/mackie/surface.cc @@ -388,7 +388,7 @@ Surface::handle_midi_controller_message (MIDI::Parser &, MIDI::EventTwoBytes* ev { DEBUG_TRACE (DEBUG::MackieControl, string_compose ("SurfacePort::handle_midi_controller %1 = %2\n", (int) ev->controller_number, (int) ev->value)); - Pot* pot = pots[ev->controller_number]; + Pot* pot = pots[Pot::base_id + ev->controller_number]; if (!pot && ev->controller_number == Jog::base_id) { pot = dynamic_cast (controls_by_name["jog"]); @@ -417,6 +417,7 @@ Surface::handle_midi_controller_message (MIDI::Parser &, MIDI::EventTwoBytes* ev _mcp.add_in_use_timeout (*this, *pot, pot); Strip* strip = dynamic_cast (&pot->group()); + if (strip) { strip->handle_pot (*pot, delta); } else {