From d64ca9be08331756e936018ea4d06404faa2ca90 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 12 Apr 2017 21:13:14 +0200 Subject: [PATCH] Properly expose "well known" comp_redux output. --- libs/ardour/ardour/route.h | 2 +- libs/ardour/ardour/stripable.h | 3 ++- libs/ardour/ardour/vca.h | 2 +- libs/ardour/route.cc | 13 ++++++++----- libs/surfaces/mackie/strip.cc | 5 ----- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 3ac2d6dda6..9313df2f0c 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -520,7 +520,7 @@ public: boost::shared_ptr comp_speed_controllable () const; boost::shared_ptr comp_mode_controllable () const; boost::shared_ptr comp_makeup_controllable () const; - boost::shared_ptr comp_redux_controllable () const; + boost::shared_ptr comp_redux_controllable () const; /* @param mode must be supplied by the comp_mode_controllable(). All other values * result in undefined behaviour diff --git a/libs/ardour/ardour/stripable.h b/libs/ardour/ardour/stripable.h index 099a048016..2484c26345 100644 --- a/libs/ardour/ardour/stripable.h +++ b/libs/ardour/ardour/stripable.h @@ -37,6 +37,7 @@ class StripableColorDialog; namespace ARDOUR { class AutomationControl; +class ReadOnlyControl; class GainControl; class PeakMeter; class SoloControl; @@ -144,7 +145,7 @@ class LIBARDOUR_API Stripable : public SessionObject { virtual boost::shared_ptr comp_speed_controllable () const = 0; virtual boost::shared_ptr comp_mode_controllable () const = 0; virtual boost::shared_ptr comp_makeup_controllable () const = 0; - virtual boost::shared_ptr comp_redux_controllable () const = 0; + virtual boost::shared_ptr comp_redux_controllable () const = 0; /* @param mode must be supplied by the comp_mode_controllable(). All other values * result in undefined behaviour diff --git a/libs/ardour/ardour/vca.h b/libs/ardour/ardour/vca.h index 63ba55f5b4..0977001927 100644 --- a/libs/ardour/ardour/vca.h +++ b/libs/ardour/ardour/vca.h @@ -132,7 +132,7 @@ class LIBARDOUR_API VCA : public Stripable, boost::shared_ptr comp_speed_controllable () const { return boost::shared_ptr(); } boost::shared_ptr comp_mode_controllable () const { return boost::shared_ptr(); } boost::shared_ptr comp_makeup_controllable () const { return boost::shared_ptr(); } - boost::shared_ptr comp_redux_controllable () const { return boost::shared_ptr(); } + boost::shared_ptr comp_redux_controllable () const { return boost::shared_ptr(); } std::string comp_mode_name (uint32_t mode) const { return std::string(); } std::string comp_speed_name (uint32_t mode) const { return std::string(); } boost::shared_ptr send_level_controllable (uint32_t n) const { return boost::shared_ptr(); } diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 1b5c0579c1..4ea5eecd13 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -5197,20 +5197,23 @@ Route::comp_makeup_controllable () const return boost::shared_ptr(); #endif } -boost::shared_ptr +boost::shared_ptr Route::comp_redux_controllable () const { #ifdef MIXBUS boost::shared_ptr comp = ch_comp(); if (!comp) { - return boost::shared_ptr(); + return boost::shared_ptr(); + } + if (is_master()) { + return comp->control_output (2); + } else { + return comp->control_output (6); } - // XXX redux is an output-port, query via comp->plugin(0)->get_parameter (6) - return boost::dynamic_pointer_cast (comp->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, 6))); #else - return boost::shared_ptr(); + return boost::shared_ptr(); #endif } diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc index e7ce72cff8..e396af575c 100644 --- a/libs/surfaces/mackie/strip.cc +++ b/libs/surfaces/mackie/strip.cc @@ -575,9 +575,6 @@ Strip::notify_dyn_change (AutomationType type, bool force_update, bool propagate case CompMakeup: control = r->comp_makeup_controllable (); break; - case CompRedux: - control = r->comp_redux_controllable (); - break; case CompEnable: control = r->comp_enable_controllable (); break; @@ -1532,7 +1529,6 @@ Strip::setup_dyn_vpot (boost::shared_ptr r) boost::shared_ptr sc = r->comp_speed_controllable (); boost::shared_ptr mc = r->comp_mode_controllable (); boost::shared_ptr kc = r->comp_makeup_controllable (); - boost::shared_ptr rc = r->comp_redux_controllable (); boost::shared_ptr ec = r->comp_enable_controllable (); uint32_t pos = _surface->mcp().global_index (*this); @@ -1548,7 +1544,6 @@ Strip::setup_dyn_vpot (boost::shared_ptr r) if (sc) { available.push_back (sc); params.push_back (CompSpeed); } if (mc) { available.push_back (mc); params.push_back (CompMode); } if (kc) { available.push_back (kc); params.push_back (CompMakeup); } - if (rc) { available.push_back (rc); params.push_back (CompRedux); } if (ec) { available.push_back (ec); params.push_back (CompEnable); } if (pos >= available.size()) {