diff options
author | Robin Gareus <robin@gareus.org> | 2018-10-31 23:32:16 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-10-31 23:44:04 +0100 |
commit | fd832d9d1a7eb33ff9b8b206e1b8509aef100faf (patch) | |
tree | 1ab68c7fa90877c20a8a412bfcfd317f169af436 /libs/ardour/automatable.cc | |
parent | befa339d4b4ee0e288c5f5437e0017eefd0ca2fb (diff) |
Add option to limit automatable control parmaters
VCVRack VST currently exposes 9999 automatable-control parmaters.
This slows down various GUI dropdown lists and dialogs.
(even worse: those parameters are not mapped to anything by default).
This change allows to limit automatable parameters to a reasonable number,
without loosing state of already automated parameters in existing sessions.
Diffstat (limited to 'libs/ardour/automatable.cc')
-rw-r--r-- | libs/ardour/automatable.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc index 2f60024ff0..fd7c0a9b01 100644 --- a/libs/ardour/automatable.cc +++ b/libs/ardour/automatable.cc @@ -240,16 +240,24 @@ Automatable::set_automation_xml_state (const XMLNode& node, Evoral::Parameter le continue; } - if (_can_automate_list.find (param) == _can_automate_list.end ()) { - warning << "Ignored automation data for non-automatable parameter" << endl; - continue; - } - if (!id_prop) { warning << "AutomationList node without automation-id property, " << "using default: " << EventTypeMap::instance().to_symbol(legacy_param) << endmsg; } + if (_can_automate_list.find (param) == _can_automate_list.end ()) { + boost::shared_ptr<AutomationControl> actl = automation_control (param); + if (actl && (*niter)->children().size() > 0 && Config->get_limit_n_automatables () > 0) { + actl->set_flags (Controllable::Flag ((int)actl->flags() & ~Controllable::NotAutomatable)); + can_automate (param); + info << "Marked parmater as automatable" << endl; + } else { + warning << "Ignored automation data for non-automatable parameter" << endl; + continue; + } + } + + boost::shared_ptr<AutomationControl> existing = automation_control (param); if (existing) { |