US2400: send_pan_azimuth lookup function (currently mb-only)
authorBen Loftis <ben@harrisonconsoles.com>
Thu, 5 Oct 2017 14:59:03 +0000 (09:59 -0500)
committerBen Loftis <ben@harrisonconsoles.com>
Thu, 5 Oct 2017 14:59:03 +0000 (09:59 -0500)
libs/ardour/ardour/route.h
libs/ardour/ardour/stripable.h
libs/ardour/ardour/vca.h
libs/ardour/route.cc

index 8500232c27c27a94cf79e89998e157bc89ae0650..235ae2089b7c7c7ec1c5b1d1c71a764240380864 100644 (file)
@@ -557,6 +557,7 @@ public:
         */
        boost::shared_ptr<AutomationControl> send_level_controllable (uint32_t n) const;
        boost::shared_ptr<AutomationControl> send_enable_controllable (uint32_t n) const;
+       boost::shared_ptr<AutomationControl> send_pan_azi_controllable (uint32_t n) const;
        /* for the same value of @param n, this returns the name of the send
         * associated with the pair of controllables returned by the above two methods.
         */
index b80b97005af33b839342a9bda065f0fec2f091d6..28c8fe1d93ff8dd9224121e0a2a6c51a71430070 100644 (file)
@@ -177,6 +177,7 @@ class LIBARDOUR_API Stripable : public SessionObject,
         */
        virtual boost::shared_ptr<AutomationControl> send_level_controllable (uint32_t n) const = 0;
        virtual boost::shared_ptr<AutomationControl> send_enable_controllable (uint32_t n) const = 0;
+       virtual boost::shared_ptr<AutomationControl> send_pan_azi_controllable (uint32_t n) const = 0;
 
        /* for the same value of @param n, this returns the name of the send
         * associated with the pair of controllables returned by the above two methods.
index 73dd6a917f6cda6548f664e5a7c5234b0d8aca8d..49bb575e1d340ad93b6a06c243afaf0794329558 100644 (file)
@@ -137,6 +137,7 @@ class LIBARDOUR_API VCA : public Stripable,
        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>(); }
        boost::shared_ptr<AutomationControl> send_enable_controllable (uint32_t n) const { return boost::shared_ptr<AutomationControl>(); }
+       boost::shared_ptr<AutomationControl> send_pan_azi_controllable (uint32_t n) const { return boost::shared_ptr<AutomationControl>(); }
        std::string send_name (uint32_t n) const { return std::string(); }
        boost::shared_ptr<AutomationControl> master_send_enable_controllable () const { return boost::shared_ptr<AutomationControl>(); }
        boost::shared_ptr<MonitorProcessor> monitor_control() const { return boost::shared_ptr<MonitorProcessor>(); }
index 368ec50eae680ced52aaf3fc0c3037ff085bf32b..b67b687ff6af6c39c036465c35beb0317a6442c4 100644 (file)
@@ -5584,6 +5584,43 @@ Route::comp_speed_name (uint32_t mode) const
 #endif
 }
 
+boost::shared_ptr<AutomationControl>
+Route::send_pan_azi_controllable (uint32_t n) const
+{
+#ifdef  MIXBUS
+# undef MIXBUS_PORTS_H
+# include "../../gtk2_ardour/mixbus_ports.h"
+       boost::shared_ptr<ARDOUR::PluginInsert> plug = ch_post();
+       if (plug && !mixbus()) {
+               uint32_t port_id = 0;
+               switch (n) {
+# ifdef MIXBUS32C
+                       case  0: port_id = port_channel_post_aux0_pan; break;  //32c mb "pan" controls use zero-based names, unlike levels. ugh
+                       case  1: port_id = port_channel_post_aux1_pan; break;
+                       case  2: port_id = port_channel_post_aux2_pan; break;
+                       case  3: port_id = port_channel_post_aux3_pan; break;
+                       case  4: port_id = port_channel_post_aux4_pan; break;
+                       case  5: port_id = port_channel_post_aux5_pan; break;
+                       case  6: port_id = port_channel_post_aux6_pan; break;
+                       case  7: port_id = port_channel_post_aux7_pan; break;
+                       case  8: port_id = port_channel_post_aux8_pan; break;
+                       case  9: port_id = port_channel_post_aux9_pan; break;
+                       case 10: port_id = port_channel_post_aux10_pan; break;
+                       case 11: port_id = port_channel_post_aux11_pan; break;
+# endif
+                       default:
+                               break;
+               }
+
+               if (port_id > 0) {
+                       return boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (plug->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, port_id)));
+               }
+       }
+#endif
+       
+       boost::shared_ptr<AutomationControl>();
+}
+
 boost::shared_ptr<AutomationControl>
 Route::send_level_controllable (uint32_t n) const
 {