mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +02:00
Send the AEffect object over a new control socket
We'll use the same socket to send the configuration data back to the plugin.
This commit is contained in:
@@ -58,6 +58,7 @@ PluginBridge::PluginBridge(audioMasterCallback host_callback)
|
||||
vst_host_callback(io_context),
|
||||
host_vst_parameters(io_context),
|
||||
host_vst_process_replacing(io_context),
|
||||
host_vst_control(io_context),
|
||||
host_callback_function(host_callback),
|
||||
logger(Logger::create_from_environment(
|
||||
create_logger_prefix(socket_endpoint.path()))),
|
||||
@@ -109,6 +110,7 @@ PluginBridge::PluginBridge(audioMasterCallback host_callback)
|
||||
socket_acceptor.accept(vst_host_callback);
|
||||
socket_acceptor.accept(host_vst_parameters);
|
||||
socket_acceptor.accept(host_vst_process_replacing);
|
||||
socket_acceptor.accept(host_vst_control);
|
||||
|
||||
#ifndef WITH_WINEDBG
|
||||
host_guard_handler.request_stop();
|
||||
@@ -170,10 +172,10 @@ PluginBridge::PluginBridge(audioMasterCallback host_callback)
|
||||
|
||||
// Read the plugin's information from the Wine process. This can only be
|
||||
// done after we started accepting host callbacks as the plugin will likely
|
||||
// call these during its initialization. We reuse the `dispatcher()` socket
|
||||
// for this since this has to be done only once.
|
||||
const auto initialization_data =
|
||||
read_object<EventResult>(host_vst_dispatch);
|
||||
// call these during its initialization. Any further updates will be sent
|
||||
// over the `dispatcher()` socket. This would happen whenever the plugin
|
||||
// calls `audioMasterIOChanged()` and after the host calls `effOpen()`.
|
||||
const auto initialization_data = read_object<EventResult>(host_vst_control);
|
||||
const auto initialized_plugin =
|
||||
std::get<AEffect>(initialization_data.payload);
|
||||
|
||||
|
||||
@@ -109,8 +109,7 @@ class PluginBridge {
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* the plugin.
|
||||
*/
|
||||
boost::asio::local::stream_protocol::socket host_vst_dispatch;
|
||||
/**
|
||||
@@ -120,6 +119,10 @@ class PluginBridge {
|
||||
* this MIDI input would just stop working at times.
|
||||
*/
|
||||
boost::asio::local::stream_protocol::socket host_vst_dispatch_midi_events;
|
||||
/**
|
||||
* The socket that forwards all `audioMaster()` calls from the Windows VST
|
||||
* plugin to the host.
|
||||
*/
|
||||
boost::asio::local::stream_protocol::socket vst_host_callback;
|
||||
/**
|
||||
* Used for both `getParameter` and `setParameter` since they mostly
|
||||
@@ -128,6 +131,14 @@ class PluginBridge {
|
||||
boost::asio::local::stream_protocol::socket host_vst_parameters;
|
||||
boost::asio::local::stream_protocol::socket host_vst_process_replacing;
|
||||
|
||||
/**
|
||||
* A control socket that sends data that is not suitable for the other
|
||||
* sockets. At the moment this is only used to, on startup, send the Windows
|
||||
* VST plugin's `AEffect` object to the native VST plugin, and to then send
|
||||
* the configuration (from `config`) back to the Wine host.
|
||||
*/
|
||||
boost::asio::local::stream_protocol::socket host_vst_control;
|
||||
|
||||
/**
|
||||
* The thread that handles host callbacks.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user