13
0

add stubs and enums to access "well-known" send controls

This commit is contained in:
Paul Davis 2016-01-27 11:16:13 -05:00
parent c01a4961b4
commit c79243c805
3 changed files with 81 additions and 2 deletions

View 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,

View 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__ */

View 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
}