From 28f15d3fa63543a7a600e50a5663fe85c2230056 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 18 Mar 2020 16:56:27 +0100 Subject: Add flag to explicitly hide a control Eventually this is to replace a literal name "hidden" that is currently used as hack throughout Ardour's codebase. --- libs/ardour/automatable.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libs/ardour') diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc index bc5da94500..6b4c43fc3e 100644 --- a/libs/ardour/automatable.cc +++ b/libs/ardour/automatable.cc @@ -178,7 +178,9 @@ Automatable::add_control(boost::shared_ptr ac) ControlSet::add_control (ac); if ((!actl || !(actl->flags() & Controllable::NotAutomatable)) && al) { - _can_automate_list.insert (param); + if (!actl || !(actl->flags() & Controllable::HiddenControl)) { + can_automate (param); + } automation_list_automation_state_changed (param, al->automation_state ()); // sync everything up } } @@ -264,7 +266,9 @@ Automatable::set_automation_xml_state (const XMLNode& node, Evoral::Parameter le boost::shared_ptr actl = automation_control (param); if (actl && (*niter)->children().size() > 0 && Config->get_limit_n_automatables () > 0) { actl->clear_flag (Controllable::NotAutomatable); - can_automate (param); + if (!(actl->flags() & Controllable::HiddenControl) && actl->name() != X_("hidden")) { + can_automate (param); + } info << "Marked parmater as automatable" << endl; } else { warning << "Ignored automation data for non-automatable parameter" << endl; -- cgit v1.2.3