add stubs and enums to access "well-known" send controls
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 27 Jan 2016 16:16:13 +0000 (11:16 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 27 Jan 2016 16:16:22 +0000 (11:16 -0500)
libs/ardour/ardour/route.h
libs/ardour/ardour/types.h
libs/ardour/route.cc

index 6bc8869d9290305038dac08029ab26ce0b0edc9d..829bf13298e01d9e06a45c60ea921eccf3a647ed 100644 (file)
@@ -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<AutomationControl> send_level_controllable (uint32_t n) const;
+        boost::shared_ptr<AutomationControl> send_enable_controllable (uint32_t n) const;
+
+        void protect_automation ();
 
        enum {
                /* These numbers are taken from MIDI Machine Control,
index a7f9b5b5ffde83b9ddda3cdededbe03bf867078f..c0d9f10ab23ff9e1a384898b6be5eb652dfbfb69 100644 (file)
@@ -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__ */
-
index 75f58b528a7cd50f378d8df966c7ecf36a46686c..8549bb34a64096512720b07a7266a9e1472dc5f0 100644 (file)
@@ -5496,3 +5496,41 @@ Route::comp_speed_name (uint32_t mode) const
        return _("???");
 #endif
 }
+
+boost::shared_ptr<AutomationControl>
+Route::send_level_controllable (uint32_t n) const
+{
+#ifdef  MIXBUS
+       boost::shared_ptr<ARDOUR::PluginInsert> plug = ch_post();
+       assert (plug);
+
+       if (n >= 8) {
+               /* no such bus */
+               return boost::shared_ptr<AutomationControl>();
+       }
+
+       const uint32_t port_id = port_channel_post_aux1_level + (2*n); // gtk2_ardour/mixbus_ports.h
+       return boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (plug->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, port_id)));
+#else
+       return boost::shared_ptr<AutomationControl>();
+#endif
+}
+
+boost::shared_ptr<AutomationControl>
+Route::send_enable_controllable (uint32_t n) const
+{
+#ifdef  MIXBUS
+       boost::shared_ptr<ARDOUR::PluginInsert> plug = ch_post();
+       assert (plug);
+
+       if (n >= 8) {
+               /* no such bus */
+               return boost::shared_ptr<AutomationControl>();
+       }
+
+       const uint32_t port_id = port_channel_post_aux1_asgn + (2*n); // gtk2_ardour/mixbus_ports.h
+       return boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (plug->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, port_id)));
+#else
+       return boost::shared_ptr<AutomationControl>();
+#endif
+}