From 28d8f2f6b9b512fb7d866a829d6b426bfebd74ad Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Thu, 5 Oct 2017 09:59:03 -0500 Subject: [PATCH] US2400: send_pan_azimuth lookup function (currently mb-only) --- libs/ardour/ardour/route.h | 1 + libs/ardour/ardour/stripable.h | 1 + libs/ardour/ardour/vca.h | 1 + libs/ardour/route.cc | 37 ++++++++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+) diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 8500232c27..235ae2089b 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -557,6 +557,7 @@ public: */ boost::shared_ptr send_level_controllable (uint32_t n) const; boost::shared_ptr send_enable_controllable (uint32_t n) const; + boost::shared_ptr 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. */ diff --git a/libs/ardour/ardour/stripable.h b/libs/ardour/ardour/stripable.h index b80b97005a..28c8fe1d93 100644 --- a/libs/ardour/ardour/stripable.h +++ b/libs/ardour/ardour/stripable.h @@ -177,6 +177,7 @@ class LIBARDOUR_API Stripable : public SessionObject, */ virtual boost::shared_ptr send_level_controllable (uint32_t n) const = 0; virtual boost::shared_ptr send_enable_controllable (uint32_t n) const = 0; + virtual boost::shared_ptr 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. diff --git a/libs/ardour/ardour/vca.h b/libs/ardour/ardour/vca.h index 73dd6a917f..49bb575e1d 100644 --- a/libs/ardour/ardour/vca.h +++ b/libs/ardour/ardour/vca.h @@ -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 send_level_controllable (uint32_t n) const { return boost::shared_ptr(); } boost::shared_ptr send_enable_controllable (uint32_t n) const { return boost::shared_ptr(); } + boost::shared_ptr send_pan_azi_controllable (uint32_t n) const { return boost::shared_ptr(); } std::string send_name (uint32_t n) const { return std::string(); } boost::shared_ptr master_send_enable_controllable () const { return boost::shared_ptr(); } boost::shared_ptr monitor_control() const { return boost::shared_ptr(); } diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 368ec50eae..b67b687ff6 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -5584,6 +5584,43 @@ Route::comp_speed_name (uint32_t mode) const #endif } +boost::shared_ptr +Route::send_pan_azi_controllable (uint32_t n) const +{ +#ifdef MIXBUS +# undef MIXBUS_PORTS_H +# include "../../gtk2_ardour/mixbus_ports.h" + boost::shared_ptr 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 (plug->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, port_id))); + } + } +#endif + + boost::shared_ptr(); +} + boost::shared_ptr Route::send_level_controllable (uint32_t n) const { -- 2.30.2