VST3: load custom state after restoring port value
This fixes restoring the sate of Spitfire LABS and possibly other plugins
This commit is contained in:
parent
6a780f9cbc
commit
55df465fb3
@ -479,20 +479,6 @@ VST3Plugin::set_state (const XMLNode& node, int version)
|
||||
return -1;
|
||||
}
|
||||
|
||||
XMLNode* chunk;
|
||||
if ((chunk = find_named_node (node, X_("chunk"))) != 0) {
|
||||
for (iter = chunk->children ().begin(); iter != chunk->children ().end(); ++iter) {
|
||||
if ((*iter)->is_content ()) {
|
||||
gsize size = 0;
|
||||
guchar* _data = g_base64_decode ((*iter)->content().c_str(), &size);
|
||||
RAMStream stream (_data, size);
|
||||
if (!_plug->load_state (stream)) {
|
||||
error << string_compose (_("VST3<%1>: failed to load chunk-data"), name ()) << endmsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XMLNodeList nodes = node.children ("Port");
|
||||
for (iter = nodes.begin(); iter != nodes.end(); ++iter) {
|
||||
XMLNode* child = *iter;
|
||||
@ -515,6 +501,20 @@ VST3Plugin::set_state (const XMLNode& node, int version)
|
||||
}
|
||||
}
|
||||
|
||||
XMLNode* chunk;
|
||||
if ((chunk = find_named_node (node, X_("chunk"))) != 0) {
|
||||
for (iter = chunk->children ().begin(); iter != chunk->children ().end(); ++iter) {
|
||||
if ((*iter)->is_content ()) {
|
||||
gsize size = 0;
|
||||
guchar* _data = g_base64_decode ((*iter)->content().c_str(), &size);
|
||||
RAMStream stream (_data, size);
|
||||
if (!_plug->load_state (stream)) {
|
||||
error << string_compose (_("VST3<%1>: failed to load chunk-data"), name ()) << endmsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Plugin::set_state (node, version);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user