13
0

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:
Robin Gareus 2018-09-25 20:08:01 +02:00
parent 8ff1cc31cb
commit 3c11660d2a

View File

@ -260,6 +260,8 @@ VSTPlugin::add_state (XMLNode* root) const
chunk_node->add_content (data); chunk_node->add_content (data);
g_free (data); g_free (data);
chunk_node->set_property ("program", (int) _plugin->dispatcher (_plugin, effGetProgram, 0, 0, NULL, 0));
root->add_child_nocopy (*chunk_node); root->add_child_nocopy (*chunk_node);
} else { } else {
@ -287,6 +289,11 @@ VSTPlugin::set_state (const XMLNode& node, int version)
if ((child = find_named_node (node, X_("chunk"))) != 0) { 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; XMLPropertyList::const_iterator i;
XMLNodeList::const_iterator n; XMLNodeList::const_iterator n;