add new Route API ::master_send_enable_controllable() to provide generic access to...
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 29 Jan 2016 17:58:15 +0000 (12:58 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 29 Jan 2016 17:58:15 +0000 (12:58 -0500)
libs/ardour/ardour/route.h
libs/ardour/route.cc

index edad4fd26622709a79f07f16eae28b5d4c83b74a..44069462d1e7d4dcf9fdd2a40371bbda94bae6aa 100644 (file)
@@ -567,6 +567,14 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
          */
         std::string send_name (uint32_t n) const;
 
+        /* well known control that enables/disables sending to the master bus.
+         *
+         * In Ardour, this returns null.
+         * In Mixbus, it will return a suitable control, or null depending on
+         * the route.
+         */
+        boost::shared_ptr<AutomationControl> master_send_enable_controllable () const;
+
         void protect_automation ();
 
        enum {
index 6effb27fc47b237680839a8fd2e791a4ef4b61eb..fb417305d75e6266872e0868d89007035ac3531d 100644 (file)
@@ -5571,3 +5571,15 @@ Route::send_name (uint32_t n) const
        }
 #endif
 }
+
+boost::shared_ptr<AutomationControl>
+Route::master_send_enable_controllable () const
+{
+#ifdef  MIXBUS
+       boost::shared_ptr<ARDOUR::PluginInsert> plug = ch_post();
+       assert (plug);
+       return boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (plug->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, port_channel_post_mstr_assign)));
+#else
+       return boost::shared_ptr<AutomationControl>();
+#endif
+}