diff options
author | Robin Gareus <robin@gareus.org> | 2018-09-25 20:08:01 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-09-25 21:46:59 +0200 |
commit | 3c11660d2a3ec31a559f4b940a622ed735dbb054 (patch) | |
tree | 13d6eba7b6f05537f8dd85ed63662da1eaad77e4 /libs | |
parent | 8ff1cc31cbb0d21b1b8f47c3ec7d0d38c6c3cd35 (diff) |
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.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/vst_plugin.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc index 30c099be72..6cb412db39 100644 --- a/libs/ardour/vst_plugin.cc +++ b/libs/ardour/vst_plugin.cc @@ -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; |