summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-01-27 11:16:13 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2016-01-27 11:16:22 -0500
commitc79243c8052883057b18569816917c5dea73ec31 (patch)
tree245eb4a00d3e8ca9439974f42655a94a422c1731
parentc01a4961b464a03abd3ce4bbf0ce7a9cf422416a (diff)
add stubs and enums to access "well-known" send controls
-rw-r--r--libs/ardour/ardour/route.h12
-rw-r--r--libs/ardour/ardour/types.h33
-rw-r--r--libs/ardour/route.cc38
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<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,
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<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
+}