summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-01-29 12:58:15 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2016-01-29 12:58:15 -0500
commitfd291d1fa5a227eb13767255c535f66120124f32 (patch)
tree7a9e9bcfe2b900103c59a8fe27fa9d6a9b29cf35
parentc6ea3515d1f230757317b22e4419a380f89a4b1d (diff)
add new Route API ::master_send_enable_controllable() to provide generic access to a mixbus-centric control
-rw-r--r--libs/ardour/ardour/route.h8
-rw-r--r--libs/ardour/route.cc12
2 files changed, 20 insertions, 0 deletions
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h
index edad4fd266..44069462d1 100644
--- a/libs/ardour/ardour/route.h
+++ b/libs/ardour/ardour/route.h
@@ -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 {
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 6effb27fc4..fb417305d7 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -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
+}