mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 16:24:57 +01:00
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.
This commit is contained in:
parent
4eba86b503
commit
54911a0ee2
1 changed files with 6 additions and 1 deletions
|
|
@ -1985,7 +1985,10 @@ ProcessorBox::object_drop (DnDVBox<ProcessorEntry>* source, ProcessorEntry* posi
|
||||||
* (this needs a better solution which retains connections)
|
* (this needs a better solution which retains connections)
|
||||||
*/
|
*/
|
||||||
state.remove_nodes_and_delete ("Processor");
|
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);
|
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);
|
boost::dynamic_pointer_cast<PluginInsert>(proc)->update_id (id);
|
||||||
return;
|
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)
|
/* strip side-chain state (processor inside processor must be a side-chain)
|
||||||
* otherwise we'll end up with duplicate ports-names.
|
* otherwise we'll end up with duplicate ports-names.
|
||||||
* (this needs a better solution which retains connections)
|
* (this needs a better solution which retains connections)
|
||||||
* We really would want Stateful::ForceIDRegeneration here :(
|
|
||||||
*/
|
*/
|
||||||
XMLNode state (**niter);
|
XMLNode state (**niter);
|
||||||
state.remove_nodes_and_delete ("Processor");
|
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);
|
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);
|
boost::dynamic_pointer_cast<PluginInsert>(p)->update_id (id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue