MCP: Mixbus32C: Restore missing filter controls to the Dyn page.
authorBen Loftis <ben@harrisonconsoles.com>
Wed, 10 May 2017 16:31:03 +0000 (11:31 -0500)
committerRobin Gareus <robin@gareus.org>
Fri, 12 May 2017 13:44:01 +0000 (15:44 +0200)
libs/ardour/ardour/route.h
libs/ardour/ardour/stripable.h
libs/ardour/ardour/types.h
libs/ardour/ardour/vca.h
libs/ardour/route.cc
libs/surfaces/mackie/strip.cc

index e916bc403ed0e1f2369f9dc365136220ad5a4678..038e750d01602942a63804dea3c75360d924ae07 100644 (file)
@@ -511,6 +511,11 @@ public:
        boost::shared_ptr<AutomationControl> eq_enable_controllable () const;
        boost::shared_ptr<AutomationControl> eq_hpf_controllable () const;
 
+       //additional filter params (currently 32C only )
+       boost::shared_ptr<AutomationControl> eq_lpf_controllable () const;
+       boost::shared_ptr<AutomationControl> filter_enable_controllable () const;
+
+
        /* "well-known" controls for a compressor in this route. Any or all may
         * be null.
         */
index 7298a4807ee1322aff78dbad4e16b575f77a9c3b..dea2d55c8963a44ee72f7e187736bfd09a9a2bd0 100644 (file)
@@ -142,6 +142,10 @@ class LIBARDOUR_API Stripable : public SessionObject,
        virtual boost::shared_ptr<AutomationControl> eq_enable_controllable () const = 0;
        virtual boost::shared_ptr<AutomationControl> eq_hpf_controllable () const = 0;
 
+       //additional filter params (currently 32C only )
+       virtual boost::shared_ptr<AutomationControl> eq_lpf_controllable () const = 0;
+       virtual boost::shared_ptr<AutomationControl> filter_enable_controllable () const = 0;
+
        /* "well-known" controls for a compressor in this route. Any or all may
         * be null.
         */
index 17a86fc6c571399f8017df45f4f5aa31457e06ea..0076a72a1f7e86cd2f1e33e8fe4eb55c996acd5e 100644 (file)
@@ -160,8 +160,10 @@ namespace ARDOUR {
                EQFrequency,
                EQQ,
                EQShape,
-               EQHPF,
                EQEnable,
+               EQHPF,
+               EQLPF,
+               EQFilterEnable,
                CompThreshold,
                CompSpeed,
                CompMode,
index 5cf06e4d698b5723b6bdd0aff55c23a5c62d3674..8ef0b9d2415e01d2f6ea553df2ecde474d7a803b 100644 (file)
@@ -140,6 +140,10 @@ class LIBARDOUR_API VCA : public Stripable,
        boost::shared_ptr<MonitorProcessor> monitor_control() const { return boost::shared_ptr<MonitorProcessor>(); }
        boost::shared_ptr<MonitorControl> monitoring_control() const { return boost::shared_ptr<MonitorControl>(); }
 
+       //additional filter params (currently 32C only )
+       boost::shared_ptr<AutomationControl> eq_lpf_controllable () const { return boost::shared_ptr<AutomationControl>(); }
+       boost::shared_ptr<AutomationControl> filter_enable_controllable () const { return boost::shared_ptr<AutomationControl>(); }
+
   private:
        int32_t _number;
 
index c6e3f157b34b7e55734396623b9a527e96d4b02f..dba71584e2c4390abbd183da182682148df8b901 100644 (file)
@@ -5113,6 +5113,38 @@ Route::eq_hpf_controllable () const
 #endif
 }
 
+boost::shared_ptr<AutomationControl>
+Route::eq_lpf_controllable () const
+{
+#ifdef MIXBUS32C
+       boost::shared_ptr<PluginInsert> eq = ch_eq();
+
+       if (!eq) {
+               return boost::shared_ptr<AutomationControl>();
+       }
+
+       return boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (eq->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, 6)));
+#else
+       return boost::shared_ptr<AutomationControl>();
+#endif
+}
+
+boost::shared_ptr<AutomationControl>
+Route::filter_enable_controllable () const
+{
+#ifdef MIXBUS32C
+       boost::shared_ptr<PluginInsert> eq = ch_eq();
+
+       if (!eq) {
+               return boost::shared_ptr<AutomationControl>();
+       }
+
+       return boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (eq->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, 2)));
+#else
+       return boost::shared_ptr<AutomationControl>();
+#endif
+}
+
 string
 Route::eq_band_name (uint32_t band) const
 {
index 9a570f8227dd31c3eacf5921260a07d85f076aa6..61cb64ce9bfb7a8aa7fe1d23eb86ac9a9217d6ac 100644 (file)
@@ -525,12 +525,14 @@ Strip::notify_eq_change (AutomationType type, uint32_t band, bool force_update)
        case EQShape:
                control = r->eq_shape_controllable (band);
                break;
-       case EQHPF:
-               control = r->eq_hpf_controllable ();
-               break;
        case EQEnable:
                control = r->eq_enable_controllable ();
                break;
+#ifndef MIXBUS32C
+       case EQHPF:
+               control = r->eq_hpf_controllable ();
+               break;
+#endif
        default:
                break;
        }
@@ -578,6 +580,17 @@ Strip::notify_dyn_change (AutomationType type, bool force_update, bool propagate
        case CompEnable:
                control = r->comp_enable_controllable ();
                break;
+#ifdef MIXBUS32C
+       case EQHPF:
+               control = r->eq_hpf_controllable ();
+               break;
+       case EQLPF:
+               control = r->eq_lpf_controllable ();
+               break;
+       case EQFilterEnable:
+               control = r->filter_enable_controllable ();
+               break;
+#endif
        default:
                break;
        }
@@ -993,6 +1006,7 @@ Strip::do_parameter_display (AutomationType type, float val)
        case EQQ:
        case EQShape:
        case EQHPF:
+       case EQLPF:
        case CompThreshold:
        case CompSpeed:
        case CompMakeup:
@@ -1001,6 +1015,7 @@ Strip::do_parameter_display (AutomationType type, float val)
                pending_display[1] = buf;
                screen_hold = true;
                break;
+       case EQFilterEnable:
        case EQEnable:
        case CompEnable:
                if (val >= 0.5) {
@@ -1531,6 +1546,12 @@ Strip::setup_dyn_vpot (boost::shared_ptr<Stripable> r)
        boost::shared_ptr<AutomationControl> kc = r->comp_makeup_controllable ();
        boost::shared_ptr<AutomationControl> ec = r->comp_enable_controllable ();
 
+#ifdef MIXBUS32C       //Mixbus32C needs to spill the filter controls into the comp section
+       boost::shared_ptr<AutomationControl> hpfc = r->eq_hpf_controllable ();
+       boost::shared_ptr<AutomationControl> lpfc = r->eq_lpf_controllable ();
+       boost::shared_ptr<AutomationControl> fec = r->filter_enable_controllable ();
+#endif
+
        uint32_t pos = _surface->mcp().global_index (*this);
 
        /* we will control the pos-th available parameter, from the list in the
@@ -1546,6 +1567,12 @@ Strip::setup_dyn_vpot (boost::shared_ptr<Stripable> r)
        if (kc) { available.push_back (kc); params.push_back (CompMakeup); }
        if (ec) { available.push_back (ec); params.push_back (CompEnable); }
 
+#ifdef MIXBUS32C       //Mixbus32C needs to spill the filter controls into the comp section
+       if (hpfc) { available.push_back (hpfc); params.push_back (EQHPF); }
+       if (lpfc) { available.push_back (lpfc); params.push_back (EQLPF); }
+       if (fec) { available.push_back (fec); params.push_back (EQFilterEnable); }
+#endif
+
        if (pos >= available.size()) {
                /* this knob is not needed to control the available parameters */
                _vpot->set_control (boost::shared_ptr<AutomationControl>());
@@ -1585,9 +1612,24 @@ Strip::setup_dyn_vpot (boost::shared_ptr<Stripable> r)
        case CompRedux:
                pot_id = "Redux";
                break;
+#ifdef MIXBUS32C
+       case CompEnable:
+               pot_id = "CompIn";
+               break;
+       case EQHPF:
+               pot_id = "HPF";
+               break;
+       case EQLPF:
+               pot_id = "LPF";
+               break;
+       case EQFilterEnable:
+               pot_id = "FiltIn";
+               break;
+#else
        case CompEnable:
                pot_id = "on/off";
                break;
+#endif
        default:
                break;
        }
@@ -1651,6 +1693,16 @@ Strip::setup_eq_vpot (boost::shared_ptr<Stripable> r)
                band_name = r->eq_band_name (eq_band);
 
                switch (parameter) {
+#ifdef MIXBUS32C  //in 32C, we swap the order of freq/gain to match the GUI
+               case 0:
+                       pc = r->eq_freq_controllable (eq_band);
+                       param = EQFrequency;
+                       break;
+               case 1:
+                       pc = r->eq_gain_controllable (eq_band);
+                       param = EQGain;
+                       break;
+#else
                case 0:
                        pc = r->eq_gain_controllable (eq_band);
                        param = EQGain;
@@ -1659,6 +1711,7 @@ Strip::setup_eq_vpot (boost::shared_ptr<Stripable> r)
                        pc = r->eq_freq_controllable (eq_band);
                        param = EQFrequency;
                        break;
+#endif
                case 2:
                        pc = r->eq_q_controllable (eq_band);
                        param = EQQ;
@@ -1677,6 +1730,7 @@ Strip::setup_eq_vpot (boost::shared_ptr<Stripable> r)
                uint32_t parameter = global_pos - total_band_parameters;
 
                switch (parameter) {
+#ifndef MIXBUS32C
                case 0: /* first control after band parameters */
                        pc = r->eq_hpf_controllable();
                        param = EQHPF;
@@ -1685,6 +1739,7 @@ Strip::setup_eq_vpot (boost::shared_ptr<Stripable> r)
                        pc = r->eq_enable_controllable();
                        param = EQEnable;
                        break;
+#endif
                default:
                        /* nothing to control */
                        _vpot->set_control (boost::shared_ptr<AutomationControl>());
@@ -1716,12 +1771,14 @@ Strip::setup_eq_vpot (boost::shared_ptr<Stripable> r)
                case EQShape:
                        pot_id = band_name + " Shp";
                        break;
-               case EQHPF:
-                       pot_id = "HPFreq";
-                       break;
                case EQEnable:
                        pot_id = "on/off";
                        break;
+#ifndef MIXBUS32C
+               case EQHPF:
+                       pot_id = "HPFreq";
+                       break;
+#endif
                default:
                        break;
                }