assign new IDs to plugin copies on paste.

when copying a plugin the state is transferred by serializing
XML and setting state from XML. This state includes the unique ID.

This ID needs to be identical at first in order to load
the state from <session-dir>/plugins/<ID>/*
This commit is contained in:
Robin Gareus 2015-07-10 22:09:18 +02:00
parent 9ab76a5cf0
commit 4c608b6e04
3 changed files with 13 additions and 2 deletions

View file

@ -2155,9 +2155,10 @@ ProcessorBox::paste_processor_state (const XMLNodeList& nlist, boost::shared_ptr
/* XXX its a bit limiting to assume that everything else
is a plugin.
*/
p.reset (new PluginInsert (*_session));
p->set_state (**niter, Stateful::current_state_version);
PBD::ID id = p->id();
p->set_state (**niter, Stateful::current_state_version);
boost::dynamic_pointer_cast<PluginInsert>(p)->update_id (id);
}
copies.push_back (p);