Pass through the plugin's AEffect struct

This commit is contained in:
Robbert van der Helm
2020-03-05 14:52:02 +01:00
parent 8f34947307
commit 4f29a98cea
5 changed files with 106 additions and 73 deletions
+9 -1
View File
@@ -56,7 +56,8 @@ PluginBridge::PluginBridge(std::string plugin_dll_path,
io_context(),
socket_endpoint(socket_endpoint_path),
host_vst_dispatch(io_context),
vst_host_callback(io_context) {
vst_host_callback(io_context),
vst_host_aeffect(io_context) {
// Got to love these C APIs
if (plugin_handle == nullptr) {
throw std::runtime_error("Could not load a shared library at '" +
@@ -85,6 +86,7 @@ PluginBridge::PluginBridge(std::string plugin_dll_path,
// in the Linus plugin
host_vst_dispatch.connect(socket_endpoint);
vst_host_callback.connect(socket_endpoint);
vst_host_aeffect.connect(socket_endpoint);
// Initialize after communication has been set up We'll try to do the same
// `get_bridge_isntance` trick as in `plugin/plugin.cpp`, but since the
@@ -97,6 +99,12 @@ PluginBridge::PluginBridge(std::string plugin_dll_path,
"' failed to initialize.");
}
// Send the plugin's information to the Linux VST plugin
// TODO: This is now done only once at startup, do plugins update their
// parameters? In that case we should be detecting updates and pass
// them along accordingly.
write_object(vst_host_aeffect, *plugin);
// We only needed this little hack during initialization
current_bridge_isntance = nullptr;
plugin->ptr1 = this;