VST-state, set/restore program before loading chunk.
This may fix some issues with VST state being restored incorrectly when a plugin-preset was loaded.
This commit is contained in:
parent
8ff1cc31cb
commit
3c11660d2a
@ -260,6 +260,8 @@ VSTPlugin::add_state (XMLNode* root) const
|
||||
chunk_node->add_content (data);
|
||||
g_free (data);
|
||||
|
||||
chunk_node->set_property ("program", (int) _plugin->dispatcher (_plugin, effGetProgram, 0, 0, NULL, 0));
|
||||
|
||||
root->add_child_nocopy (*chunk_node);
|
||||
|
||||
} else {
|
||||
@ -287,6 +289,11 @@ VSTPlugin::set_state (const XMLNode& node, int version)
|
||||
|
||||
if ((child = find_named_node (node, X_("chunk"))) != 0) {
|
||||
|
||||
int pgm = -1;
|
||||
if (child->get_property (X_("program"), pgm)) {
|
||||
_plugin->dispatcher (_plugin, effSetProgram, 0, pgm, NULL, 0);
|
||||
};
|
||||
|
||||
XMLPropertyList::const_iterator i;
|
||||
XMLNodeList::const_iterator n;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user