mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-08 22:55:44 +01:00
reduce number of Controls attempted for auto-slave-on-assign; use just a single definition
This commit is contained in:
parent
4653e301c8
commit
624743572c
1 changed files with 17 additions and 22 deletions
|
|
@ -153,24 +153,27 @@ Slavable::unassign (boost::shared_ptr<VCA> v)
|
|||
}
|
||||
}
|
||||
|
||||
/* Gain, solo & mute are currently the only controls that are
|
||||
* automatically slaved to the master's own equivalent controls.
|
||||
*/
|
||||
|
||||
static AutomationType auto_slave_types[] = {
|
||||
GainAutomation,
|
||||
SoloAutomation,
|
||||
MuteAutomation,
|
||||
NullAutomation
|
||||
};
|
||||
|
||||
int
|
||||
Slavable::assign_controls (boost::shared_ptr<VCA> vca)
|
||||
{
|
||||
boost::shared_ptr<SlavableAutomationControl> slave;
|
||||
boost::shared_ptr<AutomationControl> master;
|
||||
AutomationType types[] = {
|
||||
GainAutomation,
|
||||
SoloAutomation,
|
||||
MuteAutomation,
|
||||
RecEnableAutomation,
|
||||
MonitoringAutomation,
|
||||
NullAutomation
|
||||
};
|
||||
|
||||
for (uint32_t n = 0; types[n] != NullAutomation; ++n) {
|
||||
for (uint32_t n = 0; auto_slave_types[n] != NullAutomation; ++n) {
|
||||
|
||||
slave = boost::dynamic_pointer_cast<SlavableAutomationControl> (automation_control (types[n]));
|
||||
master = vca->automation_control (types[n]);
|
||||
slave = boost::dynamic_pointer_cast<SlavableAutomationControl> (automation_control (auto_slave_types[n]));
|
||||
master = vca->automation_control (auto_slave_types[n]);
|
||||
|
||||
if (slave && master) {
|
||||
slave->add_master (master);
|
||||
|
|
@ -185,18 +188,10 @@ Slavable::unassign_controls (boost::shared_ptr<VCA> vca)
|
|||
{
|
||||
boost::shared_ptr<SlavableAutomationControl> slave;
|
||||
boost::shared_ptr<AutomationControl> master;
|
||||
AutomationType types[] = {
|
||||
GainAutomation,
|
||||
SoloAutomation,
|
||||
MuteAutomation,
|
||||
RecEnableAutomation,
|
||||
MonitoringAutomation,
|
||||
NullAutomation
|
||||
};
|
||||
|
||||
for (uint32_t n = 0; types[n] != NullAutomation; ++n) {
|
||||
for (uint32_t n = 0; auto_slave_types[n] != NullAutomation; ++n) {
|
||||
|
||||
slave = boost::dynamic_pointer_cast<SlavableAutomationControl> (automation_control (types[n]));
|
||||
slave = boost::dynamic_pointer_cast<SlavableAutomationControl> (automation_control (auto_slave_types[n]));
|
||||
|
||||
if (!vca) {
|
||||
/* unassign from all */
|
||||
|
|
@ -204,7 +199,7 @@ Slavable::unassign_controls (boost::shared_ptr<VCA> vca)
|
|||
slave->clear_masters ();
|
||||
}
|
||||
} else {
|
||||
master = vca->automation_control (types[n]);
|
||||
master = vca->automation_control (auto_slave_types[n]);
|
||||
if (slave && master) {
|
||||
slave->remove_master (master);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue