summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-02-28 00:59:21 +0100
committerRobin Gareus <robin@gareus.org>2020-02-28 00:59:21 +0100
commit54911a0ee2a2d81b0587da9932f4dea7e0091dca (patch)
tree81418141d7452d4b0e0e20b60002d0644af5727f
parent4eba86b5037150e314cca932066acdde3cbfe090 (diff)
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.
-rw-r--r--gtk2_ardour/processor_box.cc7
1 files changed, 6 insertions, 1 deletions
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<ProcessorEntry>* 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<PluginInsert>(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<PluginInsert>(p)->update_id (id);
}