From bef36b6f6593258796beb56a1e9387b3f315c73f Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 15 Apr 2012 15:43:25 +0000 Subject: [PATCH] cmd-press on vpot should lock strip; shift-press resets pot param to default git-svn-id: svn://localhost/ardour2/branches/3.0@11980 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/surfaces/mackie/strip.cc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc index 48cc61cec9..a00a75dffd 100644 --- a/libs/surfaces/mackie/strip.cc +++ b/libs/surfaces/mackie/strip.cc @@ -362,25 +362,34 @@ Strip::handle_button (Button& button, ButtonState bs) } DEBUG_TRACE (DEBUG::MackieControl, string_compose ("strip %1 handling button %2 press ? %3\n", _index, button.bid(), (bs == press))); - - int lock_mod = (MackieControlProtocol::MODIFIER_CONTROL|MackieControlProtocol::MODIFIER_SHIFT); + int ms = _surface->mcp().modifier_state(); bool modified = (ms & MackieControlProtocol::MODIFIER_CONTROL); if (button.bid() == Button::Select) { - DEBUG_TRACE (DEBUG::MackieControl, string_compose ("select touch, lock ? %1\n", ((ms & lock_mod) == lock_mod) ? 1 : 0)); + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("select touch, modifiers %1\n", ms)); if (bs == press) { - if ((ms & lock_mod) == lock_mod) { + if (ms & MackieControlProtocol::MODIFIER_CMDALT) { _controls_locked = !_controls_locked; + _surface->write (display (1,_controls_locked ? "Locked" : "Unlock")); + queue_display_reset (1000); + return; + } + + if (ms & MackieControlProtocol::MODIFIER_SHIFT) { + /* reset to default */ + boost::shared_ptr ac = _vpot->control (modified); + if (ac) { + ac->set_value (ac->normal()); + } return; } DEBUG_TRACE (DEBUG::MackieControl, "add select button on press\n"); _surface->mcp().add_down_select_button (_surface->number(), _index); - _surface->mcp().select_range (); } else {