From a1ef99b9b7a8fe90e574843bcbdeeb466e3bcc4e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 10 Dec 2015 09:17:05 -0500 Subject: [PATCH] add beginnings of EQ and dynamics control to mackie for mixbus --- .../mackie/mackie_control_protocol.cc | 29 ++++++++--- .../surfaces/mackie/mackie_control_protocol.h | 2 + libs/surfaces/mackie/mcp_buttons.cc | 13 ++++- libs/surfaces/mackie/strip.cc | 52 +++++++++---------- libs/surfaces/mackie/surface.cc | 21 ++++++-- 5 files changed, 80 insertions(+), 37 deletions(-) diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index a69c99e383..4b1ae1e4ed 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -51,6 +51,7 @@ #include "ardour/midi_track.h" #include "ardour/panner.h" #include "ardour/panner_shell.h" +#include "ardour/profile.h" #include "ardour/route.h" #include "ardour/route_group.h" #include "ardour/session.h" @@ -309,12 +310,19 @@ MackieControlProtocol::get_sorted_routes() } break; case Busses: - if (!is_track(route)) { - if (route->route_group()) { - route->route_group()->set_active (true, this); + if (Profile->get_mixbus()) { + if (route->mixbus()) { + sorted.push_back (route); + remote_ids.insert (route->remote_control_id()); + } + } else { + if (!is_track(route)) { + if (route->route_group()) { + route->route_group()->set_active (true, this); + } + sorted.push_back (route); + remote_ids.insert (route->remote_control_id()); } - sorted.push_back (route); - remote_ids.insert (route->remote_control_id()); } break; case MidiTracks: @@ -328,7 +336,7 @@ MackieControlProtocol::get_sorted_routes() break; case Plugins: break; - case Auxes: // for now aux and buss are same + case Auxes: // in ardour, for now aux and buss are same. for mixbus, see "Busses" case above if (!is_track(route)) { if (route->route_group()) { route->route_group()->set_active (true, this); @@ -349,6 +357,12 @@ 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; } } @@ -1483,7 +1497,6 @@ MackieControlProtocol::build_button_map () DEFINE_BUTTON_HANDLER (Button::UserA, &MackieControlProtocol::user_a_press, &MackieControlProtocol::user_a_release); DEFINE_BUTTON_HANDLER (Button::UserB, &MackieControlProtocol::user_b_press, &MackieControlProtocol::user_b_release); DEFINE_BUTTON_HANDLER (Button::MasterFaderTouch, &MackieControlProtocol::master_fader_touch_press, &MackieControlProtocol::master_fader_touch_release); - } void @@ -1505,6 +1518,8 @@ 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", diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h index 1ce45ce82f..0239529cf2 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.h +++ b/libs/surfaces/mackie/mackie_control_protocol.h @@ -109,6 +109,8 @@ class MackieControlProtocol Auxes, Selected, Plugins, + Dynamics, + EQ, }; enum PotMode { diff --git a/libs/surfaces/mackie/mcp_buttons.cc b/libs/surfaces/mackie/mcp_buttons.cc index 6885acc97e..6439004a97 100644 --- a/libs/surfaces/mackie/mcp_buttons.cc +++ b/libs/surfaces/mackie/mcp_buttons.cc @@ -408,7 +408,18 @@ MackieControlProtocol::marker_press (Button &) { string markername; - session->locations()->next_available_name (markername,"mcu"); + /* Don't add another mark if one exists within 1/100th of a second of + * the current position. + */ + + + framepos_t where = session->audible_frame(); + + if (session->locations()->mark_at (where, session->frame_rate() / 100.0)) { + return off; + } + + session->locations()->next_available_name (markername,"marker"); add_marker (markername); return on; diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc index 628cc9cde8..95444d375e 100644 --- a/libs/surfaces/mackie/strip.cc +++ b/libs/surfaces/mackie/strip.cc @@ -222,19 +222,19 @@ Strip::set_route (boost::shared_ptr r, bool /*with_messages*/) boost::shared_ptr pannable = _route->pannable(); -if(Profile->get_mixbus()) { - const uint32_t port_channel_post_pan = 2; // gtk2_ardour/mixbus_ports.h - boost::shared_ptr plug = _route->ch_post(); - mb_pan_controllable = boost::dynamic_pointer_cast (plug->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, port_channel_post_pan))); + if(Profile->get_mixbus()) { + const uint32_t port_channel_post_pan = 2; // gtk2_ardour/mixbus_ports.h + boost::shared_ptr plug = _route->ch_post(); + mb_pan_controllable = boost::dynamic_pointer_cast (plug->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, port_channel_post_pan))); - mb_pan_controllable->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_panner_azi_changed, this, false), ui_context()); -} else { - if (pannable && _route->panner()) { - pannable->pan_azimuth_control->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_panner_azi_changed, this, false), ui_context()); - pannable->pan_width_control->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_panner_width_changed, this, false), ui_context()); + mb_pan_controllable->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_panner_azi_changed, this, false), ui_context()); + } else { + if (pannable && _route->panner()) { + pannable->pan_azimuth_control->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_panner_azi_changed, this, false), ui_context()); + pannable->pan_width_control->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_panner_width_changed, this, false), ui_context()); + } } -} - + _route->gain_control()->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_gain_changed, this, false), ui_context()); _route->PropertyChanged.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_property_changed, this, _1), ui_context()); @@ -257,25 +257,25 @@ if(Profile->get_mixbus()) { possible_pot_parameters.clear(); -if (Profile->get_mixbus()) { - possible_pot_parameters.push_back (PanAzimuthAutomation); -} else { - if (pannable) { - boost::shared_ptr panner = _route->panner(); - if (panner) { - set automatable = panner->what_can_be_automated (); - set::iterator a; - - if ((a = automatable.find (PanAzimuthAutomation)) != automatable.end()) { - possible_pot_parameters.push_back (PanAzimuthAutomation); - } + if (Profile->get_mixbus()) { + possible_pot_parameters.push_back (PanAzimuthAutomation); + } else { + if (pannable) { + boost::shared_ptr panner = _route->panner(); + if (panner) { + set automatable = panner->what_can_be_automated (); + set::iterator a; + + if ((a = automatable.find (PanAzimuthAutomation)) != automatable.end()) { + possible_pot_parameters.push_back (PanAzimuthAutomation); + } - if ((a = automatable.find (PanWidthAutomation)) != automatable.end()) { - possible_pot_parameters.push_back (PanWidthAutomation); + if ((a = automatable.find (PanWidthAutomation)) != automatable.end()) { + possible_pot_parameters.push_back (PanWidthAutomation); + } } } } -} if (_route->trim() && route()->trim()->active()) { possible_pot_parameters.push_back (TrimAutomation); diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc index 554b05ea02..85ea7c97b1 100644 --- a/libs/surfaces/mackie/surface.cc +++ b/libs/surfaces/mackie/surface.cc @@ -33,6 +33,7 @@ #include "ardour/route.h" #include "ardour/panner.h" #include "ardour/panner_shell.h" +#include "ardour/profile.h" #include "ardour/rc_configuration.h" #include "ardour/session.h" #include "ardour/utils.h" @@ -64,7 +65,7 @@ using namespace std; using namespace PBD; using ARDOUR::Route; using ARDOUR::Panner; -using ARDOUR::Pannable; +using ARDOUR::Profile; using ARDOUR::AutomationControl; using namespace ArdourSurface; using namespace Mackie; @@ -1070,10 +1071,14 @@ Surface::update_view_mode_display () case MackieControlProtocol::Busses: show_two_char_display ("BS"); id = Button::Busses; - text = _("Busses"); + if (Profile->get_mixbus()) { + text = _("Mixbusses"); + } else { + text = _("Busses"); + } break; case MackieControlProtocol::Auxes: - show_two_char_display ("AB"); + show_two_char_display ("Au"); id = Button::Aux; text = _("Auxes"); break; @@ -1082,6 +1087,16 @@ 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; } -- 2.30.2