diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-04-15 15:43:25 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-04-15 15:43:25 +0000 |
commit | bef36b6f6593258796beb56a1e9387b3f315c73f (patch) | |
tree | e514bb2de8ef810c34dadf2e3f6e976c0c57b25e /libs | |
parent | 97c2832d350458d2da129954375cc9912584b1a5 (diff) |
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
Diffstat (limited to 'libs')
-rw-r--r-- | libs/surfaces/mackie/strip.cc | 19 |
1 files 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<AutomationControl> 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 { |