Properly expose "well known" comp_redux output.
authorRobin Gareus <robin@gareus.org>
Wed, 12 Apr 2017 19:13:14 +0000 (21:13 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 12 Apr 2017 19:14:50 +0000 (21:14 +0200)
libs/ardour/ardour/route.h
libs/ardour/ardour/stripable.h
libs/ardour/ardour/vca.h
libs/ardour/route.cc
libs/surfaces/mackie/strip.cc

index 3ac2d6dda6e8cc92cdf0a2d706eb45559a7e10f1..9313df2f0cc07862ecf4416b818d7d5d549963da 100644 (file)
@@ -520,7 +520,7 @@ public:
        boost::shared_ptr<AutomationControl> comp_speed_controllable () const;
        boost::shared_ptr<AutomationControl> comp_mode_controllable () const;
        boost::shared_ptr<AutomationControl> comp_makeup_controllable () const;
-       boost::shared_ptr<AutomationControl> comp_redux_controllable () const;
+       boost::shared_ptr<ReadOnlyControl>   comp_redux_controllable () const;
 
        /* @param mode must be supplied by the comp_mode_controllable(). All other values
         * result in undefined behaviour
index 099a048016c1c357d2ce0c80e0373313cee25a3b..2484c263457c45afb0838da5324480996c01efee 100644 (file)
@@ -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<AutomationControl> comp_speed_controllable () const = 0;
        virtual boost::shared_ptr<AutomationControl> comp_mode_controllable () const = 0;
        virtual boost::shared_ptr<AutomationControl> comp_makeup_controllable () const = 0;
-       virtual boost::shared_ptr<AutomationControl> comp_redux_controllable () const = 0;
+       virtual boost::shared_ptr<ReadOnlyControl>   comp_redux_controllable () const = 0;
 
        /* @param mode must be supplied by the comp_mode_controllable(). All other values
         * result in undefined behaviour
index 63ba55f5b449d3bc11854dec60513c6d04e9c003..0977001927269b770c8376003a732d0f3f78f879 100644 (file)
@@ -132,7 +132,7 @@ class LIBARDOUR_API VCA : public Stripable,
        boost::shared_ptr<AutomationControl> comp_speed_controllable () const { return boost::shared_ptr<AutomationControl>(); }
        boost::shared_ptr<AutomationControl> comp_mode_controllable () const { return boost::shared_ptr<AutomationControl>(); }
        boost::shared_ptr<AutomationControl> comp_makeup_controllable () const { return boost::shared_ptr<AutomationControl>(); }
-       boost::shared_ptr<AutomationControl> comp_redux_controllable () const { return boost::shared_ptr<AutomationControl>(); }
+       boost::shared_ptr<ReadOnlyControl>   comp_redux_controllable () const { return boost::shared_ptr<ReadOnlyControl>(); }
        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<AutomationControl> send_level_controllable (uint32_t n) const { return boost::shared_ptr<AutomationControl>(); }
index 1b5c0579c19420896ad9ac7d1e4ac3cc38aa71b2..4ea5eecd133b06c3040b8e70d0638501b72d094c 100644 (file)
@@ -5197,20 +5197,23 @@ Route::comp_makeup_controllable () const
        return boost::shared_ptr<AutomationControl>();
 #endif
 }
-boost::shared_ptr<AutomationControl>
+boost::shared_ptr<ReadOnlyControl>
 Route::comp_redux_controllable () const
 {
 #ifdef MIXBUS
        boost::shared_ptr<PluginInsert> comp = ch_comp();
 
        if (!comp) {
-               return boost::shared_ptr<AutomationControl>();
+               return boost::shared_ptr<ReadOnlyControl>();
+       }
+       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<ARDOUR::AutomationControl> (comp->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, 6)));
 #else
-       return boost::shared_ptr<AutomationControl>();
+       return boost::shared_ptr<ReadOnlyControl>();
 #endif
 }
 
index e7ce72cff872f6b8a330cd98794b24991c2ef9d7..e396af575cd299f0fa6485603d81ef2c0a9c7c01 100644 (file)
@@ -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<Stripable> r)
        boost::shared_ptr<AutomationControl> sc = r->comp_speed_controllable ();
        boost::shared_ptr<AutomationControl> mc = r->comp_mode_controllable ();
        boost::shared_ptr<AutomationControl> kc = r->comp_makeup_controllable ();
-       boost::shared_ptr<AutomationControl> rc = r->comp_redux_controllable ();
        boost::shared_ptr<AutomationControl> ec = r->comp_enable_controllable ();
 
        uint32_t pos = _surface->mcp().global_index (*this);
@@ -1548,7 +1544,6 @@ Strip::setup_dyn_vpot (boost::shared_ptr<Stripable> 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()) {