Change terminology from 'VST' to 'plugin'

This commit is contained in:
Robbert van der Helm
2022-08-23 18:34:03 +02:00
parent bf7280fc7e
commit 4ca7ea17b2
35 changed files with 703 additions and 706 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ if with_clap
compiler_options += '-DWITH_CLAP' compiler_options += '-DWITH_CLAP'
endif endif
# This provides an easy way to start the Wine VST host using winedbg since it # This provides an easy way to start the Wine plugin host using winedbg since it
# can be quite a pain to set up # can be quite a pain to set up
if with_winedbg if with_winedbg
compiler_options += '-DWITH_WINEDBG' compiler_options += '-DWITH_WINEDBG'
+1 -1
View File
@@ -35,5 +35,5 @@ option(
'winedbg', 'winedbg',
type : 'boolean', type : 'boolean',
value : false, value : false,
description : 'Whether to run the Wine VST host with GDB attached. Might not always be reliable.' description : 'Whether to run the Wine plugin host with GDB attached. Might not always be reliable.'
) )
+13 -13
View File
@@ -591,7 +591,7 @@ class AdHocSocketHandler {
// As mentioned in `acceptor's` docstring, this acceptor will be // As mentioned in `acceptor's` docstring, this acceptor will be
// recreated in `receive_multi()` on another context, and // recreated in `receive_multi()` on another context, and
// potentially on the other side of the connection in the case // potentially on the other side of the connection in the case
// where we're handling `vst_host_callback_` VST2 events // where we're handling `plugin_host_callback_` VST2 events
acceptor_.reset(); acceptor_.reset();
ghc::filesystem::remove(endpoint_.path()); ghc::filesystem::remove(endpoint_.path());
} else { } else {
@@ -869,10 +869,10 @@ class AdHocSocketHandler {
* during `Sockets::connect()`. When `AdHocSocketHandler::receive_multi()` * during `Sockets::connect()`. When `AdHocSocketHandler::receive_multi()`
* is then called, we'll recreate the acceptor to asynchronously listen for * is then called, we'll recreate the acceptor to asynchronously listen for
* new incoming socket connections on `endpoint` using. This is important, * new incoming socket connections on `endpoint` using. This is important,
* because on the case of `Vst2Sockets`'s' `vst_host_callback_` the acceptor * because on the case of `Vst2Sockets`'s' `plugin_host_callback_` the
* is first accepts an initial socket on the plugin side (like all sockets), * acceptor is first accepts an initial socket on the plugin side (like all
* but all additional incoming connections of course have to be listened for * sockets), but all additional incoming connections of course have to be
* on the plugin side. * listened for on the plugin side.
*/ */
std::optional<asio::local::stream_protocol::acceptor> acceptor_; std::optional<asio::local::stream_protocol::acceptor> acceptor_;
@@ -1010,8 +1010,8 @@ class TypedMessageHandler : public AdHocSocketHandler<Thread> {
// only print the responses when the request was not filtered out. // only print the responses when the request was not filtered out.
bool should_log_response = false; bool should_log_response = false;
if (logging) { if (logging) {
auto [logger, is_host_vst] = *logging; auto [logger, is_host_plugin] = *logging;
should_log_response = logger.log_request(is_host_vst, object); should_log_response = logger.log_request(is_host_plugin, object);
} }
// A socket only handles a single request at a time as to prevent // A socket only handles a single request at a time as to prevent
@@ -1024,8 +1024,8 @@ class TypedMessageHandler : public AdHocSocketHandler<Thread> {
}); });
if (should_log_response) { if (should_log_response) {
auto [logger, is_host_vst] = *logging; auto [logger, is_host_plugin] = *logging;
logger.log_response(!is_host_vst, response_object); logger.log_response(!is_host_plugin, response_object);
} }
return response_object; return response_object;
@@ -1111,8 +1111,8 @@ class TypedMessageHandler : public AdHocSocketHandler<Thread> {
if (logging) { if (logging) {
should_log_response = std::visit( should_log_response = std::visit(
[&](const auto& object) { [&](const auto& object) {
auto [logger, is_host_vst] = *logging; auto [logger, is_host_plugin] = *logging;
return logger.log_request(is_host_vst, object); return logger.log_request(is_host_plugin, object);
}, },
// In the case of `AudioProcessorRequest`, we need to // In the case of `AudioProcessorRequest`, we need to
// actually fetch the variant field since our object // actually fetch the variant field since our object
@@ -1130,8 +1130,8 @@ class TypedMessageHandler : public AdHocSocketHandler<Thread> {
typename T::Response response = callback(object); typename T::Response response = callback(object);
if (should_log_response) { if (should_log_response) {
auto [logger, is_host_vst] = *logging; auto [logger, is_host_plugin] = *logging;
logger.log_response(!is_host_vst, response); logger.log_response(!is_host_plugin, response);
} }
if constexpr (persistent_buffers) { if constexpr (persistent_buffers) {
+35 -32
View File
@@ -322,8 +322,8 @@ class Vst2EventHandler : public AdHocSocketHandler<Thread> {
* Wine host when hosting a VST2 plugin. * Wine host when hosting a VST2 plugin.
* *
* On the plugin side this class should be initialized with `listen` set to * On the plugin side this class should be initialized with `listen` set to
* `true` before launching the Wine VST host. This will start listening on the * `true` before launching the Wine plugin host. This will start listening on
* sockets, and the call to `connect()` will then accept any incoming * the sockets, and the call to `connect()` will then accept any incoming
* connections. * connections.
* *
* @tparam Thread The thread implementation to use. On the Linux side this * @tparam Thread The thread implementation to use. On the Linux side this
@@ -350,76 +350,79 @@ class Vst2Sockets final : public Sockets {
const ghc::filesystem::path& endpoint_base_dir, const ghc::filesystem::path& endpoint_base_dir,
bool listen) bool listen)
: Sockets(endpoint_base_dir), : Sockets(endpoint_base_dir),
host_vst_dispatch_(io_context, host_plugin_dispatch_(
(base_dir_ / "host_vst_dispatch.sock").string(),
listen),
vst_host_callback_(io_context,
(base_dir_ / "vst_host_callback.sock").string(),
listen),
host_vst_parameters_(
io_context, io_context,
(base_dir_ / "host_vst_parameters.sock").string(), (base_dir_ / "host_plugin_dispatch.sock").string(),
listen), listen),
host_vst_process_replacing_( plugin_host_callback_(
io_context, io_context,
(base_dir_ / "host_vst_process_replacing.sock").string(), (base_dir_ / "plugin_host_callback.sock").string(),
listen), listen),
host_vst_control_(io_context, host_plugin_parameters_(
(base_dir_ / "host_vst_control.sock").string(), io_context,
listen) {} (base_dir_ / "host_plugin_parameters.sock").string(),
listen),
host_plugin_process_replacing_(
io_context,
(base_dir_ / "host_plugin_process_replacing.sock").string(),
listen),
host_plugin_control_(
io_context,
(base_dir_ / "host_plugin_control.sock").string(),
listen) {}
~Vst2Sockets() noexcept override { close(); } ~Vst2Sockets() noexcept override { close(); }
void connect() override { void connect() override {
host_vst_dispatch_.connect(); host_plugin_dispatch_.connect();
vst_host_callback_.connect(); plugin_host_callback_.connect();
host_vst_parameters_.connect(); host_plugin_parameters_.connect();
host_vst_process_replacing_.connect(); host_plugin_process_replacing_.connect();
host_vst_control_.connect(); host_plugin_control_.connect();
} }
void close() override { void close() override {
// Manually close all sockets so we break out of any blocking operations // Manually close all sockets so we break out of any blocking operations
// that may still be active // that may still be active
host_vst_dispatch_.close(); host_plugin_dispatch_.close();
vst_host_callback_.close(); plugin_host_callback_.close();
host_vst_parameters_.close(); host_plugin_parameters_.close();
host_vst_process_replacing_.close(); host_plugin_process_replacing_.close();
host_vst_control_.close(); host_plugin_control_.close();
} }
// The naming convention for these sockets is `<from>_<to>_<event>`. For // The naming convention for these sockets is `<from>_<to>_<event>`. For
// instance the socket named `host_vst_dispatch` forwards // instance the socket named `host_plugin_dispatch` forwards
// `AEffect.dispatch()` calls from the native VST host to the Windows VST // `AEffect.dispatch()` calls from the native VST host to the Windows VST
// plugin (through the Wine VST host). // plugin (through the Wine plugin host).
/** /**
* The socket that forwards all `dispatcher()` calls from the VST host to * The socket that forwards all `dispatcher()` calls from the VST host to
* the plugin. * the plugin.
*/ */
Vst2EventHandler<Thread> host_vst_dispatch_; Vst2EventHandler<Thread> host_plugin_dispatch_;
/** /**
* The socket that forwards all `audioMaster()` calls from the Windows VST * The socket that forwards all `audioMaster()` calls from the Windows VST
* plugin to the host. * plugin to the host.
*/ */
Vst2EventHandler<Thread> vst_host_callback_; Vst2EventHandler<Thread> plugin_host_callback_;
/** /**
* Used for both `getParameter` and `setParameter` since they mostly * Used for both `getParameter` and `setParameter` since they mostly
* overlap. * overlap.
*/ */
SocketHandler host_vst_parameters_; SocketHandler host_plugin_parameters_;
/** /**
* Used for processing audio usign the `process()`, `processReplacing()` and * Used for processing audio usign the `process()`, `processReplacing()` and
* `processDoubleReplacing()` functions. * `processDoubleReplacing()` functions.
*/ */
SocketHandler host_vst_process_replacing_; SocketHandler host_plugin_process_replacing_;
/** /**
* A control socket that sends data that is not suitable for the other * 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 * 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 * VST plugin's `AEffect` object to the native VST plugin, and to then send
* the configuration (from `config_`) back to the Wine host. * the configuration (from `config_`) back to the Wine host.
*/ */
SocketHandler host_vst_control_; SocketHandler host_plugin_control_;
}; };
/** /**
+20 -16
View File
@@ -28,8 +28,8 @@
* Wine host when hosting a VST3 plugin. * Wine host when hosting a VST3 plugin.
* *
* On the plugin side this class should be initialized with `listen` set to * On the plugin side this class should be initialized with `listen` set to
* `true` before launching the Wine VST host. This will start listening on the * `true` before launching the Wine plugin host. This will start listening on
* sockets, and the call to `connect()` will then accept any incoming * the sockets, and the call to `connect()` will then accept any incoming
* connections. * connections.
* *
* We'll have a host -> plugin connection for sending control messages (which is * We'll have a host -> plugin connection for sending control messages (which is
@@ -66,27 +66,29 @@ class Vst3Sockets final : public Sockets {
const ghc::filesystem::path& endpoint_base_dir, const ghc::filesystem::path& endpoint_base_dir,
bool listen) bool listen)
: Sockets(endpoint_base_dir), : Sockets(endpoint_base_dir),
host_vst_control_(io_context, host_plugin_control_(
(base_dir_ / "host_vst_control.sock").string(), io_context,
listen), (base_dir_ / "host_plugin_control.sock").string(),
vst_host_callback_(io_context, listen),
(base_dir_ / "vst_host_callback.sock").string(), plugin_host_callback_(
listen), io_context,
(base_dir_ / "plugin_host_callback.sock").string(),
listen),
io_context_(io_context) {} io_context_(io_context) {}
// NOLINTNEXTLINE(clang-analyzer-optin.cplusplus.VirtualCall) // NOLINTNEXTLINE(clang-analyzer-optin.cplusplus.VirtualCall)
~Vst3Sockets() noexcept override { close(); } ~Vst3Sockets() noexcept override { close(); }
void connect() override { void connect() override {
host_vst_control_.connect(); host_plugin_control_.connect();
vst_host_callback_.connect(); plugin_host_callback_.connect();
} }
void close() override { void close() override {
// Manually close all sockets so we break out of any blocking operations // Manually close all sockets so we break out of any blocking operations
// that may still be active // that may still be active
host_vst_control_.close(); host_plugin_control_.close();
vst_host_callback_.close(); plugin_host_callback_.close();
// This map should be empty at this point, but who knows // This map should be empty at this point, but who knows
std::lock_guard lock(audio_processor_sockets_mutex_); std::lock_guard lock(audio_processor_sockets_mutex_);
@@ -106,7 +108,7 @@ class Vst3Sockets final : public Sockets {
std::lock_guard lock(audio_processor_sockets_mutex_); std::lock_guard lock(audio_processor_sockets_mutex_);
audio_processor_sockets_.try_emplace( audio_processor_sockets_.try_emplace(
instance_id, io_context_, instance_id, io_context_,
(base_dir_ / ("host_vst_audio_processor_" + (base_dir_ / ("host_plugin_audio_processor_" +
std::to_string(instance_id) + ".sock")) std::to_string(instance_id) + ".sock"))
.string(), .string(),
false); false);
@@ -140,7 +142,7 @@ class Vst3Sockets final : public Sockets {
std::lock_guard lock(audio_processor_sockets_mutex_); std::lock_guard lock(audio_processor_sockets_mutex_);
audio_processor_sockets_.try_emplace( audio_processor_sockets_.try_emplace(
instance_id, io_context_, instance_id, io_context_,
(base_dir_ / ("host_vst_audio_processor_" + (base_dir_ / ("host_plugin_audio_processor_" +
std::to_string(instance_id) + ".sock")) std::to_string(instance_id) + ".sock"))
.string(), .string(),
true); true);
@@ -237,14 +239,16 @@ class Vst3Sockets final : public Sockets {
* This will be listened on by the Wine plugin host when it calls * This will be listened on by the Wine plugin host when it calls
* `receive_multi()`. * `receive_multi()`.
*/ */
TypedMessageHandler<Thread, Vst3Logger, ControlRequest> host_vst_control_; TypedMessageHandler<Thread, Vst3Logger, ControlRequest>
host_plugin_control_;
/** /**
* For sending callbacks from the plugin back to the host. After we have a * For sending callbacks from the plugin back to the host. After we have a
* better idea of what our communication model looks like we'll probably * better idea of what our communication model looks like we'll probably
* want to provide an abstraction similar to `Vst2EventHandler`. * want to provide an abstraction similar to `Vst2EventHandler`.
*/ */
TypedMessageHandler<Thread, Vst3Logger, CallbackRequest> vst_host_callback_; TypedMessageHandler<Thread, Vst3Logger, CallbackRequest>
plugin_host_callback_;
private: private:
/** /**
+2 -2
View File
@@ -31,8 +31,8 @@
* they can share resources. Configuration file loading works as follows: * they can share resources. Configuration file loading works as follows:
* *
* 1. `load_config_for(path)` from `src/plugin/utils.h` gets called with a path * 1. `load_config_for(path)` from `src/plugin/utils.h` gets called with a path
* to the copy of or symlink to `libyabridge-{clap,vst2,vst3}.so` that the plugin * to the copy of or symlink to `libyabridge-{clap,vst2,vst3}.so` that the
* host has tried to load. * plugin host has tried to load.
* 2. We start looking for a file named `yabridge.toml` in the same directory as * 2. We start looking for a file named `yabridge.toml` in the same directory as
* that `.so` file, iteratively continuing to search one directory higher * that `.so` file, iteratively continuing to search one directory higher
* until we either find the file or we reach the filesystem root. * until we either find the file or we reach the filesystem root.
+5 -5
View File
@@ -23,10 +23,10 @@
/** /**
* Return a path to this `.so` file. This can be used to find out from where * Return a path to this `.so` file. This can be used to find out from where
* this copy of `libyabridge-{clap,vst2,vst3}.so` or `libyabridge-chainloader-*.so` * this copy of `libyabridge-{clap,vst2,vst3}.so` or
* was loaded so we can search for a matching Windows plugin library. When the * `libyabridge-chainloader-*.so` was loaded so we can search for a matching
* chainloaders are used, this path should be passed to the chainloaded plugin * Windows plugin library. When the chainloaders are used, this path should be
* library using the provided exported functions since they can't detect the * passed to the chainloaded plugin library using the provided exported
* path themselves. * functions since they can't detect the path themselves.
*/ */
ghc::filesystem::path get_this_file_location(); ghc::filesystem::path get_this_file_location();
+2 -2
View File
@@ -86,8 +86,8 @@ class Logger {
* editor window handling. If we end up adding more of these options, we * editor window handling. If we end up adding more of these options, we
* should move to a bitfield or something. * should move to a bitfield or something.
* @param prefix An optional prefix for the logger. Useful for differentiate * @param prefix An optional prefix for the logger. Useful for differentiate
* messages coming from the Wine VST host. Should end with a single space * messages coming from the Wine plugin host. Should end with a single
* character. * space character.
* @param prefix_timestamp Whether the log messages should be prefixed with * @param prefix_timestamp Whether the log messages should be prefixed with
* a timestamp. The timestamp is added before `prefix`. This is set to * a timestamp. The timestamp is added before `prefix`. This is set to
* `false` in `create_wine_stderr()` because otherwise you would end up * `false` in `create_wine_stderr()` because otherwise you would end up
File diff suppressed because it is too large Load Diff
+181 -164
View File
@@ -60,280 +60,297 @@ class Vst3Logger {
// way we can filter out the log message for the response together with the // way we can filter out the log message for the response together with the
// request. // request.
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const Vst3PluginFactoryProxy::Construct&); const Vst3PluginFactoryProxy::Construct&);
bool log_request(bool is_host_vst, const Vst3PlugViewProxy::Destruct&); bool log_request(bool is_host_plugin, const Vst3PlugViewProxy::Destruct&);
bool log_request(bool is_host_vst, const Vst3PluginProxy::Construct&); bool log_request(bool is_host_plugin, const Vst3PluginProxy::Construct&);
bool log_request(bool is_host_vst, const Vst3PluginProxy::Destruct&); bool log_request(bool is_host_plugin, const Vst3PluginProxy::Destruct&);
bool log_request(bool is_host_vst, const Vst3PluginProxy::Initialize&); bool log_request(bool is_host_plugin, const Vst3PluginProxy::Initialize&);
bool log_request(bool is_host_vst, const Vst3PluginProxy::SetState&); bool log_request(bool is_host_plugin, const Vst3PluginProxy::SetState&);
bool log_request(bool is_host_vst, const Vst3PluginProxy::GetState&); bool log_request(bool is_host_plugin, const Vst3PluginProxy::GetState&);
bool log_request( bool log_request(
bool is_host_vst, bool is_host_plugin,
const YaAudioPresentationLatency::SetAudioPresentationLatencySamples&); const YaAudioPresentationLatency::SetAudioPresentationLatencySamples&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaAutomationState::SetAutomationState&); const YaAutomationState::SetAutomationState&);
bool log_request(bool is_host_vst, const YaConnectionPoint::Connect&); bool log_request(bool is_host_plugin, const YaConnectionPoint::Connect&);
bool log_request(bool is_host_vst, const YaConnectionPoint::Disconnect&); bool log_request(bool is_host_plugin, const YaConnectionPoint::Disconnect&);
bool log_request(bool is_host_vst, const YaConnectionPoint::Notify&); bool log_request(bool is_host_plugin, const YaConnectionPoint::Notify&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaContextMenuTarget::ExecuteMenuItem&); const YaContextMenuTarget::ExecuteMenuItem&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaEditController::SetComponentState&); const YaEditController::SetComponentState&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaEditController::GetParameterCount&); const YaEditController::GetParameterCount&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaEditController::GetParameterInfo&); const YaEditController::GetParameterInfo&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaEditController::GetParamStringByValue&); const YaEditController::GetParamStringByValue&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaEditController::GetParamValueByString&); const YaEditController::GetParamValueByString&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaEditController::NormalizedParamToPlain&); const YaEditController::NormalizedParamToPlain&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaEditController::PlainParamToNormalized&); const YaEditController::PlainParamToNormalized&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaEditController::GetParamNormalized&); const YaEditController::GetParamNormalized&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaEditController::SetParamNormalized&); const YaEditController::SetParamNormalized&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaEditController::SetComponentHandler&); const YaEditController::SetComponentHandler&);
bool log_request(bool is_host_vst, const YaEditController::CreateView&); bool log_request(bool is_host_plugin, const YaEditController::CreateView&);
bool log_request(bool is_host_vst, const YaEditController2::SetKnobMode&); bool log_request(bool is_host_plugin,
bool log_request(bool is_host_vst, const YaEditController2::OpenHelp&); const YaEditController2::SetKnobMode&);
bool log_request(bool is_host_vst, const YaEditController2::OpenAboutBox&); bool log_request(bool is_host_plugin, const YaEditController2::OpenHelp&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaEditController2::OpenAboutBox&);
bool log_request(bool is_host_plugin,
const YaEditControllerHostEditing::BeginEditFromHost&); const YaEditControllerHostEditing::BeginEditFromHost&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaEditControllerHostEditing::EndEditFromHost&); const YaEditControllerHostEditing::EndEditFromHost&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaInfoListener::SetChannelContextInfos&); const YaInfoListener::SetChannelContextInfos&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaKeyswitchController::GetKeyswitchCount&); const YaKeyswitchController::GetKeyswitchCount&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaKeyswitchController::GetKeyswitchInfo&); const YaKeyswitchController::GetKeyswitchInfo&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaMidiLearn::OnLiveMIDIControllerInput&); const YaMidiLearn::OnLiveMIDIControllerInput&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaMidiMapping::GetMidiControllerAssignment&); const YaMidiMapping::GetMidiControllerAssignment&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaNoteExpressionController::GetNoteExpressionCount&); const YaNoteExpressionController::GetNoteExpressionCount&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaNoteExpressionController::GetNoteExpressionInfo&); const YaNoteExpressionController::GetNoteExpressionInfo&);
bool log_request( bool log_request(
bool is_host_vst, bool is_host_plugin,
const YaNoteExpressionController::GetNoteExpressionStringByValue&); const YaNoteExpressionController::GetNoteExpressionStringByValue&);
bool log_request( bool log_request(
bool is_host_vst, bool is_host_plugin,
const YaNoteExpressionController::GetNoteExpressionValueByString&); const YaNoteExpressionController::GetNoteExpressionValueByString&);
bool log_request( bool log_request(
bool is_host_vst, bool is_host_plugin,
const YaNoteExpressionPhysicalUIMapping::GetNotePhysicalUIMapping&); const YaNoteExpressionPhysicalUIMapping::GetNotePhysicalUIMapping&);
bool log_request(bool is_host_vst, const YaParameterFinder::FindParameter&); bool log_request(bool is_host_plugin,
const YaParameterFinder::FindParameter&);
bool log_request( bool log_request(
bool is_host_vst, bool is_host_plugin,
const YaParameterFunctionName::GetParameterIDFromFunctionName&); const YaParameterFunctionName::GetParameterIDFromFunctionName&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaPlugView::IsPlatformTypeSupported&); const YaPlugView::IsPlatformTypeSupported&);
bool log_request(bool is_host_vst, const YaPlugView::Attached&); bool log_request(bool is_host_plugin, const YaPlugView::Attached&);
bool log_request(bool is_host_vst, const YaPlugView::Removed&); bool log_request(bool is_host_plugin, const YaPlugView::Removed&);
bool log_request(bool is_host_vst, const YaPlugView::OnWheel&); bool log_request(bool is_host_plugin, const YaPlugView::OnWheel&);
bool log_request(bool is_host_vst, const YaPlugView::OnKeyDown&); bool log_request(bool is_host_plugin, const YaPlugView::OnKeyDown&);
bool log_request(bool is_host_vst, const YaPlugView::OnKeyUp&); bool log_request(bool is_host_plugin, const YaPlugView::OnKeyUp&);
bool log_request(bool is_host_vst, const YaPlugView::GetSize&); bool log_request(bool is_host_plugin, const YaPlugView::GetSize&);
bool log_request(bool is_host_vst, const YaPlugView::OnSize&); bool log_request(bool is_host_plugin, const YaPlugView::OnSize&);
bool log_request(bool is_host_vst, const YaPlugView::OnFocus&); bool log_request(bool is_host_plugin, const YaPlugView::OnFocus&);
bool log_request(bool is_host_vst, const YaPlugView::SetFrame&); bool log_request(bool is_host_plugin, const YaPlugView::SetFrame&);
bool log_request(bool is_host_vst, const YaPlugView::CanResize&); bool log_request(bool is_host_plugin, const YaPlugView::CanResize&);
bool log_request(bool is_host_vst, const YaPlugView::CheckSizeConstraint&); bool log_request(bool is_host_plugin,
const YaPlugView::CheckSizeConstraint&);
bool log_request( bool log_request(
bool is_host_vst, bool is_host_plugin,
const YaPlugViewContentScaleSupport::SetContentScaleFactor&); const YaPlugViewContentScaleSupport::SetContentScaleFactor&);
bool log_request(bool is_host_vst, const YaPluginBase::Terminate&); bool log_request(bool is_host_plugin, const YaPluginBase::Terminate&);
bool log_request(bool is_host_vst, const YaPluginFactory3::SetHostContext&); bool log_request(bool is_host_plugin,
const YaPluginFactory3::SetHostContext&);
bool log_request( bool log_request(
bool is_host_vst, bool is_host_plugin,
const YaProcessContextRequirements::GetProcessContextRequirements&); const YaProcessContextRequirements::GetProcessContextRequirements&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaProgramListData::ProgramDataSupported&); const YaProgramListData::ProgramDataSupported&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaProgramListData::GetProgramData&); const YaProgramListData::GetProgramData&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaProgramListData::SetProgramData&); const YaProgramListData::SetProgramData&);
bool log_request(bool is_host_vst, const YaUnitData::UnitDataSupported&); bool log_request(bool is_host_plugin, const YaUnitData::UnitDataSupported&);
bool log_request(bool is_host_vst, const YaUnitData::GetUnitData&); bool log_request(bool is_host_plugin, const YaUnitData::GetUnitData&);
bool log_request(bool is_host_vst, const YaUnitData::SetUnitData&); bool log_request(bool is_host_plugin, const YaUnitData::SetUnitData&);
bool log_request(bool is_host_vst, const YaUnitInfo::GetUnitCount&); bool log_request(bool is_host_plugin, const YaUnitInfo::GetUnitCount&);
bool log_request(bool is_host_vst, const YaUnitInfo::GetUnitInfo&); bool log_request(bool is_host_plugin, const YaUnitInfo::GetUnitInfo&);
bool log_request(bool is_host_vst, const YaUnitInfo::GetProgramListCount&); bool log_request(bool is_host_plugin,
bool log_request(bool is_host_vst, const YaUnitInfo::GetProgramListInfo&); const YaUnitInfo::GetProgramListCount&);
bool log_request(bool is_host_vst, const YaUnitInfo::GetProgramName&); bool log_request(bool is_host_plugin,
bool log_request(bool is_host_vst, const YaUnitInfo::GetProgramInfo&); const YaUnitInfo::GetProgramListInfo&);
bool log_request(bool is_host_vst, const YaUnitInfo::HasProgramPitchNames&); bool log_request(bool is_host_plugin, const YaUnitInfo::GetProgramName&);
bool log_request(bool is_host_vst, const YaUnitInfo::GetProgramPitchName&); bool log_request(bool is_host_plugin, const YaUnitInfo::GetProgramInfo&);
bool log_request(bool is_host_vst, const YaUnitInfo::GetSelectedUnit&); bool log_request(bool is_host_plugin,
bool log_request(bool is_host_vst, const YaUnitInfo::SelectUnit&); const YaUnitInfo::HasProgramPitchNames&);
bool log_request(bool is_host_vst, const YaUnitInfo::GetUnitByBus&); bool log_request(bool is_host_plugin,
bool log_request(bool is_host_vst, const YaUnitInfo::SetUnitProgramData&); const YaUnitInfo::GetProgramPitchName&);
bool log_request(bool is_host_plugin, const YaUnitInfo::GetSelectedUnit&);
bool log_request(bool is_host_plugin, const YaUnitInfo::SelectUnit&);
bool log_request(bool is_host_plugin, const YaUnitInfo::GetUnitByBus&);
bool log_request(bool is_host_plugin,
const YaUnitInfo::SetUnitProgramData&);
bool log_request( bool log_request(
bool is_host_vst, bool is_host_plugin,
const YaXmlRepresentationController::GetXmlRepresentationStream&); const YaXmlRepresentationController::GetXmlRepresentationStream&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaAudioProcessor::SetBusArrangements&); const YaAudioProcessor::SetBusArrangements&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaAudioProcessor::GetBusArrangement&); const YaAudioProcessor::GetBusArrangement&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaAudioProcessor::CanProcessSampleSize&); const YaAudioProcessor::CanProcessSampleSize&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaAudioProcessor::GetLatencySamples&); const YaAudioProcessor::GetLatencySamples&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaAudioProcessor::SetupProcessing&); const YaAudioProcessor::SetupProcessing&);
bool log_request(bool is_host_vst, const YaAudioProcessor::SetProcessing&); bool log_request(bool is_host_plugin,
bool log_request(bool is_host_vst, const YaAudioProcessor::SetProcessing&);
bool log_request(bool is_host_plugin,
const MessageReference<YaAudioProcessor::Process>&); const MessageReference<YaAudioProcessor::Process>&);
bool log_request(bool is_host_vst, const YaAudioProcessor::GetTailSamples&); bool log_request(bool is_host_plugin,
bool log_request(bool is_host_vst, const YaAudioProcessor::GetTailSamples&);
bool log_request(bool is_host_plugin,
const YaComponent::GetControllerClassId&); const YaComponent::GetControllerClassId&);
bool log_request(bool is_host_vst, const YaComponent::SetIoMode&); bool log_request(bool is_host_plugin, const YaComponent::SetIoMode&);
bool log_request(bool is_host_vst, const YaComponent::GetBusCount&); bool log_request(bool is_host_plugin, const YaComponent::GetBusCount&);
bool log_request(bool is_host_vst, const YaComponent::GetBusInfo&); bool log_request(bool is_host_plugin, const YaComponent::GetBusInfo&);
bool log_request(bool is_host_vst, const YaComponent::GetRoutingInfo&); bool log_request(bool is_host_plugin, const YaComponent::GetRoutingInfo&);
bool log_request(bool is_host_vst, const YaComponent::ActivateBus&); bool log_request(bool is_host_plugin, const YaComponent::ActivateBus&);
bool log_request(bool is_host_vst, const YaComponent::SetActive&); bool log_request(bool is_host_plugin, const YaComponent::SetActive&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaPrefetchableSupport::GetPrefetchableSupport&); const YaPrefetchableSupport::GetPrefetchableSupport&);
bool log_request(bool is_host_vst, const Vst3ContextMenuProxy::Destruct&); bool log_request(bool is_host_plugin,
bool log_request(bool is_host_vst, const WantsConfiguration&); const Vst3ContextMenuProxy::Destruct&);
bool log_request(bool is_host_vst, const YaComponentHandler::BeginEdit&); bool log_request(bool is_host_plugin, const WantsConfiguration&);
bool log_request(bool is_host_vst, const YaComponentHandler::PerformEdit&); bool log_request(bool is_host_plugin, const YaComponentHandler::BeginEdit&);
bool log_request(bool is_host_vst, const YaComponentHandler::EndEdit&); bool log_request(bool is_host_plugin,
bool log_request(bool is_host_vst, const YaComponentHandler::PerformEdit&);
bool log_request(bool is_host_plugin, const YaComponentHandler::EndEdit&);
bool log_request(bool is_host_plugin,
const YaComponentHandler::RestartComponent&); const YaComponentHandler::RestartComponent&);
bool log_request(bool is_host_vst, const YaComponentHandler2::SetDirty&); bool log_request(bool is_host_plugin, const YaComponentHandler2::SetDirty&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaComponentHandler2::RequestOpenEditor&); const YaComponentHandler2::RequestOpenEditor&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaComponentHandler2::StartGroupEdit&); const YaComponentHandler2::StartGroupEdit&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaComponentHandler2::FinishGroupEdit&); const YaComponentHandler2::FinishGroupEdit&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaComponentHandler3::CreateContextMenu&); const YaComponentHandler3::CreateContextMenu&);
bool log_request( bool log_request(
bool is_host_vst, bool is_host_plugin,
const YaComponentHandlerBusActivation::RequestBusActivation&); const YaComponentHandlerBusActivation::RequestBusActivation&);
bool log_request(bool is_host_vst, const YaContextMenu::AddItem&); bool log_request(bool is_host_plugin, const YaContextMenu::AddItem&);
bool log_request(bool is_host_vst, const YaContextMenu::RemoveItem&); bool log_request(bool is_host_plugin, const YaContextMenu::RemoveItem&);
bool log_request(bool is_host_vst, const YaContextMenu::Popup&); bool log_request(bool is_host_plugin, const YaContextMenu::Popup&);
bool log_request(bool is_host_vst, const YaHostApplication::GetName&); bool log_request(bool is_host_plugin, const YaHostApplication::GetName&);
bool log_request(bool is_host_vst, const YaPlugFrame::ResizeView&); bool log_request(bool is_host_plugin, const YaPlugFrame::ResizeView&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaPlugInterfaceSupport::IsPlugInterfaceSupported&); const YaPlugInterfaceSupport::IsPlugInterfaceSupported&);
bool log_request(bool is_host_vst, const YaProgress::Start&); bool log_request(bool is_host_plugin, const YaProgress::Start&);
bool log_request(bool is_host_vst, const YaProgress::Update&); bool log_request(bool is_host_plugin, const YaProgress::Update&);
bool log_request(bool is_host_vst, const YaProgress::Finish&); bool log_request(bool is_host_plugin, const YaProgress::Finish&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaUnitHandler::NotifyUnitSelection&); const YaUnitHandler::NotifyUnitSelection&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaUnitHandler::NotifyProgramListChange&); const YaUnitHandler::NotifyProgramListChange&);
bool log_request(bool is_host_vst, bool log_request(bool is_host_plugin,
const YaUnitHandler2::NotifyUnitByBusChange&); const YaUnitHandler2::NotifyUnitByBusChange&);
void log_response(bool is_host_vst, const Ack&); void log_response(bool is_host_plugin, const Ack&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const UniversalTResult&, const UniversalTResult&,
bool from_cache = false); bool from_cache = false);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const Vst3PluginFactoryProxy::ConstructArgs&); const Vst3PluginFactoryProxy::ConstructArgs&);
void log_response( void log_response(
bool is_host_vst, bool is_host_plugin,
const std::variant<Vst3PluginProxy::ConstructArgs, UniversalTResult>&); const std::variant<Vst3PluginProxy::ConstructArgs, UniversalTResult>&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const Vst3PluginProxy::InitializeResponse&); const Vst3PluginProxy::InitializeResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const Vst3PluginProxy::GetStateResponse&); const Vst3PluginProxy::GetStateResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaEditController::GetParameterInfoResponse&, const YaEditController::GetParameterInfoResponse&,
bool from_cache = false); bool from_cache = false);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaEditController::GetParamStringByValueResponse&); const YaEditController::GetParamStringByValueResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaEditController::GetParamValueByStringResponse&); const YaEditController::GetParamValueByStringResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaEditController::CreateViewResponse&); const YaEditController::CreateViewResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaKeyswitchController::GetKeyswitchInfoResponse&); const YaKeyswitchController::GetKeyswitchInfoResponse&);
void log_response( void log_response(
bool is_host_vst, bool is_host_plugin,
const YaMidiMapping::GetMidiControllerAssignmentResponse&); const YaMidiMapping::GetMidiControllerAssignmentResponse&);
void log_response( void log_response(
bool is_host_vst, bool is_host_plugin,
const YaNoteExpressionController::GetNoteExpressionInfoResponse&); const YaNoteExpressionController::GetNoteExpressionInfoResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaNoteExpressionController:: const YaNoteExpressionController::
GetNoteExpressionStringByValueResponse&); GetNoteExpressionStringByValueResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaNoteExpressionController:: const YaNoteExpressionController::
GetNoteExpressionValueByStringResponse&); GetNoteExpressionValueByStringResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaNoteExpressionPhysicalUIMapping:: const YaNoteExpressionPhysicalUIMapping::
GetNotePhysicalUIMappingResponse&); GetNotePhysicalUIMappingResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaParameterFinder::FindParameterResponse&); const YaParameterFinder::FindParameterResponse&);
void log_response( void log_response(
bool is_host_vst, bool is_host_plugin,
const YaParameterFunctionName::GetParameterIDFromFunctionNameResponse&); const YaParameterFunctionName::GetParameterIDFromFunctionNameResponse&);
void log_response(bool is_host_vst, const YaPlugView::GetSizeResponse&); void log_response(bool is_host_plugin, const YaPlugView::GetSizeResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaPlugView::CheckSizeConstraintResponse&); const YaPlugView::CheckSizeConstraintResponse&);
void log_response(bool is_host_vst, const Configuration&); void log_response(bool is_host_plugin, const Configuration&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaProgramListData::GetProgramDataResponse&); const YaProgramListData::GetProgramDataResponse&);
void log_response(bool is_host_vst, const YaUnitData::GetUnitDataResponse&); void log_response(bool is_host_plugin,
void log_response(bool is_host_vst, const YaUnitInfo::GetUnitInfoResponse&); const YaUnitData::GetUnitDataResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaUnitInfo::GetUnitInfoResponse&);
void log_response(bool is_host_plugin,
const YaUnitInfo::GetProgramListInfoResponse&); const YaUnitInfo::GetProgramListInfoResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaUnitInfo::GetProgramNameResponse&); const YaUnitInfo::GetProgramNameResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaUnitInfo::GetProgramInfoResponse&); const YaUnitInfo::GetProgramInfoResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaUnitInfo::GetProgramPitchNameResponse&); const YaUnitInfo::GetProgramPitchNameResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaUnitInfo::GetUnitByBusResponse&); const YaUnitInfo::GetUnitByBusResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaXmlRepresentationController:: const YaXmlRepresentationController::
GetXmlRepresentationStreamResponse&); GetXmlRepresentationStreamResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaAudioProcessor::GetBusArrangementResponse&); const YaAudioProcessor::GetBusArrangementResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaAudioProcessor::ProcessResponse&); const YaAudioProcessor::ProcessResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaComponent::GetControllerClassIdResponse&); const YaComponent::GetControllerClassIdResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaComponent::GetBusInfoResponse&, const YaComponent::GetBusInfoResponse&,
bool from_cache = false); bool from_cache = false);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaComponent::GetRoutingInfoResponse&); const YaComponent::GetRoutingInfoResponse&);
void log_response(bool is_host_vst, const YaComponent::SetActiveResponse&); void log_response(bool is_host_plugin,
const YaComponent::SetActiveResponse&);
void log_response( void log_response(
bool is_host_vst, bool is_host_plugin,
const YaPrefetchableSupport::GetPrefetchableSupportResponse&); const YaPrefetchableSupport::GetPrefetchableSupportResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaComponentHandler3::CreateContextMenuResponse&); const YaComponentHandler3::CreateContextMenuResponse&);
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const YaHostApplication::GetNameResponse&); const YaHostApplication::GetNameResponse&);
void log_response(bool is_host_vst, const YaProgress::StartResponse&); void log_response(bool is_host_plugin, const YaProgress::StartResponse&);
template <typename T> template <typename T>
void log_response(bool is_host_vst, void log_response(bool is_host_plugin,
const PrimitiveWrapper<T>& value, const PrimitiveWrapper<T>& value,
bool from_cache = false) { bool from_cache = false) {
// For logging all primitive return values other than `tresult` // For logging all primitive return values other than `tresult`
log_response_base(is_host_vst, [&](auto& message) { log_response_base(is_host_plugin, [&](auto& message) {
message << value; message << value;
if (from_cache) { if (from_cache) {
message << " (from cache)"; message << " (from cache)";
@@ -360,12 +377,12 @@ class Vst3Logger {
* thus also be logged. * thus also be logged.
*/ */
template <std::invocable<std::ostringstream&> F> template <std::invocable<std::ostringstream&> F>
bool log_request_base(bool is_host_vst, bool log_request_base(bool is_host_plugin,
Logger::Verbosity min_verbosity, Logger::Verbosity min_verbosity,
F callback) { F callback) {
if (logger_.verbosity_ >= min_verbosity) [[unlikely]] { if (logger_.verbosity_ >= min_verbosity) [[unlikely]] {
std::ostringstream message; std::ostringstream message;
if (is_host_vst) { if (is_host_plugin) {
message << "[host -> vst] >> "; message << "[host -> vst] >> ";
} else { } else {
message << "[vst -> host] >> "; message << "[vst -> host] >> ";
@@ -381,8 +398,8 @@ class Vst3Logger {
} }
template <std::invocable<std::ostringstream&> F> template <std::invocable<std::ostringstream&> F>
bool log_request_base(bool is_host_vst, F callback) { bool log_request_base(bool is_host_plugin, F callback) {
return log_request_base(is_host_vst, Logger::Verbosity::most_events, return log_request_base(is_host_plugin, Logger::Verbosity::most_events,
callback); callback);
} }
@@ -394,9 +411,9 @@ class Vst3Logger {
* `true`. * `true`.
*/ */
template <std::invocable<std::ostringstream&> F> template <std::invocable<std::ostringstream&> F>
void log_response_base(bool is_host_vst, F callback) { void log_response_base(bool is_host_plugin, F callback) {
std::ostringstream message; std::ostringstream message;
if (is_host_vst) { if (is_host_plugin) {
message << "[vst <- host] "; message << "[vst <- host] ";
} else { } else {
message << "[host <- vst] "; message << "[host <- vst] ";
+2 -4
View File
@@ -168,8 +168,7 @@ class MutualRecursionHelper {
// pretend that we're not doing any async things here // pretend that we're not doing any async things here
std::packaged_task<Result()> do_call(std::forward<F>(fn)); std::packaged_task<Result()> do_call(std::forward<F>(fn));
std::future<Result> do_call_response = do_call.get_future(); std::future<Result> do_call_response = do_call.get_future();
asio::dispatch(*mutual_recursion_contexts_.back(), asio::dispatch(*mutual_recursion_contexts_.back(), std::move(do_call));
std::move(do_call));
mutual_recursion_lock.unlock(); mutual_recursion_lock.unlock();
return do_call_response.get(); return do_call_response.get();
@@ -186,7 +185,6 @@ class MutualRecursionHelper {
* active one. If the stack is empty, then there's currently no mutual * active one. If the stack is empty, then there's currently no mutual
* recursion going on. * recursion going on.
*/ */
std::vector<std::shared_ptr<asio::io_context>> std::vector<std::shared_ptr<asio::io_context>> mutual_recursion_contexts_;
mutual_recursion_contexts_;
std::mutex mutual_recursion_contexts_mutex_; std::mutex mutual_recursion_contexts_mutex_;
}; };
+6 -6
View File
@@ -236,11 +236,11 @@ class alignas(16) DynamicSpeakerArrangement {
}; };
/** /**
* Marker struct to indicate that the other side (the Wine VST host) should send * Marker struct to indicate that the other side (the Wine plugin host) should
* an updated copy of the plugin's `AEffect` object. Should not be needed since * send an updated copy of the plugin's `AEffect` object. Should not be needed
* the plugin should be calling `audioMasterIOChanged()` after it has changed * since the plugin should be calling `audioMasterIOChanged()` after it has
* its object, but some improperly coded plugins will only initialize their * changed its object, but some improperly coded plugins will only initialize
* flags, IO properties and parameter counts after `effEditOpen()`. * their flags, IO properties and parameter counts after `effEditOpen()`.
*/ */
struct WantsAEffectUpdate { struct WantsAEffectUpdate {
using Response = AEffect; using Response = AEffect;
@@ -500,7 +500,7 @@ void serialize(S& s, Vst2Event::Payload& payload) {
/** /**
* The result of a `getParameter` or a `setParameter` call. For `setParameter` * The result of a `getParameter` or a `setParameter` call. For `setParameter`
* this struct won't contain any values and mostly acts as an acknowledgement * this struct won't contain any values and mostly acts as an acknowledgement
* from the Wine VST host. * from the Wine plugin host.
*/ */
struct ParameterResult { struct ParameterResult {
std::optional<float> value; std::optional<float> value;
+4 -4
View File
@@ -67,7 +67,7 @@ struct WantsConfiguration {
}; };
/** /**
* When we send a control message from the plugin to the Wine VST host, this * When we send a control message from the plugin to the Wine plugin host, this
* encodes the information we request or the operation we want to perform. A * encodes the information we request or the operation we want to perform. A
* request of type `ControlRequest(T)` should send back a `T::Response`. * request of type `ControlRequest(T)` should send back a `T::Response`.
*/ */
@@ -238,9 +238,9 @@ struct AudioProcessorRequest {
}; };
/** /**
* When we do a callback from the Wine VST host to the plugin, this encodes the * When we do a callback from the Wine plugin host to the plugin, this encodes
* information we want or the operation we want to perform. A request of type * the information we want or the operation we want to perform. A request of
* `CallbackRequest(T)` should send back a `T::Response`. * type `CallbackRequest(T)` should send back a `T::Response`.
*/ */
using CallbackRequest = using CallbackRequest =
std::variant<Vst3ContextMenuProxy::Destruct, std::variant<Vst3ContextMenuProxy::Destruct,
@@ -78,10 +78,7 @@ static const char* stream_meta_data_string_keys[] = {
YaAttributeList::YaAttributeList() noexcept {FUNKNOWN_CTOR} YaAttributeList::YaAttributeList() noexcept {FUNKNOWN_CTOR}
YaAttributeList::~YaAttributeList() noexcept { YaAttributeList::~YaAttributeList() noexcept {FUNKNOWN_DTOR}
FUNKNOWN_DTOR
}
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
IMPLEMENT_FUNKNOWN_METHODS(YaAttributeList, IMPLEMENT_FUNKNOWN_METHODS(YaAttributeList,
@@ -89,7 +86,7 @@ IMPLEMENT_FUNKNOWN_METHODS(YaAttributeList,
Steinberg::Vst::IAttributeList::iid) Steinberg::Vst::IAttributeList::iid)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
std::vector<std::string> YaAttributeList::keys_and_types() const { std::vector<std::string> YaAttributeList::keys_and_types() const {
std::vector<std::string> result{}; std::vector<std::string> result{};
for (const auto& [key, value] : attrs_int_) { for (const auto& [key, value] : attrs_int_) {
result.push_back("\"" + key + "\" (int)"); result.push_back("\"" + key + "\" (int)");
+3 -6
View File
@@ -80,17 +80,14 @@ YaBStream::YaBStream(Steinberg::IBStream* stream) {
} }
} }
YaBStream::~YaBStream() noexcept { YaBStream::~YaBStream() noexcept {FUNKNOWN_DTOR}
FUNKNOWN_DTOR
}
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
IMPLEMENT_REFCOUNT(YaBStream) IMPLEMENT_REFCOUNT(YaBStream)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
tresult PLUGIN_API YaBStream::queryInterface(Steinberg::FIDString _iid, tresult PLUGIN_API YaBStream::queryInterface(Steinberg::FIDString _iid,
void** obj) { void** obj) {
QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, Steinberg::IBStream) QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, Steinberg::IBStream)
QUERY_INTERFACE(_iid, obj, Steinberg::IBStream::iid, Steinberg::IBStream) QUERY_INTERFACE(_iid, obj, Steinberg::IBStream::iid, Steinberg::IBStream)
QUERY_INTERFACE(_iid, obj, Steinberg::ISizeableStream::iid, QUERY_INTERFACE(_iid, obj, Steinberg::ISizeableStream::iid,
@@ -43,17 +43,15 @@ Vst3ComponentHandlerProxy::Vst3ComponentHandlerProxy(
arguments_(std::move(args)){FUNKNOWN_CTOR} arguments_(std::move(args)){FUNKNOWN_CTOR}
Vst3ComponentHandlerProxy::~Vst3ComponentHandlerProxy() noexcept { Vst3ComponentHandlerProxy::~Vst3ComponentHandlerProxy() noexcept {
FUNKNOWN_DTOR FUNKNOWN_DTOR}
}
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
IMPLEMENT_REFCOUNT(Vst3ComponentHandlerProxy) IMPLEMENT_REFCOUNT(Vst3ComponentHandlerProxy)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
tresult PLUGIN_API tresult PLUGIN_API Vst3ComponentHandlerProxy::queryInterface(
Vst3ComponentHandlerProxy::queryInterface(Steinberg::FIDString _iid, Steinberg::FIDString _iid,
void** obj) { void** obj) {
if (YaComponentHandler::supported()) { if (YaComponentHandler::supported()) {
QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid,
Steinberg::Vst::IComponentHandler) Steinberg::Vst::IComponentHandler)
@@ -22,17 +22,15 @@ Vst3ConnectionPointProxy::Vst3ConnectionPointProxy(
arguments_(std::move(args)){FUNKNOWN_CTOR} arguments_(std::move(args)){FUNKNOWN_CTOR}
Vst3ConnectionPointProxy::~Vst3ConnectionPointProxy() noexcept { Vst3ConnectionPointProxy::~Vst3ConnectionPointProxy() noexcept {
FUNKNOWN_DTOR FUNKNOWN_DTOR}
}
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
IMPLEMENT_REFCOUNT(Vst3ConnectionPointProxy) IMPLEMENT_REFCOUNT(Vst3ConnectionPointProxy)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
tresult PLUGIN_API tresult PLUGIN_API Vst3ConnectionPointProxy::queryInterface(
Vst3ConnectionPointProxy::queryInterface(Steinberg::FIDString _iid, Steinberg::FIDString _iid,
void** obj) { void** obj) {
if (YaConnectionPoint::supported()) { if (YaConnectionPoint::supported()) {
QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid,
Steinberg::Vst::IConnectionPoint) Steinberg::Vst::IConnectionPoint)
@@ -30,17 +30,15 @@ Vst3ContextMenuProxy::Vst3ContextMenuProxy(ConstructArgs&& args) noexcept
: YaContextMenu(std::move(args.context_menu_args)), : YaContextMenu(std::move(args.context_menu_args)),
arguments_(std::move(args)){FUNKNOWN_CTOR} arguments_(std::move(args)){FUNKNOWN_CTOR}
Vst3ContextMenuProxy::~Vst3ContextMenuProxy() noexcept { Vst3ContextMenuProxy::~Vst3ContextMenuProxy() noexcept {FUNKNOWN_DTOR}
FUNKNOWN_DTOR
}
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
IMPLEMENT_REFCOUNT(Vst3ContextMenuProxy) IMPLEMENT_REFCOUNT(Vst3ContextMenuProxy)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
tresult PLUGIN_API tresult PLUGIN_API Vst3ContextMenuProxy::queryInterface(
Vst3ContextMenuProxy::queryInterface(Steinberg::FIDString _iid, void** obj) { Steinberg::FIDString _iid,
void** obj) {
if (YaContextMenu::supported()) { if (YaContextMenu::supported()) {
QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid,
Steinberg::Vst::IContextMenu) Steinberg::Vst::IContextMenu)
@@ -19,13 +19,11 @@
YaContextMenuTarget::YaContextMenuTarget(ConstructArgs&& args) noexcept YaContextMenuTarget::YaContextMenuTarget(ConstructArgs&& args) noexcept
: arguments_(std::move(args)){FUNKNOWN_CTOR} : arguments_(std::move(args)){FUNKNOWN_CTOR}
YaContextMenuTarget::~YaContextMenuTarget() noexcept { YaContextMenuTarget::~YaContextMenuTarget() noexcept {FUNKNOWN_DTOR}
FUNKNOWN_DTOR
}
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
IMPLEMENT_FUNKNOWN_METHODS(YaContextMenuTarget, IMPLEMENT_FUNKNOWN_METHODS(YaContextMenuTarget,
Steinberg::Vst::IContextMenuTarget, Steinberg::Vst::IContextMenuTarget,
Steinberg::Vst::IContextMenuTarget::iid) Steinberg::Vst::IContextMenuTarget::iid)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
@@ -30,17 +30,15 @@ Vst3HostContextProxy::Vst3HostContextProxy(ConstructArgs&& args) noexcept
YaPlugInterfaceSupport(std::move(args.plug_interface_support_args)), YaPlugInterfaceSupport(std::move(args.plug_interface_support_args)),
arguments_(std::move(args)){FUNKNOWN_CTOR} arguments_(std::move(args)){FUNKNOWN_CTOR}
Vst3HostContextProxy::~Vst3HostContextProxy() noexcept { Vst3HostContextProxy::~Vst3HostContextProxy() noexcept {FUNKNOWN_DTOR}
FUNKNOWN_DTOR
}
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
IMPLEMENT_REFCOUNT(Vst3HostContextProxy) IMPLEMENT_REFCOUNT(Vst3HostContextProxy)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
tresult PLUGIN_API tresult PLUGIN_API Vst3HostContextProxy::queryInterface(
Vst3HostContextProxy::queryInterface(Steinberg::FIDString _iid, void** obj) { Steinberg::FIDString _iid,
void** obj) {
if (YaHostApplication::supported()) { if (YaHostApplication::supported()) {
QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid,
Steinberg::Vst::IHostApplication) Steinberg::Vst::IHostApplication)
+8 -13
View File
@@ -25,18 +25,16 @@ YaMessagePtr::YaMessagePtr(IMessage& message)
original_message_ptr_(static_cast<native_size_t>( original_message_ptr_(static_cast<native_size_t>(
reinterpret_cast<size_t>(&message))){FUNKNOWN_CTOR} reinterpret_cast<size_t>(&message))){FUNKNOWN_CTOR}
YaMessagePtr::~YaMessagePtr() noexcept { YaMessagePtr::~YaMessagePtr() noexcept {FUNKNOWN_DTOR}
FUNKNOWN_DTOR
}
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
IMPLEMENT_FUNKNOWN_METHODS(YaMessagePtr, IMPLEMENT_FUNKNOWN_METHODS(YaMessagePtr,
Steinberg::Vst::IMessage, Steinberg::Vst::IMessage,
Steinberg::Vst::IMessage::iid) Steinberg::Vst::IMessage::iid)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
Steinberg::Vst::IMessage* YaMessagePtr::get_original() const noexcept { Steinberg::Vst::IMessage
* YaMessagePtr::get_original() const noexcept {
// See the docstrings on `YaMessage` and `YaMessagePtr` // See the docstrings on `YaMessage` and `YaMessagePtr`
return reinterpret_cast<IMessage*>( return reinterpret_cast<IMessage*>(
static_cast<size_t>(original_message_ptr_)); static_cast<size_t>(original_message_ptr_));
@@ -64,10 +62,7 @@ Steinberg::Vst::IAttributeList* PLUGIN_API YaMessagePtr::getAttributes() {
YaMessage::YaMessage() noexcept {FUNKNOWN_CTOR} YaMessage::YaMessage() noexcept {FUNKNOWN_CTOR}
YaMessage::~YaMessage() noexcept { YaMessage::~YaMessage() noexcept {FUNKNOWN_DTOR}
FUNKNOWN_DTOR
}
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
IMPLEMENT_FUNKNOWN_METHODS(YaMessage, IMPLEMENT_FUNKNOWN_METHODS(YaMessage,
@@ -75,7 +70,7 @@ IMPLEMENT_FUNKNOWN_METHODS(YaMessage,
Steinberg::Vst::IMessage::iid) Steinberg::Vst::IMessage::iid)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
Steinberg::FIDString PLUGIN_API YaMessage::getMessageID() { Steinberg::FIDString PLUGIN_API YaMessage::getMessageID() {
if (message_id_) { if (message_id_) {
return message_id_->c_str(); return message_id_->c_str();
} else { } else {
@@ -27,17 +27,15 @@ Vst3PlugFrameProxy::Vst3PlugFrameProxy(ConstructArgs&& args) noexcept
: YaPlugFrame(std::move(args.plug_frame_args)), : YaPlugFrame(std::move(args.plug_frame_args)),
arguments_(std::move(args)){FUNKNOWN_CTOR} arguments_(std::move(args)){FUNKNOWN_CTOR}
Vst3PlugFrameProxy::~Vst3PlugFrameProxy() noexcept { Vst3PlugFrameProxy::~Vst3PlugFrameProxy() noexcept {FUNKNOWN_DTOR}
FUNKNOWN_DTOR
}
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
IMPLEMENT_REFCOUNT(Vst3PlugFrameProxy) IMPLEMENT_REFCOUNT(Vst3PlugFrameProxy)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
tresult PLUGIN_API Vst3PlugFrameProxy::queryInterface(Steinberg::FIDString _iid, tresult PLUGIN_API Vst3PlugFrameProxy::queryInterface(
void** obj) { Steinberg::FIDString _iid,
void** obj) {
if (YaPlugFrame::supported()) { if (YaPlugFrame::supported()) {
QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid,
Steinberg::IPlugFrame) Steinberg::IPlugFrame)
@@ -33,17 +33,15 @@ Vst3PlugViewProxy::Vst3PlugViewProxy(ConstructArgs&& args) noexcept
std::move(args.plug_view_content_scale_support_args)), std::move(args.plug_view_content_scale_support_args)),
arguments_(std::move(args)){FUNKNOWN_CTOR} arguments_(std::move(args)){FUNKNOWN_CTOR}
Vst3PlugViewProxy::~Vst3PlugViewProxy() noexcept { Vst3PlugViewProxy::~Vst3PlugViewProxy() noexcept {FUNKNOWN_DTOR}
FUNKNOWN_DTOR
}
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
IMPLEMENT_REFCOUNT(Vst3PlugViewProxy) IMPLEMENT_REFCOUNT(Vst3PlugViewProxy)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
tresult PLUGIN_API Vst3PlugViewProxy::queryInterface(Steinberg::FIDString _iid, tresult PLUGIN_API Vst3PlugViewProxy::queryInterface(
void** obj) { Steinberg::FIDString _iid,
void** obj) {
if (YaPlugView::supported()) { if (YaPlugView::supported()) {
QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid,
Steinberg::IPlugView) Steinberg::IPlugView)
@@ -27,17 +27,15 @@ Vst3PluginFactoryProxy::Vst3PluginFactoryProxy(ConstructArgs&& args) noexcept
arguments_(std::move(args)){FUNKNOWN_CTOR} arguments_(std::move(args)){FUNKNOWN_CTOR}
// clang-format just doesn't understand these macros, I guess // clang-format just doesn't understand these macros, I guess
Vst3PluginFactoryProxy::~Vst3PluginFactoryProxy() noexcept { Vst3PluginFactoryProxy::~Vst3PluginFactoryProxy() noexcept {FUNKNOWN_DTOR}
FUNKNOWN_DTOR
}
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
IMPLEMENT_REFCOUNT(Vst3PluginFactoryProxy) IMPLEMENT_REFCOUNT(Vst3PluginFactoryProxy)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
tresult PLUGIN_API tresult PLUGIN_API Vst3PluginFactoryProxy::queryInterface(
Vst3PluginFactoryProxy::queryInterface(Steinberg::FIDString _iid, void** obj) { Steinberg::FIDString _iid,
void** obj) {
if (YaPluginFactory3::supports_plugin_factory()) { if (YaPluginFactory3::supports_plugin_factory()) {
QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid,
Steinberg::IPluginFactory) Steinberg::IPluginFactory)
@@ -77,17 +77,15 @@ Vst3PluginProxy::Vst3PluginProxy(ConstructArgs&& args) noexcept
std::move(args.xml_representation_controller_args)), std::move(args.xml_representation_controller_args)),
arguments_(std::move(args)){FUNKNOWN_CTOR} arguments_(std::move(args)){FUNKNOWN_CTOR}
Vst3PluginProxy::~Vst3PluginProxy() noexcept { Vst3PluginProxy::~Vst3PluginProxy() noexcept {FUNKNOWN_DTOR}
FUNKNOWN_DTOR
}
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
IMPLEMENT_REFCOUNT(Vst3PluginProxy) IMPLEMENT_REFCOUNT(Vst3PluginProxy)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
tresult PLUGIN_API Vst3PluginProxy::queryInterface(Steinberg::FIDString _iid, tresult PLUGIN_API Vst3PluginProxy::queryInterface(
void** obj) { Steinberg::FIDString _iid,
void** obj) {
if (YaPluginBase::supported()) { if (YaPluginBase::supported()) {
// We had to expand the macro here because we need to cast through // We had to expand the macro here because we need to cast through
// `YaPluginBase`, since `IpluginBase` is also a base of `IComponent` // `YaPluginBase`, since `IpluginBase` is also a base of `IComponent`
+12 -12
View File
@@ -77,7 +77,7 @@ Vst2PluginBridge::Vst2PluginBridge(const ghc::filesystem::path& plugin_path,
set_realtime_priority(true); set_realtime_priority(true);
pthread_setname_np(pthread_self(), "host-callbacks"); pthread_setname_np(pthread_self(), "host-callbacks");
sockets_.vst_host_callback_.receive_events( sockets_.plugin_host_callback_.receive_events(
std::pair<Vst2Logger&, bool>(logger_, false), std::pair<Vst2Logger&, bool>(logger_, false),
[&](Vst2Event& event, bool /*on_main_thread*/) { [&](Vst2Event& event, bool /*on_main_thread*/) {
switch (event.opcode) { switch (event.opcode) {
@@ -178,7 +178,7 @@ Vst2PluginBridge::Vst2PluginBridge(const ghc::filesystem::path& plugin_path,
// over the `dispatcher()` socket. This would happen whenever the plugin // over the `dispatcher()` socket. This would happen whenever the plugin
// calls `audioMasterIOChanged()` and after the host calls `effOpen()`. // calls `audioMasterIOChanged()` and after the host calls `effOpen()`.
const auto initialization_data = const auto initialization_data =
sockets_.host_vst_control_.receive_single<Vst2EventResult>(); sockets_.host_plugin_control_.receive_single<Vst2EventResult>();
const auto initialized_plugin = const auto initialized_plugin =
std::get<AEffect>(initialization_data.payload); std::get<AEffect>(initialization_data.payload);
@@ -188,7 +188,7 @@ Vst2PluginBridge::Vst2PluginBridge(const ghc::filesystem::path& plugin_path,
// After receiving the `AEffect` values we'll want to send the configuration // After receiving the `AEffect` values we'll want to send the configuration
// back to complete the startup process // back to complete the startup process
sockets_.host_vst_control_.send(config_); sockets_.host_plugin_control_.send(config_);
update_aeffect(plugin_, initialized_plugin); update_aeffect(plugin_, initialized_plugin);
} }
@@ -250,7 +250,7 @@ class DispatchDataConverter : public DefaultDataConverter {
break; break;
case effEditOpen: case effEditOpen:
// The host will have passed us an X11 window handle in the void // The host will have passed us an X11 window handle in the void
// pointer. In the Wine VST host we'll create a Win32 window, // pointer. In the Wine plugin host we'll create a Win32 window,
// ask the plugin to embed itself in that and then embed that // ask the plugin to embed itself in that and then embed that
// window into this X11 window handle. // window into this X11 window handle.
return reinterpret_cast<size_t>(data); return reinterpret_cast<size_t>(data);
@@ -541,7 +541,7 @@ intptr_t Vst2PluginBridge::dispatch(AEffect* /*plugin*/,
intptr_t return_value = 0; intptr_t return_value = 0;
try { try {
// TODO: Add some kind of timeout? // TODO: Add some kind of timeout?
return_value = sockets_.host_vst_dispatch_.send_event( return_value = sockets_.host_plugin_dispatch_.send_event(
converter, std::pair<Vst2Logger&, bool>(logger_, true), converter, std::pair<Vst2Logger&, bool>(logger_, true),
opcode, index, value, data, option); opcode, index, value, data, option);
} catch (const std::system_error&) { } catch (const std::system_error&) {
@@ -617,7 +617,7 @@ intptr_t Vst2PluginBridge::dispatch(AEffect* /*plugin*/,
// and loading plugin state it's much better to have bitsery or our // and loading plugin state it's much better to have bitsery or our
// receiving function temporarily allocate a large enough buffer rather than // receiving function temporarily allocate a large enough buffer rather than
// to have a bunch of allocated memory sitting around doing nothing. // to have a bunch of allocated memory sitting around doing nothing.
return sockets_.host_vst_dispatch_.send_event( return sockets_.host_plugin_dispatch_.send_event(
converter, std::pair<Vst2Logger&, bool>(logger_, true), opcode, index, converter, std::pair<Vst2Logger&, bool>(logger_, true), opcode, index,
value, data, option); value, data, option);
} }
@@ -692,12 +692,12 @@ void Vst2PluginBridge::do_process(T** inputs, T** outputs, int sample_frames) {
// After writing audio to the shared memory buffers, we'll send the // After writing audio to the shared memory buffers, we'll send the
// processing request parameters to the Wine plugin host so it can start // processing request parameters to the Wine plugin host so it can start
// processing audio. This is why we don't need any explicit synchronisation. // processing audio. This is why we don't need any explicit synchronisation.
sockets_.host_vst_process_replacing_.send(request); sockets_.host_plugin_process_replacing_.send(request);
// From the Wine side we'll send a zero byte struct back as an // From the Wine side we'll send a zero byte struct back as an
// acknowledgement that audio processing has finished. At this point the // acknowledgement that audio processing has finished. At this point the
// audio will have been written to our buffers. // audio will have been written to our buffers.
sockets_.host_vst_process_replacing_.receive_single<Ack>(); sockets_.host_plugin_process_replacing_.receive_single<Ack>();
for (int channel = 0; channel < plugin_.numOutputs; channel++) { for (int channel = 0; channel < plugin_.numOutputs; channel++) {
const T* output_channel = const T* output_channel =
@@ -777,10 +777,10 @@ float Vst2PluginBridge::get_parameter(AEffect* /*plugin*/, int index) {
// called at the same time since they share the same socket // called at the same time since they share the same socket
{ {
std::lock_guard lock(parameters_mutex_); std::lock_guard lock(parameters_mutex_);
sockets_.host_vst_parameters_.send(request); sockets_.host_plugin_parameters_.send(request);
response = response =
sockets_.host_vst_parameters_.receive_single<ParameterResult>(); sockets_.host_plugin_parameters_.receive_single<ParameterResult>();
} }
logger_.log_get_parameter_response(*response.value); logger_.log_get_parameter_response(*response.value);
@@ -798,10 +798,10 @@ void Vst2PluginBridge::set_parameter(AEffect* /*plugin*/,
{ {
std::lock_guard lock(parameters_mutex_); std::lock_guard lock(parameters_mutex_);
sockets_.host_vst_parameters_.send(request); sockets_.host_plugin_parameters_.send(request);
response = response =
sockets_.host_vst_parameters_.receive_single<ParameterResult>(); sockets_.host_plugin_parameters_.receive_single<ParameterResult>();
} }
logger_.log_set_parameter_response(); logger_.log_set_parameter_response();
+2 -2
View File
@@ -27,8 +27,8 @@
/** /**
* This handles the communication between the Linux native VST2 plugin and the * This handles the communication between the Linux native VST2 plugin and the
* Wine VST host. The functions below should be used as callback functions in an * Wine plugin host. The functions below should be used as callback functions in
* `AEffect` object. * an `AEffect` object.
* *
* The naming scheme of all of these 'bridge' classes is `<type>{,Plugin}Bridge` * The naming scheme of all of these 'bridge' classes is `<type>{,Plugin}Bridge`
* for greppability reasons. The `Plugin` infix is added on the native plugin * for greppability reasons. The `Plugin` infix is added on the native plugin
+3 -3
View File
@@ -46,13 +46,13 @@ Vst3PluginBridge::Vst3PluginBridge(const ghc::filesystem::path& plugin_path)
// Now that communication is set up the Wine host can send callbacks to this // Now that communication is set up the Wine host can send callbacks to this
// bridge class, and we can send control messages to the Wine host. This // bridge class, and we can send control messages to the Wine host. This
// messaging mechanism is how we relay the VST3 communication protocol. As a // messaging mechanism is how we relay the VST3 communication protocol. As a
// first thing, the Wine VST host will ask us for a copy of the // first thing, the Wine plugin host will ask us for a copy of the
// configuration. // configuration.
host_callback_handler_ = std::jthread([&]() { host_callback_handler_ = std::jthread([&]() {
set_realtime_priority(true); set_realtime_priority(true);
pthread_setname_np(pthread_self(), "host-callbacks"); pthread_setname_np(pthread_self(), "host-callbacks");
sockets_.vst_host_callback_.receive_messages( sockets_.plugin_host_callback_.receive_messages(
std::pair<Vst3Logger&, bool>(logger_, false), std::pair<Vst3Logger&, bool>(logger_, false),
overload{ overload{
[&](const Vst3ContextMenuProxy::Destruct& request) [&](const Vst3ContextMenuProxy::Destruct& request)
@@ -435,7 +435,7 @@ Steinberg::IPluginFactory* Vst3PluginBridge::get_plugin_factory() {
// have started before this since the Wine plugin host will request a // have started before this since the Wine plugin host will request a
// copy of the configuration during its initialization. // copy of the configuration during its initialization.
Vst3PluginFactoryProxy::ConstructArgs factory_args = Vst3PluginFactoryProxy::ConstructArgs factory_args =
sockets_.host_vst_control_.send_message( sockets_.host_plugin_control_.send_message(
Vst3PluginFactoryProxy::Construct{}, Vst3PluginFactoryProxy::Construct{},
std::pair<Vst3Logger&, bool>(logger_, true)); std::pair<Vst3Logger&, bool>(logger_, true));
plugin_factory_ = Steinberg::owned( plugin_factory_ = Steinberg::owned(
+4 -4
View File
@@ -117,15 +117,15 @@ class Vst3PluginBridge : PluginBridge<Vst3Sockets<std::jthread>> {
/** /**
* Send a control message to the Wine plugin host and return the response. * Send a control message to the Wine plugin host and return the response.
* This is a shorthand for `sockets_.host_vst_control_.send_message()` for * This is a shorthand for `sockets_.host_plugin_control_.send_message()`
* use in VST3 interface implementations. This is mostly used for main * for use in VST3 interface implementations. This is mostly used for main
* thread messages but outside of the situations where plugins will crash or * thread messages but outside of the situations where plugins will crash or
* misbehave thread guarantees are not always upheld in yabridge's VST3 * misbehave thread guarantees are not always upheld in yabridge's VST3
* implementation. * implementation.
*/ */
template <typename T> template <typename T>
typename T::Response send_message(const T& object) { typename T::Response send_message(const T& object) {
return sockets_.host_vst_control_.send_message( return sockets_.host_plugin_control_.send_message(
object, std::pair<Vst3Logger&, bool>(logger_, true)); object, std::pair<Vst3Logger&, bool>(logger_, true));
} }
@@ -199,7 +199,7 @@ class Vst3PluginBridge : PluginBridge<Vst3Sockets<std::jthread>> {
private: private:
/** /**
* Handles callbacks from the plugin to the host over the * Handles callbacks from the plugin to the host over the
* `vst_host_callback_` sockets. * `plugin_host_callback_` sockets.
*/ */
std::jthread host_callback_handler_; std::jthread host_callback_handler_;
+4 -4
View File
@@ -107,8 +107,8 @@ IndividualHost::IndividualHost(asio::io_context& io_context,
const HostRequest& host_request) const HostRequest& host_request)
: HostProcess(io_context, sockets), : HostProcess(io_context, sockets),
plugin_info_(plugin_info), plugin_info_(plugin_info),
host_path_(find_vst_host(plugin_info.native_library_path_, host_path_(find_plugin_host(plugin_info.native_library_path_,
plugin_info.plugin_arch_)), plugin_info.plugin_arch_)),
handle_(launch_host( handle_(launch_host(
host_path_, host_path_,
{ {
@@ -168,8 +168,8 @@ GroupHost::GroupHost(asio::io_context& io_context,
const HostRequest& host_request) const HostRequest& host_request)
: HostProcess(io_context, sockets), : HostProcess(io_context, sockets),
plugin_info_(plugin_info), plugin_info_(plugin_info),
host_path_(find_vst_host(plugin_info.native_library_path_, host_path_(find_plugin_host(plugin_info.native_library_path_,
plugin_info.plugin_arch_)) { plugin_info.plugin_arch_)) {
// When using plugin groups, we'll first try to connect to an existing group // When using plugin groups, we'll first try to connect to an existing group
// host process and ask it to host our plugin. If no such process exists, // host process and ask it to host our plugin. If no such process exists,
// then we'll start a new process. In the event that multiple yabridge // then we'll start a new process. In the event that multiple yabridge
+4 -4
View File
@@ -307,8 +307,8 @@ std::string create_logger_prefix(const fs::path& endpoint_base_dir) {
return "[" + endpoint_name + "] "; return "[" + endpoint_name + "] ";
} }
fs::path find_vst_host(const ghc::filesystem::path& this_plugin_path, fs::path find_plugin_host(const ghc::filesystem::path& this_plugin_path,
LibArchitecture plugin_arch) { LibArchitecture plugin_arch) {
auto host_name = yabridge_host_name; auto host_name = yabridge_host_name;
if (plugin_arch == LibArchitecture::dll_32) { if (plugin_arch == LibArchitecture::dll_32) {
host_name = yabridge_host_name_32bit; host_name = yabridge_host_name_32bit;
@@ -322,9 +322,9 @@ fs::path find_vst_host(const ghc::filesystem::path& this_plugin_path,
return host_path; return host_path;
} }
if (const std::optional<fs::path> vst_host_path = if (const std::optional<fs::path> plugin_host_path =
search_in_path(get_augmented_search_path(), host_name)) { search_in_path(get_augmented_search_path(), host_name)) {
return *vst_host_path; return *plugin_host_path;
} else { } else {
throw std::runtime_error("Could not locate '" + std::string(host_name) + throw std::runtime_error("Could not locate '" + std::string(host_name) +
"'"); "'");
+16 -14
View File
@@ -45,8 +45,9 @@ struct PluginInfo {
public: public:
/** /**
* Locate the Windows plugin based on the location of this copy of * Locate the Windows plugin based on the location of this copy of
* `libyabridge-{clap,vst2,vst3}.so` file and the type of the plugin we're going * `libyabridge-{clap,vst2,vst3}.so` file and the type of the plugin we're
* to load. For VST2 plugins this is a file with the same name but with a * going to load. For VST2 plugins this is a file with the same name but
* with a
* `.dll` file extension instead of `.so`. In case this file does not exist * `.dll` file extension instead of `.so`. In case this file does not exist
* and the `.so` file is a symlink, we'll also repeat this check for the * and the `.so` file is a symlink, we'll also repeat this check for the
* file it links to. This is to support the workflow described in issue #3 * file it links to. This is to support the workflow described in issue #3
@@ -181,13 +182,14 @@ std::string create_logger_prefix(
const ghc::filesystem::path& endpoint_base_dir); const ghc::filesystem::path& endpoint_base_dir);
/** /**
* Finds the Wine VST host (either `yabridge-host.exe` or `yabridge-host-32.exe` * Finds the Wine plugin host (either `yabridge-host.exe` or
* depending on the plugin). For this we will search in two places: * `yabridge-host-32.exe` depending on the plugin). For this we will search in
* two places:
* *
* 1. Alongside libyabridge-{clap,vst2,vst3}.so if the file got symlinked. This is * 1. Alongside libyabridge-{clap,vst2,vst3}.so if the file got symlinked.
* useful when developing, as you can simply symlink the * This is useful when developing, as you can simply symlink the
* `libyabridge-{clap,vst2,vst3}.so` file in the build directory without having * `libyabridge-{clap,vst2,vst3}.so` file in the build directory without
* to install anything to /usr. * having to install anything to /usr.
* 2. In the regular search path, augmented with `~/.local/share/yabridge` to * 2. In the regular search path, augmented with `~/.local/share/yabridge` to
* ease the setup process. * ease the setup process.
* *
@@ -197,9 +199,9 @@ std::string create_logger_prefix(
* Used to determine which host application to use, if available. * Used to determine which host application to use, if available.
* *
* @return The a path to the VST host, if found. * @return The a path to the VST host, if found.
* @throw std::runtime_error If the Wine VST host could not be found. * @throw std::runtime_error If the Wine plugin host could not be found.
*/ */
ghc::filesystem::path find_vst_host( ghc::filesystem::path find_plugin_host(
const ghc::filesystem::path& this_plugin_path, const ghc::filesystem::path& this_plugin_path,
LibArchitecture plugin_arch); LibArchitecture plugin_arch);
@@ -228,10 +230,10 @@ ghc::filesystem::path generate_group_endpoint(
/** /**
* Load the configuration that belongs to a copy of or symlink to * Load the configuration that belongs to a copy of or symlink to
* `libyabridge-{clap,vst2,vst3}.so`. If no configuration file could be found then * `libyabridge-{clap,vst2,vst3}.so`. If no configuration file could be found
* this will return an empty configuration object with default settings. See the * then this will return an empty configuration object with default settings.
* docstrong on the `Configuration` class for more details on how to choose the * See the docstrong on the `Configuration` class for more details on how to
* config file to load. * choose the config file to load.
* *
* This function will take any optional compile-time features that have not been * This function will take any optional compile-time features that have not been
* enabled into account. * enabled into account.
+9 -9
View File
@@ -216,14 +216,14 @@ Vst2Bridge::Vst2Bridge(MainContext& main_context,
// done after the host calls `effOpen()`, and when the plugin calls // done after the host calls `effOpen()`, and when the plugin calls
// `audioMasterIOChanged()`. We will also send along this host's version so // `audioMasterIOChanged()`. We will also send along this host's version so
// we can show a warning when the plugin's version doesn't match. // we can show a warning when the plugin's version doesn't match.
sockets_.host_vst_control_.send( sockets_.host_plugin_control_.send(
Vst2EventResult{.return_value = 0, Vst2EventResult{.return_value = 0,
.payload = *plugin_, .payload = *plugin_,
.value_payload = yabridge_git_version}); .value_payload = yabridge_git_version});
// After sending the AEffect struct we'll receive this instance's // After sending the AEffect struct we'll receive this instance's
// configuration as a response // configuration as a response
config_ = sockets_.host_vst_control_.receive_single<Configuration>(); config_ = sockets_.host_plugin_control_.receive_single<Configuration>();
// Allow this plugin to configure the main context's tick rate // Allow this plugin to configure the main context's tick rate
main_context.update_timer_interval(config_.event_loop_interval()); main_context.update_timer_interval(config_.event_loop_interval());
@@ -232,7 +232,7 @@ Vst2Bridge::Vst2Bridge(MainContext& main_context,
set_realtime_priority(true); set_realtime_priority(true);
pthread_setname_np(pthread_self(), "parameters"); pthread_setname_np(pthread_self(), "parameters");
sockets_.host_vst_parameters_.receive_multi<Parameter>( sockets_.host_plugin_parameters_.receive_multi<Parameter>(
[&](Parameter& request, SerializationBufferBase& buffer) { [&](Parameter& request, SerializationBufferBase& buffer) {
// Both `getParameter` and `setParameter` functions are passed // Both `getParameter` and `setParameter` functions are passed
// through on this socket since they have a lot of overlap. The // through on this socket since they have a lot of overlap. The
@@ -244,13 +244,13 @@ Vst2Bridge::Vst2Bridge(MainContext& main_context,
*request.value); *request.value);
ParameterResult response{std::nullopt}; ParameterResult response{std::nullopt};
sockets_.host_vst_parameters_.send(response, buffer); sockets_.host_plugin_parameters_.send(response, buffer);
} else { } else {
// `getParameter` // `getParameter`
float value = plugin_->getParameter(plugin_, request.index); float value = plugin_->getParameter(plugin_, request.index);
ParameterResult response{value}; ParameterResult response{value};
sockets_.host_vst_parameters_.send(response, buffer); sockets_.host_plugin_parameters_.send(response, buffer);
} }
}); });
}); });
@@ -264,7 +264,7 @@ Vst2Bridge::Vst2Bridge(MainContext& main_context,
// they start producing denormals // they start producing denormals
ScopedFlushToZero ftz_guard; ScopedFlushToZero ftz_guard;
sockets_.host_vst_process_replacing_.receive_multi< sockets_.host_plugin_process_replacing_.receive_multi<
Vst2ProcessRequest>([&](Vst2ProcessRequest& process_request, Vst2ProcessRequest>([&](Vst2ProcessRequest& process_request,
SerializationBufferBase& buffer) { SerializationBufferBase& buffer) {
// Since the value cannot change during this processing cycle, // Since the value cannot change during this processing cycle,
@@ -370,7 +370,7 @@ Vst2Bridge::Vst2Bridge(MainContext& main_context,
// so we can just send that object back. Like on the plugin side // so we can just send that object back. Like on the plugin side
// we cannot reuse the request object because a plugin may have // we cannot reuse the request object because a plugin may have
// a different number of input and output channels // a different number of input and output channels
sockets_.host_vst_process_replacing_.send(Ack{}, buffer); sockets_.host_plugin_process_replacing_.send(Ack{}, buffer);
// See the docstrong on `should_clear_midi_events` for why we // See the docstrong on `should_clear_midi_events` for why we
// don't just clear `next_buffer_midi_events` here // don't just clear `next_buffer_midi_events` here
@@ -388,7 +388,7 @@ bool Vst2Bridge::inhibits_event_loop() noexcept {
void Vst2Bridge::run() { void Vst2Bridge::run() {
set_realtime_priority(true); set_realtime_priority(true);
sockets_.host_vst_dispatch_.receive_events( sockets_.host_plugin_dispatch_.receive_events(
std::nullopt, std::nullopt,
[&](Vst2Event& event, bool /*on_main_thread*/) -> Vst2EventResult { [&](Vst2Event& event, bool /*on_main_thread*/) -> Vst2EventResult {
if (event.opcode == effProcessEvents) { if (event.opcode == effProcessEvents) {
@@ -706,7 +706,7 @@ intptr_t Vst2Bridge::host_callback(AEffect* effect,
HostCallbackDataConverter converter(effect, last_time_info_, HostCallbackDataConverter converter(effect, last_time_info_,
mutual_recursion_); mutual_recursion_);
return sockets_.vst_host_callback_.send_event( return sockets_.plugin_host_callback_.send_event(
converter, std::nullopt, opcode, index, value, data, option); converter, std::nullopt, opcode, index, value, data, option);
} }
+2 -2
View File
@@ -104,7 +104,7 @@ Vst3Bridge::Vst3Bridge(MainContext& main_context,
// Fetch this instance's configuration from the plugin to finish the setup // Fetch this instance's configuration from the plugin to finish the setup
// process // process
config_ = sockets_.vst_host_callback_.send_message( config_ = sockets_.plugin_host_callback_.send_message(
WantsConfiguration{.host_version = yabridge_git_version}, std::nullopt); WantsConfiguration{.host_version = yabridge_git_version}, std::nullopt);
// Allow this plugin to configure the main context's tick rate // Allow this plugin to configure the main context's tick rate
@@ -126,7 +126,7 @@ bool Vst3Bridge::inhibits_event_loop() noexcept {
void Vst3Bridge::run() { void Vst3Bridge::run() {
set_realtime_priority(true); set_realtime_priority(true);
sockets_.host_vst_control_.receive_messages( sockets_.host_plugin_control_.receive_messages(
std::nullopt, std::nullopt,
overload{ overload{
[&](const Vst3PluginFactoryProxy::Construct&) [&](const Vst3PluginFactoryProxy::Construct&)
+4 -3
View File
@@ -331,12 +331,13 @@ class Vst3Bridge : public HostBridge {
public: public:
/** /**
* Send a callback message to the host return the response. This is a * Send a callback message to the host return the response. This is a
* shorthand for `sockets.vst_host_callback_.send_message` for use in VST3 * shorthand for `sockets.plugin_host_callback_.send_message` for use in
* interface implementations. * VST3 interface implementations.
*/ */
template <typename T> template <typename T>
typename T::Response send_message(const T& object) { typename T::Response send_message(const T& object) {
return sockets_.vst_host_callback_.send_message(object, std::nullopt); return sockets_.plugin_host_callback_.send_message(object,
std::nullopt);
} }
/** /**