From 54911a0ee2a2d81b0587da9932f4dea7e0091dca Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 28 Feb 2020 00:59:21 +0100 Subject: [PATCH] Fix duplicate control-ID when copying processors or proc state Ideally we'd use a "retain ID when present", so that GUI object state of automation lanes and inline controls will be retained. --- gtk2_ardour/processor_box.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 8abd1e5d18..a923533cba 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -1985,7 +1985,10 @@ ProcessorBox::object_drop (DnDVBox* source, ProcessorEntry* posi * (this needs a better solution which retains connections) */ state.remove_nodes_and_delete ("Processor"); + /* Controllable and automation IDs should not be copied */ + PBD::Stateful::ForceIDRegeneration force_ids; proc->set_state (state, Stateful::loading_state_version); + /* but retain the processor's ID (LV2 state save) */ boost::dynamic_pointer_cast(proc)->update_id (id); return; } @@ -3492,12 +3495,14 @@ ProcessorBox::paste_processor_state (const XMLNodeList& nlist, boost::shared_ptr /* strip side-chain state (processor inside processor must be a side-chain) * otherwise we'll end up with duplicate ports-names. * (this needs a better solution which retains connections) - * We really would want Stateful::ForceIDRegeneration here :( */ XMLNode state (**niter); state.remove_nodes_and_delete ("Processor"); + /* Controllable and automation IDs should not be copied */ + PBD::Stateful::ForceIDRegeneration force_ids; p->set_state (state, Stateful::current_state_version); + /* but retain the processor's ID (LV2 state save) */ boost::dynamic_pointer_cast(p)->update_id (id); }