diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-01-31 13:16:22 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-01-31 13:20:18 -0500 |
commit | 69b4228176e37aac70e1928c2df76806a4b0598a (patch) | |
tree | ace4b9c7f9caa7f9dd6178e2b0aeac3044f434de | |
parent | da665a5dc5cc93724861361639f669fae5dc9889 (diff) |
mackie: partially working trackview submode.
More controls/pots to come
-rw-r--r-- | libs/surfaces/mackie/mackie_control_protocol.cc | 2 | ||||
-rw-r--r-- | libs/surfaces/mackie/strip.cc | 98 | ||||
-rw-r--r-- | libs/surfaces/mackie/strip.h | 1 |
3 files changed, 95 insertions, 6 deletions
diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index c111ddc4a5..29af02fa82 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -1808,7 +1808,7 @@ MackieControlProtocol::set_subview_mode (SubViewMode sm, boost::shared_ptr<Route update_global_button (Button::Pan, off); break; case MackieControlProtocol::TrackView: - update_global_button (Button::Send, on); + update_global_button (Button::Send, off); update_global_button (Button::Plugin, off); update_global_button (Button::Eq, off); update_global_button (Button::Dyn, off); diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc index d7f37da571..cc36224fd6 100644 --- a/libs/surfaces/mackie/strip.cc +++ b/libs/surfaces/mackie/strip.cc @@ -522,6 +522,39 @@ Strip::notify_send_level_change (AutomationType type, uint32_t send_num, bool fo } void +Strip::notify_trackview_change (AutomationType type, uint32_t send_num, bool force_update) +{ + boost::shared_ptr<Route> r = _surface->mcp().subview_route(); + + if (!r) { + /* not in subview mode */ + return; + } + + if (_surface->mcp().subview_mode() != MackieControlProtocol::TrackView) { + /* no longer in EQ subview mode */ + return; + } + + boost::shared_ptr<AutomationControl> control; + + switch (type) { + case TrimAutomation: + control = r->trim_control(); + break; + default: + break; + } + + if (control) { + float val = control->get_value(); + do_parameter_display (type, control->internal_to_interface (val)); + /* update pot/encoder */ + _surface->write (_vpot->set (control->internal_to_interface (val), true, Pot::wrap)); + } +} + +void Strip::notify_eq_change (AutomationType type, uint32_t band, bool force_update) { boost::shared_ptr<Route> r = _surface->mcp().subview_route(); @@ -1465,11 +1498,6 @@ Strip::subview_mode_changed () } void -Strip::setup_trackview_vpot (boost::shared_ptr<Route> r) -{ -} - -void Strip::setup_dyn_vpot (boost::shared_ptr<Route> r) { if (!r) { @@ -1715,6 +1743,66 @@ Strip::setup_sends_vpot (boost::shared_ptr<Route> r) } void +Strip::setup_trackview_vpot (boost::shared_ptr<Route> r) +{ + if (!r) { + return; + } + + const uint32_t global_pos = _surface->mcp().global_index (*this); + + if (global_pos >= 8) { + pending_display[0] = string(); + pending_display[1] = string(); + return; + } + + boost::shared_ptr<AutomationControl> pc; + string label; + + switch (global_pos) { + case 0: + pc = r->trim_control (); + label = "Trim"; + break; + case 1: + // pc = r->trim_control (); + break; + case 2: + // pc = r->trim_control (); + break; + case 3: + // pc = r->trim_control (); + break; + case 4: + //pc = r->trim_control (); + break; + case 5: + // pc = r->trim_control (); + break; + case 6: + // pc = r->trim_control (); + break; + case 7: + // pc = r->trim_control (); + break; + } + + if (!pc) { + pending_display[0] = string(); + pending_display[1] = string(); + return; + } + + pc->Changed.connect (subview_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_trackview_change, this, TrimAutomation, global_pos, false), ui_context()); + _vpot->set_control (pc); + + pending_display[0] = label; + + notify_trackview_change (TrimAutomation, global_pos, true); +} + +void Strip::set_vpot_parameter (AutomationType p) { if (!_route || (p == NullAutomation)) { diff --git a/libs/surfaces/mackie/strip.h b/libs/surfaces/mackie/strip.h index f1bf6d758d..b20f766bd6 100644 --- a/libs/surfaces/mackie/strip.h +++ b/libs/surfaces/mackie/strip.h @@ -178,6 +178,7 @@ private: void notify_send_level_change (ARDOUR::AutomationType, uint32_t band, bool force); void setup_sends_vpot (boost::shared_ptr<ARDOUR::Route>); + void notify_trackview_change (ARDOUR::AutomationType, uint32_t band, bool force); void setup_trackview_vpot (boost::shared_ptr<ARDOUR::Route>); }; |