Fix state version for copy-construction (1/2)
In some cases copying an instance requires an explicit set_state() call (e.g. copy internal plugin state). This is done by calling `set_state(other->get_state())`. ::get_state() produces XML as matching current_state_version. (not loading_state_version).
This commit is contained in:
parent
0aad0ae464
commit
619d523bbe
|
@ -420,7 +420,7 @@ LV2Plugin::LV2Plugin (const LV2Plugin& other)
|
|||
|
||||
XMLNode root (other.state_node_name ());
|
||||
other.add_state (&root);
|
||||
set_state (root, Stateful::loading_state_version);
|
||||
set_state (root, Stateful::current_state_version);
|
||||
|
||||
for (uint32_t i = 0; i < parameter_count(); ++i) {
|
||||
_control_data[i] = other._shadow_data[i];
|
||||
|
|
|
@ -61,7 +61,7 @@ LXVSTPlugin::LXVSTPlugin (const LXVSTPlugin &other)
|
|||
|
||||
XMLNode* root = new XMLNode (other.state_node_name ());
|
||||
other.add_state (root);
|
||||
set_state (*root, Stateful::loading_state_version);
|
||||
set_state (*root, Stateful::current_state_version);
|
||||
delete root;
|
||||
|
||||
init_plugin ();
|
||||
|
|
|
@ -59,7 +59,7 @@ MacVSTPlugin::MacVSTPlugin (const MacVSTPlugin &other)
|
|||
|
||||
XMLNode* root = new XMLNode (other.state_node_name ());
|
||||
other.add_state (root);
|
||||
set_state (*root, Stateful::loading_state_version);
|
||||
set_state (*root, Stateful::current_state_version);
|
||||
delete root;
|
||||
|
||||
init_plugin ();
|
||||
|
|
|
@ -181,7 +181,7 @@ PluginInsert::set_count (uint32_t num)
|
|||
|
||||
if (require_state) {
|
||||
XMLNode& state = _plugins[0]->get_state ();
|
||||
p->set_state (state, Stateful::loading_state_version);
|
||||
p->set_state (state, Stateful::current_state_version);
|
||||
}
|
||||
|
||||
if (active ()) {
|
||||
|
|
|
@ -60,7 +60,7 @@ WindowsVSTPlugin::WindowsVSTPlugin (const WindowsVSTPlugin &other)
|
|||
|
||||
XMLNode* root = new XMLNode (other.state_node_name ());
|
||||
other.add_state (root);
|
||||
set_state (*root, Stateful::loading_state_version);
|
||||
set_state (*root, Stateful::current_state_version);
|
||||
delete root;
|
||||
|
||||
init_plugin ();
|
||||
|
|
Loading…
Reference in New Issue