From 69b4228176e37aac70e1928c2df76806a4b0598a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 31 Jan 2016 13:16:22 -0500 Subject: mackie: partially working trackview submode. More controls/pots to come --- libs/surfaces/mackie/mackie_control_protocol.cc | 2 +- libs/surfaces/mackie/strip.cc | 98 +++++++++++++++++++++++-- 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 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 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) { @@ -1464,11 +1497,6 @@ Strip::subview_mode_changed () } } -void -Strip::setup_trackview_vpot (boost::shared_ptr r) -{ -} - void Strip::setup_dyn_vpot (boost::shared_ptr r) { @@ -1714,6 +1742,66 @@ Strip::setup_sends_vpot (boost::shared_ptr r) notify_send_level_change (BusSendLevel, global_pos, true); } +void +Strip::setup_trackview_vpot (boost::shared_ptr 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 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) { 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); + void notify_trackview_change (ARDOUR::AutomationType, uint32_t band, bool force); void setup_trackview_vpot (boost::shared_ptr); }; -- cgit v1.2.3