From 28f15d3fa63543a7a600e50a5663fe85c2230056 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 18 Mar 2020 16:56:27 +0100 Subject: [PATCH] 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 ++++++-- libs/pbd/enums.cc | 1 + libs/pbd/pbd/controllable.h | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) 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; diff --git a/libs/pbd/enums.cc b/libs/pbd/enums.cc index e2445162df..e2d920818d 100644 --- a/libs/pbd/enums.cc +++ b/libs/pbd/enums.cc @@ -41,6 +41,7 @@ setup_libpbd_enums () REGISTER_CLASS_ENUM (Controllable, RealTime); REGISTER_CLASS_ENUM (Controllable, NotAutomatable); REGISTER_CLASS_ENUM (Controllable, InlineControl); + REGISTER_CLASS_ENUM (Controllable, HiddenControl); REGISTER_BITS (controllable_flags); REGISTER_CLASS_ENUM (Controllable, InverseGroup); diff --git a/libs/pbd/pbd/controllable.h b/libs/pbd/pbd/controllable.h index 05e014caf4..2e114e233e 100644 --- a/libs/pbd/pbd/controllable.h +++ b/libs/pbd/pbd/controllable.h @@ -78,6 +78,7 @@ public: RealTime = 0x04, NotAutomatable = 0x08, InlineControl = 0x10, + HiddenControl = 0x20, }; Controllable (const std::string& name, Flag f = Flag (0));