Move AEffect updating to a function

This commit is contained in:
Robbert van der Helm
2020-05-10 13:03:41 +02:00
parent ded12379f9
commit e762a57c0d
3 changed files with 30 additions and 18 deletions
+1 -17
View File
@@ -313,23 +313,7 @@ auto passthrough_event(AEffect* plugin, F callback) {
// return value, we will update values on the native VST
// plugin's `AEffect` object. This is triggered by the
// `audioMasterIOChanged` callback from the hosted VST plugin.
// These are the same fields written by bitsery in the
// initialization of `PluginBridge`. I can't think of a way to
// reuse the serializer without first having to serialize
// `updated_plugin` first though.
plugin->magic = updated_plugin.magic;
plugin->numPrograms = updated_plugin.numPrograms;
plugin->numParams = updated_plugin.numParams;
plugin->numInputs = updated_plugin.numInputs;
plugin->numOutputs = updated_plugin.numOutputs;
plugin->flags = updated_plugin.flags;
plugin->initialDelay = updated_plugin.initialDelay;
plugin->empty3a = updated_plugin.empty3a;
plugin->empty3b = updated_plugin.empty3b;
plugin->unkown_float = updated_plugin.unkown_float;
plugin->uniqueID = updated_plugin.uniqueID;
plugin->version = updated_plugin.version;
update_aeffect(*plugin, updated_plugin);
return nullptr;
},