diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-12-11 11:05:57 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-12-16 05:54:43 -0500 |
commit | 8ba8f1c0b08bb1c8ffbb4f419806e0c05619808b (patch) | |
tree | bdcf66336561a365b8a37be41eac62ce06481f40 /libs/surfaces | |
parent | e302ce8662fb38a791d5c19da14fbce560bcbff2 (diff) |
fix cherry-pick conflict
Diffstat (limited to 'libs/surfaces')
-rw-r--r-- | libs/surfaces/mackie/mackie_control_protocol.cc | 43 | ||||
-rw-r--r-- | libs/surfaces/mackie/mackie_control_protocol.h | 10 | ||||
-rw-r--r-- | libs/surfaces/mackie/mcp_buttons.cc | 20 | ||||
-rw-r--r-- | libs/surfaces/mackie/strip.cc | 337 | ||||
-rw-r--r-- | libs/surfaces/mackie/strip.h | 13 | ||||
-rw-r--r-- | libs/surfaces/mackie/surface.cc | 37 | ||||
-rw-r--r-- | libs/surfaces/mackie/surface.h | 1 |
7 files changed, 370 insertions, 91 deletions
diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 4b1ae1e4ed..c6263ef9bf 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -113,6 +113,7 @@ MackieControlProtocol::MackieControlProtocol (Session& session) , _scrub_mode (false) , _flip_mode (Normal) , _view_mode (Mixer) + , _subview_mode (None) , _pot_mode (Pan) , _current_selected_track (-1) , _modifier_state (0) @@ -357,12 +358,6 @@ MackieControlProtocol::get_sorted_routes() remote_ids.insert (route->remote_control_id()); } break; - case Dynamics: - /* display shows a single route */ - break; - case EQ: - /* display shows a single route */ - break; } } @@ -1518,8 +1513,6 @@ MackieControlProtocol::handle_button_event (Surface& surface, Button& button, Bu if (!action.empty()) { - std::cerr << "Button has action: " << action << std::endl; - if (action.find ('/') != string::npos) { /* good chance that this is really an action */ DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Looked up action for button %1 with modifier %2, got [%3]\n", @@ -1629,11 +1622,19 @@ MackieControlProtocol::clear_ports () } void +MackieControlProtocol::set_subview_mode (SubViewMode sm) +{ + _subview_mode = sm; + display_view_mode (); +} + +void MackieControlProtocol::set_view_mode (ViewMode m) { _last_bank[_view_mode] = _current_initial_bank; _view_mode = m; + _subview_mode = None; switch_banks(_last_bank[_view_mode], true); } @@ -1641,12 +1642,22 @@ MackieControlProtocol::set_view_mode (ViewMode m) void MackieControlProtocol::display_view_mode () { - Glib::Threads::Mutex::Lock lm (surfaces_lock); + { + Glib::Threads::Mutex::Lock lm (surfaces_lock); - for (Surfaces::iterator s = surfaces.begin(); s != surfaces.end(); ++s) { - (*s)->update_view_mode_display (); + for (Surfaces::iterator s = surfaces.begin(); s != surfaces.end(); ++s) { + (*s)->update_view_mode_display (); + } } + /* turn buttons related to vpot mode on or off as required */ + if (_subview_mode != None) { + update_global_button (Button::Trim, off); + update_global_button (Button::Send, off); + update_global_button (Button::Pan, off); + } else { + pot_mode_globals (); + } } void @@ -1676,6 +1687,7 @@ MackieControlProtocol::set_pot_mode (PotMode m) if (flip_mode()) { return; } + _pot_mode = m; { @@ -1687,6 +1699,15 @@ MackieControlProtocol::set_pot_mode (PotMode m) } } + pot_mode_globals (); +} + +void +MackieControlProtocol::pot_mode_globals () +{ + update_global_button (Button::Eq, off); + update_global_button (Button::Dyn, off); + switch (_pot_mode) { case Trim: update_global_button (Button::Track, on); diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h index 0239529cf2..a5ec5da4d1 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.h +++ b/libs/surfaces/mackie/mackie_control_protocol.h @@ -109,8 +109,12 @@ class MackieControlProtocol Auxes, Selected, Plugins, - Dynamics, + }; + + enum SubViewMode { + None, EQ, + Dynamics, }; enum PotMode { @@ -145,6 +149,7 @@ class MackieControlProtocol FlipMode flip_mode () const { return _flip_mode; } ViewMode view_mode () const { return _view_mode; } + SubViewMode subview_mode () const { return _subview_mode; } PotMode pot_mode () const { return _pot_mode; } bool zoom_mode () const { return modifier_state() & MODIFIER_ZOOM; } bool metering_active () const { return _metering_active; } @@ -155,8 +160,10 @@ class MackieControlProtocol bool selected (boost::shared_ptr<ARDOUR::Route>) const; void set_view_mode (ViewMode); + void set_subview_mode (SubViewMode); void set_flip_mode (FlipMode); void set_pot_mode (PotMode); + void pot_mode_globals (); void display_view_mode (); XMLNode& get_state (); @@ -322,6 +329,7 @@ class MackieControlProtocol bool _scrub_mode; FlipMode _flip_mode; ViewMode _view_mode; + SubViewMode _subview_mode; PotMode _pot_mode; int _current_selected_track; int _modifier_state; diff --git a/libs/surfaces/mackie/mcp_buttons.cc b/libs/surfaces/mackie/mcp_buttons.cc index ab428c08d7..e92b8e8a75 100644 --- a/libs/surfaces/mackie/mcp_buttons.cc +++ b/libs/surfaces/mackie/mcp_buttons.cc @@ -22,6 +22,7 @@ #include "pbd/memento_command.h" #include "ardour/debug.h" +#include "ardour/profile.h" #include "ardour/session.h" #include "ardour/route.h" #include "ardour/location.h" @@ -688,9 +689,14 @@ MackieControlProtocol::plugin_release (Button &) LedState MackieControlProtocol::eq_press (Button &) { - //set_view_mode (EQ); - // not implemented yet, turn off (see comments for send button) - return off; + if (Profile->get_mixbus()) { + if (_last_selected_routes.size() == 1) { + set_subview_mode (EQ); + return on; + } + } + return none; + } LedState MackieControlProtocol::eq_release (Button &) @@ -700,9 +706,11 @@ MackieControlProtocol::eq_release (Button &) LedState MackieControlProtocol::dyn_press (Button &) { - //set_view_mode (Dynamics); - // same as send - return off; + if (Profile->get_mixbus()) { + set_subview_mode (Dynamics); + return on; + } + return none; } LedState MackieControlProtocol::dyn_release (Button &) diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc index 95444d375e..be3d622213 100644 --- a/libs/surfaces/mackie/strip.cc +++ b/libs/surfaces/mackie/strip.cc @@ -99,6 +99,7 @@ Strip::Strip (Surface& s, const std::string& name, int index, const map<Button:: , _block_screen_redisplay_until (0) , _pan_mode (PanAzimuthAutomation) , _trim_mode (TrimAutomation) + , vpot_parameter (PanAzimuthAutomation) , _last_gain_position_written (-1.0) , _last_pan_azi_position_written (-1.0) , _last_pan_width_position_written (-1.0) @@ -192,6 +193,14 @@ Strip::set_route (boost::shared_ptr<Route> r, bool /*with_messages*/) control_by_parameter[TrimAutomation] = (Control*) 0; control_by_parameter[PhaseAutomation] = (Control*) 0; control_by_parameter[SendAutomation] = (Control*) 0; + control_by_parameter[EQParam1] = (Control*) 0; + control_by_parameter[EQParam2] = (Control*) 0; + control_by_parameter[EQParam3] = (Control*) 0; + control_by_parameter[EQParam4] = (Control*) 0; + control_by_parameter[EQParam5] = (Control*) 0; + control_by_parameter[EQParam6] = (Control*) 0; + control_by_parameter[EQParam7] = (Control*) 0; + control_by_parameter[EQParam8] = (Control*) 0; reset_saved_values (); @@ -522,19 +531,71 @@ Strip::notify_property_changed (const PropertyChange& what_changed) void Strip::show_route_name () { - if (!_route) { + MackieControlProtocol::SubViewMode svm = _surface->mcp().subview_mode(); + + if (svm == MackieControlProtocol::None) { + if (!_route) { + return; + } + string line1; + string fullname = _route->name(); + + if (fullname.length() <= 6) { + line1 = fullname; + } else { + line1 = PBD::short_version (fullname, 6); + } + + _surface->write (display (0, line1)); + + } else if (svm == MackieControlProtocol::EQ) { + if (_vpot == control_by_parameter[EQParam1]) { + _surface->write (display (0, "HiFreq")); + } else if (_vpot == control_by_parameter[EQParam2]) { + _surface->write (display (0, "HiGain")); + } else if (_vpot == control_by_parameter[EQParam3]) { + _surface->write (display (0, "MidFreq")); + } else if (_vpot == control_by_parameter[EQParam4]) { + _surface->write (display (0, "MidGain")); + } else if (_vpot == control_by_parameter[EQParam5]) { + _surface->write (display (0, "LoFreq")); + } else if (_vpot == control_by_parameter[EQParam6]) { + _surface->write (display (0, "LoGain")); + } else if (_vpot == control_by_parameter[EQParam7]) { + _surface->write (display (0, "HPFreq")); + } else if (_vpot == control_by_parameter[EQParam8]) { + _surface->write (display (0, "In/Out")); + } + } else if (svm == MackieControlProtocol::Dynamics) { + + } + +} + +void +Strip::notify_eq_change (AutomationType p, uint32_t port_number, bool force_update) +{ + if (!_subview_route) { + /* no longer in EQ subview mode */ return; } - string line1; - string fullname = _route->name(); - if (fullname.length() <= 6) { - line1 = fullname; - } else { - line1 = PBD::short_version (fullname, 6); + if (_vpot != control_by_parameter[p]) { + /* vpot is no longer controlling this EQ parameter */ + return; } - _surface->write (display (0, line1)); + boost::shared_ptr<PluginInsert> eq = _subview_route->ch_eq(); + + if (eq) { + boost::shared_ptr<AutomationControl> control = boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (eq->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, port_number))); + + if (control) { + float val = control->get_value(); + queue_parameter_display (p, val); + _surface->write (_vpot->set (control->internal_to_interface (val), true, Pot::wrap)); + } + } } void @@ -801,13 +862,13 @@ void Strip::do_parameter_display (AutomationType type, float val) { bool screen_hold = false; + char buf[16]; switch (type) { case GainAutomation: if (val == 0.0) { _surface->write (display (1, " -inf ")); } else { - char buf[16]; float dB = accurate_coefficient_to_dB (val); snprintf (buf, sizeof (buf), "%6.1f", dB); _surface->write (display (1, buf)); @@ -816,26 +877,24 @@ Strip::do_parameter_display (AutomationType type, float val) break; case PanAzimuthAutomation: -if (Profile->get_mixbus()) { - char buf[16]; - snprintf (buf, sizeof (buf), "%2.1f", val); - _surface->write (display (1, buf)); - screen_hold = true; -} else { - if (_route) { - boost::shared_ptr<Pannable> p = _route->pannable(); - if (p && _route->panner()) { - string str =_route->panner()->value_as_string (p->pan_azimuth_control); - _surface->write (display (1, str)); - screen_hold = true; + if (Profile->get_mixbus()) { + snprintf (buf, sizeof (buf), "%2.1f", val); + _surface->write (display (1, buf)); + screen_hold = true; + } else { + if (_route) { + boost::shared_ptr<Pannable> p = _route->pannable(); + if (p && _route->panner()) { + string str =_route->panner()->value_as_string (p->pan_azimuth_control); + _surface->write (display (1, str)); + screen_hold = true; + } } } -} break; case PanWidthAutomation: if (_route) { - char buf[16]; snprintf (buf, sizeof (buf), "%5ld%%", lrintf ((val * 200.0)-100)); _surface->write (display (1, buf)); screen_hold = true; @@ -844,7 +903,6 @@ if (Profile->get_mixbus()) { case TrimAutomation: if (_route) { - char buf[16]; float dB = accurate_coefficient_to_dB (val); snprintf (buf, sizeof (buf), "%6.1f", dB); _surface->write (display (1, buf)); @@ -867,14 +925,23 @@ if (Profile->get_mixbus()) { if (val == 0.0) { _surface->write (display (1, " -inf ")); } else { - char buf[16]; float dB = accurate_coefficient_to_dB (val); snprintf (buf, sizeof (buf), "%6.1f", dB); _surface->write (display (1, buf)); screen_hold = true; } break; - + case EQParam1: + case EQParam2: + case EQParam3: + case EQParam4: + case EQParam5: + case EQParam6: + case EQParam7: + case EQParam8: + snprintf (buf, sizeof (buf), "%6.1f", val); + _surface->write (display (1, buf)); + screen_hold = true; default: break; } @@ -1164,6 +1231,10 @@ Strip::vpot_mode_string () return "LFE"; } + if (_subview_route) { + return string(); + } + return "???"; } @@ -1216,8 +1287,10 @@ Strip::return_to_vpot_mode_display () /* returns the second line of the two-line per-strip display back the mode where it shows what the VPot controls. */ - - if (_route) { + if (_subview_route) { + /* do nothing - second line shows value of current subview parameter */ + return; + } else if (_route) { _surface->write (display (1, vpot_mode_string())); } else { _surface->write (blank_display (1)); @@ -1314,7 +1387,55 @@ Strip::next_pot_mode () } void -Strip::set_vpot_parameter (Evoral::Parameter p) +Strip::use_subview (MackieControlProtocol::SubViewMode sm, boost::shared_ptr<Route> target_route) +{ + if (!_route) { + return; + } + + switch (sm) { + case MackieControlProtocol::None: + if (vpot_parameter != NullAutomation) { + set_vpot_parameter (vpot_parameter); + } + break; + + case MackieControlProtocol::EQ: + switch (_index) { + case 0: + set_vpot_parameter (ARDOUR::EQParam1, target_route); + break; + case 1: + set_vpot_parameter (ARDOUR::EQParam2, target_route); + break; + case 2: + set_vpot_parameter (ARDOUR::EQParam3, target_route); + break; + case 3: + set_vpot_parameter (ARDOUR::EQParam4, target_route); + break; + case 4: + set_vpot_parameter (ARDOUR::EQParam5, target_route); + break; + case 5: + set_vpot_parameter (ARDOUR::EQParam6, target_route); + break; + case 6: + set_vpot_parameter (ARDOUR::EQParam7, target_route); + break; + case 7: + set_vpot_parameter (ARDOUR::EQParam8, target_route); + break; + } + break; + + case MackieControlProtocol::Dynamics: + break; + } +} + +void +Strip::set_vpot_parameter (Evoral::Parameter p, boost::shared_ptr<Route> target_route) { boost::shared_ptr<Pannable> pannable; @@ -1322,6 +1443,17 @@ Strip::set_vpot_parameter (Evoral::Parameter p) reset_saved_values (); + /* target route is either null, or points to a route other than the one + we are controlling/viewing, to be used while in a particular subview + state (e.g. EQ or Dynamics) + */ + + if (target_route != _subview_route) { + subview_connections.drop_connections (); + } + + _subview_route = target_route; + /* unset any mapping between the vpot and any existing parameters */ for (ControlParameterMap::iterator i = control_by_parameter.begin(); i != control_by_parameter.end(); ++i) { @@ -1335,6 +1467,7 @@ Strip::set_vpot_parameter (Evoral::Parameter p) case PanAzimuthAutomation: _pan_mode = PanAzimuthAutomation; pannable = _route->pannable (); + vpot_parameter = PanAzimuthAutomation; if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) { /* gain to vpot, pan azi to fader */ _vpot->set_control (_route->group_gain_control()); @@ -1362,6 +1495,7 @@ Strip::set_vpot_parameter (Evoral::Parameter p) case PanWidthAutomation: _pan_mode = PanWidthAutomation; pannable = _route->pannable (); + vpot_parameter = PanWidthAutomation; if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) { /* gain to vpot, pan width to fader */ _vpot->set_control (_route->group_gain_control()); @@ -1394,6 +1528,7 @@ Strip::set_vpot_parameter (Evoral::Parameter p) break; case TrimAutomation: _trim_mode = TrimAutomation; + vpot_parameter = TrimAutomation; if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) { /* gain to vpot, trim to fader */ _vpot->set_control (_route->group_gain_control()); @@ -1420,6 +1555,7 @@ Strip::set_vpot_parameter (Evoral::Parameter p) break; case PhaseAutomation: _trim_mode = PhaseAutomation; + vpot_parameter = PhaseAutomation; if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) { /* gain to vpot, phase to fader */ _vpot->set_control (_route->group_gain_control()); @@ -1445,43 +1581,98 @@ Strip::set_vpot_parameter (Evoral::Parameter p) } break; case SendAutomation: - if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) { - // gain to vpot, send to fader - _vpot->set_control (_route->group_gain_control()); - control_by_parameter[GainAutomation] = _vpot; - // test for send to control - boost::shared_ptr<Processor> p = _route->nth_send (_current_send); - if (p && p->name() != "Monitor 1") { - boost::shared_ptr<Send> s = boost::dynamic_pointer_cast<Send>(p); - boost::shared_ptr<Amp> a = s->amp(); - _fader->set_control (a->gain_control()); - // connect to signal - send_connections.drop_connections (); - a->gain_control()->Changed.connect(send_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_processor_changed, this, false), ui_context()); - control_by_parameter[SendAutomation] = _fader; + if (!Profile->get_mixbus()) { + if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) { + // gain to vpot, send to fader + _vpot->set_control (_route->group_gain_control()); + control_by_parameter[GainAutomation] = _vpot; + // test for send to control + boost::shared_ptr<Processor> p = _route->nth_send (_current_send); + if (p && p->name() != "Monitor 1") { + boost::shared_ptr<Send> s = boost::dynamic_pointer_cast<Send>(p); + boost::shared_ptr<Amp> a = s->amp(); + _fader->set_control (a->gain_control()); + // connect to signal + send_connections.drop_connections (); + a->gain_control()->Changed.connect(send_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_processor_changed, this, false), ui_context()); + control_by_parameter[SendAutomation] = _fader; + } else { + _fader->set_control (boost::shared_ptr<AutomationControl>()); + control_by_parameter[SendAutomation] = 0; + } } else { - _fader->set_control (boost::shared_ptr<AutomationControl>()); - control_by_parameter[SendAutomation] = 0; - } - } else { - // gain to fader, send to vpot - _fader->set_control (_route->group_gain_control()); - control_by_parameter[GainAutomation] = _fader; - boost::shared_ptr<Processor> p = _route->nth_send (_current_send); - if (p && p->name() != "Monitor 1") { - boost::shared_ptr<Send> s = boost::dynamic_pointer_cast<Send>(p); - boost::shared_ptr<Amp> a = s->amp(); - _vpot->set_control (a->gain_control()); - // connect to signal - send_connections.drop_connections (); - a->gain_control()->Changed.connect(send_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_processor_changed, this, false), ui_context()); - control_by_parameter[SendAutomation] = _vpot; + // gain to fader, send to vpot + _fader->set_control (_route->group_gain_control()); + control_by_parameter[GainAutomation] = _fader; + boost::shared_ptr<Processor> p = _route->nth_send (_current_send); + if (p && p->name() != "Monitor 1") { + boost::shared_ptr<Send> s = boost::dynamic_pointer_cast<Send>(p); + boost::shared_ptr<Amp> a = s->amp(); + _vpot->set_control (a->gain_control()); + // connect to signal + send_connections.drop_connections (); + a->gain_control()->Changed.connect(send_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_processor_changed, this, false), ui_context()); + control_by_parameter[SendAutomation] = _vpot; } else { - _vpot->set_control (boost::shared_ptr<AutomationControl>()); - control_by_parameter[SendAutomation] = 0; + // gain to fader, send to vpot + _fader->set_control (_route->group_gain_control()); + control_by_parameter[GainAutomation] = _fader; + boost::shared_ptr<Processor> p = _route->nth_send (_current_send); + if (p && p->name() != "Monitor 1") { + boost::shared_ptr<Send> s = boost::dynamic_pointer_cast<Send>(p); + boost::shared_ptr<Amp> a = s->amp(); + _vpot->set_control (a->gain_control()); + // connect to signal + send_connections.drop_connections (); + a->gain_control()->Changed.connect(send_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_processor_changed, this, false), ui_context()); + control_by_parameter[SendAutomation] = _vpot; + } else { + _vpot->set_control (boost::shared_ptr<AutomationControl>()); + control_by_parameter[SendAutomation] = 0; + } } } break; + case EQParam1: { + const uint32_t eq_hi_freq = 3; /* gtk2_ardour/mixbus_ports.h */ + hookup_eq (EQParam1, eq_hi_freq); + break; + } + case EQParam2: { + const uint32_t eq_hi_gain = 4; /* gtk2_ardour/mixbus_ports.h */ + hookup_eq (EQParam2, eq_hi_gain); + break; + } + case EQParam3: { + const uint32_t eq_mid_freq = 5; /* gtk2_ardour/mixbus_ports.h */ + hookup_eq (EQParam3, eq_mid_freq); + break; + } + case EQParam4: { + const uint32_t eq_mid_gain = 6; /* gtk2_ardour/mixbus_ports.h */ + hookup_eq (EQParam4, eq_mid_gain); + break; + } + case EQParam5: { + const uint32_t eq_lo_freq = 7; /* gtk2_ardour/mixbus_ports.h */ + hookup_eq (EQParam5, eq_lo_freq); + break; + } + case EQParam6: { + const uint32_t eq_lo_gain = 8; /* gtk2_ardour/mixbus_ports.h */ + hookup_eq (EQParam6, eq_lo_gain); + break; + } + case EQParam7: { + const uint32_t eq_hp_freq = 2; /* gtk2_ardour/mixbus_ports.h */ + hookup_eq (EQParam7, eq_hp_freq); + break; + } + case EQParam8: { + const uint32_t eq_in = 1; /* gtk2_ardour/mixbus_ports.h */ + hookup_eq (EQParam8, eq_in); + break; + } default: DEBUG_TRACE (DEBUG::MackieControl, string_compose ("vpot mode %1 not known.\n", p)); break; @@ -1531,3 +1722,27 @@ Strip::notify_metering_state_changed() _transport_is_rolling = transport_is_rolling; _metering_active = metering_active; } + +void +Strip::hookup_eq (AutomationType param, uint32_t port_number) +{ + if (!_subview_route) { + _vpot->set_control (boost::shared_ptr<AutomationControl>()); + return; + } + + boost::shared_ptr<PluginInsert> eq = _subview_route->ch_eq(); + + if (!eq) { + _vpot->set_control (boost::shared_ptr<AutomationControl>()); + } + + boost::shared_ptr<AutomationControl> control = boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (eq->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, port_number))); + + if (control) { + control->Changed.connect (subview_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_eq_change, this, param, port_number, false), ui_context()); + _vpot->set_control (control); + control_by_parameter[param] = _vpot; + show_route_name (); + } +} diff --git a/libs/surfaces/mackie/strip.h b/libs/surfaces/mackie/strip.h index cf1fc9e381..4f3b0136dd 100644 --- a/libs/surfaces/mackie/strip.h +++ b/libs/surfaces/mackie/strip.h @@ -15,6 +15,7 @@ #include "control_group.h" #include "types.h" +#include "mackie_control_protocol.h" #include "midi_byte_array.h" #include "device_info.h" @@ -88,6 +89,8 @@ public: void block_screen_display_for (uint32_t msecs); void block_vpot_mode_display_for (uint32_t msecs); + void use_subview (MackieControlProtocol::SubViewMode, boost::shared_ptr<ARDOUR::Route>); + private: Button* _solo; Button* _recenable; @@ -106,11 +109,14 @@ private: uint64_t _block_vpot_mode_redisplay_until; uint64_t _block_screen_redisplay_until; boost::shared_ptr<ARDOUR::Route> _route; + boost::shared_ptr<ARDOUR::Route> _subview_route; PBD::ScopedConnectionList route_connections; + PBD::ScopedConnectionList subview_connections; PBD::ScopedConnectionList send_connections; ARDOUR::AutomationType _pan_mode; ARDOUR::AutomationType _trim_mode; + ARDOUR::AutomationType vpot_parameter; float _last_gain_position_written; float _last_pan_azi_position_written; @@ -135,7 +141,7 @@ private: std::string vpot_mode_string (); boost::shared_ptr<ARDOUR::AutomationControl> mb_pan_controllable; - + void return_to_vpot_mode_display (); struct RedisplayRequest { @@ -155,7 +161,7 @@ private: std::vector<Evoral::Parameter> possible_pot_parameters; std::vector<Evoral::Parameter> possible_trim_parameters; void next_pot_mode (); - void set_vpot_parameter (Evoral::Parameter); + void set_vpot_parameter (Evoral::Parameter, boost::shared_ptr<ARDOUR::Route> target_route = boost::shared_ptr<ARDOUR::Route>()); void show_route_name (); void reset_saved_values (); @@ -164,6 +170,9 @@ private: typedef std::map<Evoral::Parameter,Control*> ControlParameterMap; ControlParameterMap control_by_parameter; + + void hookup_eq (ARDOUR::AutomationType, uint32_t); + void notify_eq_change (ARDOUR::AutomationType, uint32_t, bool force); }; } diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc index 85ea7c97b1..336855659b 100644 --- a/libs/surfaces/mackie/surface.cc +++ b/libs/surfaces/mackie/surface.cc @@ -1037,6 +1037,29 @@ Surface::update_potmode () } } +bool +Surface::update_subview_mode_display () +{ + switch (_mcp.subview_mode()) { + case MackieControlProtocol::None: + for (Strips::iterator s = strips.begin(); s != strips.end(); ++s) { + (*s)->use_subview (MackieControlProtocol::None, strips.front()->route()); + } + /* normal display is required */ + return false; + case MackieControlProtocol::EQ: + for (Strips::iterator s = strips.begin(); s != strips.end(); ++s) { + (*s)->use_subview (MackieControlProtocol::EQ, strips.front()->route()); + } + break; + case MackieControlProtocol::Dynamics: + break; + } + + /* no normal display required */ + return true; +} + void Surface::update_view_mode_display () { @@ -1047,6 +1070,10 @@ Surface::update_view_mode_display () return; } + if (update_subview_mode_display ()) { + return; + } + switch (_mcp.view_mode()) { case MackieControlProtocol::Mixer: show_two_char_display ("Mx"); @@ -1087,16 +1114,6 @@ Surface::update_view_mode_display () id = Button::User; text = _("Selected Routes"); break; - case MackieControlProtocol::Dynamics: - show_two_char_display ("DI"); - id = Button::User; - text = _("Dynamics"); - break; - case MackieControlProtocol::EQ: - show_two_char_display ("EQ"); - id = Button::User; - text = _("EQ"); - break; default: break; } diff --git a/libs/surfaces/mackie/surface.h b/libs/surfaces/mackie/surface.h index 78bb42ab6a..df667ec1e2 100644 --- a/libs/surfaces/mackie/surface.h +++ b/libs/surfaces/mackie/surface.h @@ -205,6 +205,7 @@ public: int connection_state; MidiByteArray display_line (std::string const& msg, int line_num); + bool update_subview_mode_display (); public: /* IP MIDI devices need to keep a handle on this and destroy it */ |