From c79243c8052883057b18569816917c5dea73ec31 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 27 Jan 2016 11:16:13 -0500 Subject: [PATCH] add stubs and enums to access "well-known" send controls --- libs/ardour/ardour/route.h | 12 +++++++++++- libs/ardour/ardour/types.h | 33 ++++++++++++++++++++++++++++++++- libs/ardour/route.cc | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 2 deletions(-) diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 6bc8869d92..829bf13298 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -553,7 +553,17 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou */ std::string comp_speed_name (uint32_t mode) const; - void protect_automation (); + /* "well-known" controls for sends to well-known busses in this route. Any or all may + * be null. + * + * In Mixbus, these are the sends that connect to the mixbusses. + * In Ardour, these are user-created sends that connect to user-created + * Aux busses. + */ + boost::shared_ptr send_level_controllable (uint32_t n) const; + boost::shared_ptr send_enable_controllable (uint32_t n) const; + + void protect_automation (); enum { /* These numbers are taken from MIDI Machine Control, diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index a7f9b5b5ff..c0d9f10ab2 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -154,6 +154,38 @@ namespace ARDOUR { CompMakeup, CompRedux, CompEnable, + BusSend1Level, + BusSend1Enable, + BusSend2Level, + BusSend2Enable, + BusSend3Level, + BusSend3Enable, + BusSend4Level, + BusSend4Enable, + BusSend5Level, + BusSend5Enable, + BusSend6Level, + BusSend6Enable, + BusSend7Level, + BusSend7Enable, + BusSend8Level, + BusSend8Enable, + BusSend9Level, + BusSend9Enable, + BusSend10Level, + BusSend10Enable, + BusSend11Level, + BusSend11Enable, + BusSend12Level, + BusSend12Enable, + BusSend13Level, + BusSend13Enable, + BusSend14Level, + BusSend14Enable, + BusSend15Level, + BusSend15Enable, + BusSend16Level, + BusSend16LeEnable, }; enum AutoState { @@ -768,4 +800,3 @@ using ARDOUR::framepos_t; #endif /* __ardour_types_h__ */ - diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 75f58b528a..8549bb34a6 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -5496,3 +5496,41 @@ Route::comp_speed_name (uint32_t mode) const return _("???"); #endif } + +boost::shared_ptr +Route::send_level_controllable (uint32_t n) const +{ +#ifdef MIXBUS + boost::shared_ptr plug = ch_post(); + assert (plug); + + if (n >= 8) { + /* no such bus */ + return boost::shared_ptr(); + } + + const uint32_t port_id = port_channel_post_aux1_level + (2*n); // gtk2_ardour/mixbus_ports.h + return boost::dynamic_pointer_cast (plug->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, port_id))); +#else + return boost::shared_ptr(); +#endif +} + +boost::shared_ptr +Route::send_enable_controllable (uint32_t n) const +{ +#ifdef MIXBUS + boost::shared_ptr plug = ch_post(); + assert (plug); + + if (n >= 8) { + /* no such bus */ + return boost::shared_ptr(); + } + + const uint32_t port_id = port_channel_post_aux1_asgn + (2*n); // gtk2_ardour/mixbus_ports.h + return boost::dynamic_pointer_cast (plug->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, port_id))); +#else + return boost::shared_ptr(); +#endif +}