mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +02:00
Get rid of the dedicated AEffect socket
This commit is contained in:
@@ -73,8 +73,7 @@ WineBridge::WineBridge(std::string plugin_dll_path,
|
||||
host_vst_dispatch_midi_events(io_context),
|
||||
vst_host_callback(io_context),
|
||||
host_vst_parameters(io_context),
|
||||
host_vst_process_replacing(io_context),
|
||||
vst_host_aeffect(io_context) {
|
||||
host_vst_process_replacing(io_context) {
|
||||
// Got to love these C APIs
|
||||
if (plugin_handle == nullptr) {
|
||||
throw std::runtime_error("Could not load the Windows .dll file at '" +
|
||||
@@ -106,7 +105,6 @@ WineBridge::WineBridge(std::string plugin_dll_path,
|
||||
vst_host_callback.connect(socket_endpoint);
|
||||
host_vst_parameters.connect(socket_endpoint);
|
||||
host_vst_process_replacing.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
|
||||
@@ -123,9 +121,11 @@ WineBridge::WineBridge(std::string plugin_dll_path,
|
||||
current_bridge_instance = nullptr;
|
||||
plugin->ptr1 = this;
|
||||
|
||||
// Send the plugin's information to the Linux VST plugin. Any updates during
|
||||
// runtime are handled using the `audioMasterIOChanged` host callback.
|
||||
write_object(vst_host_aeffect, *plugin);
|
||||
// Send the plugin's information to the Linux VST plugin. This is done over
|
||||
// the `dispatch()` socket since this has to be done only once during
|
||||
// initialization. Any updates during runtime are handled using the
|
||||
// `audioMasterIOChanged` host callback.
|
||||
write_object(host_vst_dispatch, EventResult{0, *plugin, std::nullopt});
|
||||
|
||||
// This works functionally identically to the `handle_dispatch()` function
|
||||
// below, but this socket will only handle MIDI events. This is needed
|
||||
|
||||
@@ -124,6 +124,12 @@ class WineBridge {
|
||||
// instance the socket named `host_vst_dispatch` forwards
|
||||
// `AEffect.dispatch()` calls from the native VST host to the Windows VST
|
||||
// plugin (through the Wine VST host).
|
||||
|
||||
/**
|
||||
* The socket that forwards all `dispatcher()` calls from the VST host to
|
||||
* the plugin. This is also used once at startup to populate the values of
|
||||
* the `AEffect` object.
|
||||
*/
|
||||
boost::asio::local::stream_protocol::socket host_vst_dispatch;
|
||||
/**
|
||||
* Used specifically for the `effProcessEvents` opcode. This is needed
|
||||
@@ -140,13 +146,6 @@ class WineBridge {
|
||||
boost::asio::local::stream_protocol::socket host_vst_parameters;
|
||||
boost::asio::local::stream_protocol::socket host_vst_process_replacing;
|
||||
|
||||
/**
|
||||
* This socket only handles updates of the `AEffect` struct instead of
|
||||
* passing through function calls. It's also used during initialization to
|
||||
* pass the Wine plugin's information to the host.
|
||||
*/
|
||||
boost::asio::local::stream_protocol::socket vst_host_aeffect;
|
||||
|
||||
/**
|
||||
* The thread that specifically handles `effProcessEvents` opcodes so the
|
||||
* plugin can still receive MIDI during GUI interaction to work around Win32
|
||||
|
||||
Reference in New Issue
Block a user