+ for (XMLNodeList::const_iterator i = root->children().begin(); i != root->children().end(); ++i) {
+ XMLProperty* label = (*i)->property (X_("label"));
+
+ assert (label);
+
+ if (label->value() != r.label) {
+ continue;
+ }
+
+ if (_plugin->flags & 32 /* effFlagsProgramsChunks */) {
+
+ /* Load a user preset chunk from our XML file and send it via a circuitous route to the plugin */
+
+ if (_state->wanted_chunk) {
+ g_free (_state->wanted_chunk);
+ }
+
+ for (XMLNodeList::const_iterator j = (*i)->children().begin(); j != (*i)->children().end(); ++j) {
+ if ((*j)->is_content ()) {
+ /* we can't dispatch directly here; too many plugins expect only one GUI thread */
+ gsize size = 0;
+ guchar* raw_data = g_base64_decode ((*j)->content().c_str(), &size);
+ _state->wanted_chunk = raw_data;
+ _state->wanted_chunk_size = size;
+ _state->want_chunk = 1;
+ return true;