Sanitize "well-known" ctrl API
[ardour.git] / libs / ardour / route.cc
index 41d85bcda5a9161b32958a3ecd2708e9309adb03..f3031aa15ada88b9d835f0d3a0499fbb70bd1214 100644 (file)
@@ -4968,7 +4968,7 @@ Route::eq_band_cnt () const
                if (is_master() || mixbus()) {
                        return 3;
                } else {
-                       return 6;
+                       return 4;
                }
 #else
                return 3;
@@ -5001,10 +5001,10 @@ Route::eq_gain_controllable (uint32_t band) const
        } else {
 #ifdef MIXBUS32C
                switch (band) {
-                       case 2: port_number = 14; break;
-                       case 3: port_number = 12; break;
-                       case 4: port_number = 10; break;
-                       case 5: port_number =  8; break;
+                       case 0: port_number = 14; break;
+                       case 1: port_number = 12; break;
+                       case 2: port_number = 10; break;
+                       case 3: port_number =  8; break;
                        default:
                                return boost::shared_ptr<AutomationControl>();
                }
@@ -5042,12 +5042,10 @@ Route::eq_freq_controllable (uint32_t band) const
        uint32_t port_number;
 #ifdef MIXBUS32C
        switch (band) {
-               case 0: port_number = 5; break; // HPF
-               case 1: port_number = 6; break; // LPF
-               case 2: port_number = 13; break; // lo
-               case 3: port_number = 11; break; // lo mid
-               case 4: port_number = 9; break; // hi mid
-               case 5: port_number = 7; break; // hi
+               case 0: port_number = 13; break; // lo
+               case 1: port_number = 11; break; // lo mid
+               case 2: port_number = 9; break; // hi mid
+               case 3: port_number = 7; break; // hi
                default:
                        return boost::shared_ptr<AutomationControl>();
        }
@@ -5076,6 +5074,22 @@ Route::eq_q_controllable (uint32_t band) const
 boost::shared_ptr<AutomationControl>
 Route::eq_shape_controllable (uint32_t band) const
 {
+#ifdef MIXBUS32C
+       boost::shared_ptr<PluginInsert> eq = ch_eq();
+       if (is_master() || mixbus() || !eq) {
+               return boost::shared_ptr<AutomationControl>();
+       }
+       switch (band) {
+               case 0:
+                       return boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (eq->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, 4))); // lo bell
+                       break;
+               case 3:
+                       return boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (eq->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, 3))); // hi bell
+                       break;
+               default:
+                       break;
+       }
+#endif
        return boost::shared_ptr<AutomationControl>();
 }
 
@@ -5096,7 +5110,7 @@ Route::eq_enable_controllable () const
 }
 
 boost::shared_ptr<AutomationControl>
-Route::eq_hpf_controllable () const
+Route::filter_freq_controllable (bool hpf) const
 {
 #ifdef MIXBUS
        boost::shared_ptr<PluginInsert> eq = ch_eq();
@@ -5104,11 +5118,19 @@ Route::eq_hpf_controllable () const
        if (is_master() || mixbus() || !eq) {
                return boost::shared_ptr<AutomationControl>();
        }
+       if (hpf) {
 #ifdef MIXBUS32C
-       return boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (eq->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, 5)));
+               return boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (eq->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, 5))); // HPF freq
 #else
-       return boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (eq->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, 2)));
+               return boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (eq->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, 2)));
 #endif
+       } else {
+#ifdef MIXBUS32C
+               return boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (eq->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, 6))); // LPF freq
+#else
+               return boost::shared_ptr<AutomationControl>();
+#endif
+       }
 
 #else
        return boost::shared_ptr<AutomationControl>();
@@ -5116,23 +5138,13 @@ Route::eq_hpf_controllable () const
 }
 
 boost::shared_ptr<AutomationControl>
-Route::eq_lpf_controllable () const
+Route::filter_slope_controllable (bool) const
 {
-#ifdef MIXBUS32C
-       boost::shared_ptr<PluginInsert> eq = ch_eq();
-
-       if (is_master() || mixbus() || !eq) {
-               return boost::shared_ptr<AutomationControl>();
-       }
-
-       return boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (eq->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, 4)));
-#else
        return boost::shared_ptr<AutomationControl>();
-#endif
 }
 
 boost::shared_ptr<AutomationControl>
-Route::filter_enable_controllable () const
+Route::filter_enable_controllable (bool) const
 {
 #ifdef MIXBUS32C
        boost::shared_ptr<PluginInsert> eq = ch_eq();
@@ -5166,12 +5178,10 @@ Route::eq_band_name (uint32_t band) const
 #ifdef MIXBUS32C
        } else {
                switch (band) {
-                       case 0: return _("HPF");
-                       case 1: return _("LPF");
-                       case 2: return _("lo");
-                       case 3: return _("lo mid");
-                       case 4: return _("hi mid");
-                       case 5: return _("hi");
+                       case 0: return _("lo");
+                       case 1: return _("lo mid");
+                       case 2: return _("hi mid");
+                       case 3: return _("hi");
                        default: return string();
                }
        }