From 20d38b1c25b9eaf3790ce148a74a0f708dabaa0c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 11 Apr 2012 16:21:23 +0000 Subject: [PATCH] MCP: make vpots control pan width + direction/position git-svn-id: svn://localhost/ardour2/branches/3.0@11904 d708f5d6-7413-0410-9779-e7cbd77b26cf --- .../surfaces/mackie/mackie_control_protocol.h | 13 +++++++------ libs/surfaces/mackie/strip.cc | 19 ++++++++++++++----- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h index a4b2c0adb2..c89bfa2c10 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.h +++ b/libs/surfaces/mackie/mackie_control_protocol.h @@ -83,6 +83,11 @@ class MackieControlProtocol , public AbstractUI { public: + static const int MODIFIER_OPTION; + static const int MODIFIER_CONTROL; + static const int MODIFIER_SHIFT; + static const int MODIFIER_CMDALT; + MackieControlProtocol(ARDOUR::Session &); virtual ~MackieControlProtocol(); @@ -279,6 +284,8 @@ class MackieControlProtocol ARDOUR::Session & get_session() { return *session; } void add_in_use_timeout (Mackie::Surface& surface, Mackie::Control& in_use_control, Mackie::Control* touch_control); + + int modifier_state(); protected: // shut down the surface @@ -363,12 +370,6 @@ class MackieControlProtocol bool _scrub_mode; bool _flip_mode; int _current_selected_track; - - static const int MODIFIER_OPTION; - static const int MODIFIER_CONTROL; - static const int MODIFIER_SHIFT; - static const int MODIFIER_CMDALT; - int _modifier_state; typedef std::list PortSources; diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc index ddc982aeb6..b8327b82c1 100644 --- a/libs/surfaces/mackie/strip.cc +++ b/libs/surfaces/mackie/strip.cc @@ -520,16 +520,25 @@ Strip::handle_pot (Pot& pot, ControlState& state) return; } - boost::shared_ptr panner = _route->panner_shell()->panner(); - // pan for mono input routes, or stereo linked panners - if (panner) { - double p = panner->position (); + boost::shared_ptr pannable = _route->pannable(); + + if (pannable) { + boost::shared_ptr ac; + + if (_surface->mcp().modifier_state() & MackieControlProtocol::MODIFIER_CONTROL) { + ac = pannable->pan_width_control; + } else { + ac = pannable->pan_azimuth_control; + } + + double p = ac->get_value(); // calculate new value, and adjust p += state.delta * state.sign; p = min (1.0, p); p = max (0.0, p); - panner->set_position (p); + + ac->set_value (p); } }