From 4ca7ea17b2f0b26be93f1b81eadb878fc237741b Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 23 Aug 2022 18:34:03 +0200 Subject: [PATCH] Change terminology from 'VST' to 'plugin' --- meson.build | 2 +- meson_options.txt | 2 +- src/common/communication/common.h | 26 +- src/common/communication/vst2.h | 67 +- src/common/communication/vst3.h | 36 +- src/common/configuration.h | 4 +- src/common/linking.h | 10 +- src/common/logging/common.h | 4 +- src/common/logging/vst3.cpp | 627 +++++++++--------- src/common/logging/vst3.h | 345 +++++----- src/common/mutual-recursion.h | 6 +- src/common/serialization/vst2.h | 12 +- src/common/serialization/vst3.h | 8 +- .../serialization/vst3/attribute-list.cpp | 7 +- src/common/serialization/vst3/bstream.cpp | 9 +- .../vst3/component-handler-proxy.cpp | 12 +- .../vst3/connection-point-proxy.cpp | 12 +- .../serialization/vst3/context-menu-proxy.cpp | 12 +- .../vst3/context-menu-target.cpp | 10 +- .../serialization/vst3/host-context-proxy.cpp | 12 +- src/common/serialization/vst3/message.cpp | 21 +- .../serialization/vst3/plug-frame-proxy.cpp | 12 +- .../serialization/vst3/plug-view-proxy.cpp | 12 +- .../vst3/plugin-factory-proxy.cpp | 12 +- .../serialization/vst3/plugin-proxy.cpp | 12 +- src/plugin/bridges/vst2.cpp | 24 +- src/plugin/bridges/vst2.h | 4 +- src/plugin/bridges/vst3.cpp | 6 +- src/plugin/bridges/vst3.h | 8 +- src/plugin/host-process.cpp | 8 +- src/plugin/utils.cpp | 8 +- src/plugin/utils.h | 30 +- src/wine-host/bridges/vst2.cpp | 18 +- src/wine-host/bridges/vst3.cpp | 4 +- src/wine-host/bridges/vst3.h | 7 +- 35 files changed, 703 insertions(+), 706 deletions(-) diff --git a/meson.build b/meson.build index dd1d6904..bee402c6 100644 --- a/meson.build +++ b/meson.build @@ -107,7 +107,7 @@ if with_clap compiler_options += '-DWITH_CLAP' 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 if with_winedbg compiler_options += '-DWITH_WINEDBG' diff --git a/meson_options.txt b/meson_options.txt index 2dde560f..f2c28f2a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -35,5 +35,5 @@ option( 'winedbg', type : 'boolean', 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.' ) diff --git a/src/common/communication/common.h b/src/common/communication/common.h index aa55386b..3684f95c 100644 --- a/src/common/communication/common.h +++ b/src/common/communication/common.h @@ -591,7 +591,7 @@ class AdHocSocketHandler { // As mentioned in `acceptor's` docstring, this acceptor will be // recreated in `receive_multi()` on another context, and // 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(); ghc::filesystem::remove(endpoint_.path()); } else { @@ -869,10 +869,10 @@ class AdHocSocketHandler { * during `Sockets::connect()`. When `AdHocSocketHandler::receive_multi()` * is then called, we'll recreate the acceptor to asynchronously listen for * new incoming socket connections on `endpoint` using. This is important, - * because on the case of `Vst2Sockets`'s' `vst_host_callback_` the acceptor - * is first accepts an initial socket on the plugin side (like all sockets), - * but all additional incoming connections of course have to be listened for - * on the plugin side. + * because on the case of `Vst2Sockets`'s' `plugin_host_callback_` the + * acceptor is first accepts an initial socket on the plugin side (like all + * sockets), but all additional incoming connections of course have to be + * listened for on the plugin side. */ std::optional acceptor_; @@ -1010,8 +1010,8 @@ class TypedMessageHandler : public AdHocSocketHandler { // only print the responses when the request was not filtered out. bool should_log_response = false; if (logging) { - auto [logger, is_host_vst] = *logging; - should_log_response = logger.log_request(is_host_vst, object); + auto [logger, is_host_plugin] = *logging; + should_log_response = logger.log_request(is_host_plugin, object); } // A socket only handles a single request at a time as to prevent @@ -1024,8 +1024,8 @@ class TypedMessageHandler : public AdHocSocketHandler { }); if (should_log_response) { - auto [logger, is_host_vst] = *logging; - logger.log_response(!is_host_vst, response_object); + auto [logger, is_host_plugin] = *logging; + logger.log_response(!is_host_plugin, response_object); } return response_object; @@ -1111,8 +1111,8 @@ class TypedMessageHandler : public AdHocSocketHandler { if (logging) { should_log_response = std::visit( [&](const auto& object) { - auto [logger, is_host_vst] = *logging; - return logger.log_request(is_host_vst, object); + auto [logger, is_host_plugin] = *logging; + return logger.log_request(is_host_plugin, object); }, // In the case of `AudioProcessorRequest`, we need to // actually fetch the variant field since our object @@ -1130,8 +1130,8 @@ class TypedMessageHandler : public AdHocSocketHandler { typename T::Response response = callback(object); if (should_log_response) { - auto [logger, is_host_vst] = *logging; - logger.log_response(!is_host_vst, response); + auto [logger, is_host_plugin] = *logging; + logger.log_response(!is_host_plugin, response); } if constexpr (persistent_buffers) { diff --git a/src/common/communication/vst2.h b/src/common/communication/vst2.h index 33435400..dc112191 100644 --- a/src/common/communication/vst2.h +++ b/src/common/communication/vst2.h @@ -322,8 +322,8 @@ class Vst2EventHandler : public AdHocSocketHandler { * Wine host when hosting a VST2 plugin. * * 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 - * sockets, and the call to `connect()` will then accept any incoming + * `true` before launching the Wine plugin host. This will start listening on + * the sockets, and the call to `connect()` will then accept any incoming * connections. * * @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, bool listen) : Sockets(endpoint_base_dir), - host_vst_dispatch_(io_context, - (base_dir_ / "host_vst_dispatch.sock").string(), - listen), - vst_host_callback_(io_context, - (base_dir_ / "vst_host_callback.sock").string(), - listen), - host_vst_parameters_( + host_plugin_dispatch_( io_context, - (base_dir_ / "host_vst_parameters.sock").string(), + (base_dir_ / "host_plugin_dispatch.sock").string(), listen), - host_vst_process_replacing_( + plugin_host_callback_( io_context, - (base_dir_ / "host_vst_process_replacing.sock").string(), + (base_dir_ / "plugin_host_callback.sock").string(), listen), - host_vst_control_(io_context, - (base_dir_ / "host_vst_control.sock").string(), - listen) {} + host_plugin_parameters_( + io_context, + (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(); } void connect() override { - host_vst_dispatch_.connect(); - vst_host_callback_.connect(); - host_vst_parameters_.connect(); - host_vst_process_replacing_.connect(); - host_vst_control_.connect(); + host_plugin_dispatch_.connect(); + plugin_host_callback_.connect(); + host_plugin_parameters_.connect(); + host_plugin_process_replacing_.connect(); + host_plugin_control_.connect(); } void close() override { // Manually close all sockets so we break out of any blocking operations // that may still be active - host_vst_dispatch_.close(); - vst_host_callback_.close(); - host_vst_parameters_.close(); - host_vst_process_replacing_.close(); - host_vst_control_.close(); + host_plugin_dispatch_.close(); + plugin_host_callback_.close(); + host_plugin_parameters_.close(); + host_plugin_process_replacing_.close(); + host_plugin_control_.close(); } // The naming convention for these sockets is `__`. 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 - // 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 plugin. */ - Vst2EventHandler host_vst_dispatch_; + Vst2EventHandler host_plugin_dispatch_; /** * The socket that forwards all `audioMaster()` calls from the Windows VST * plugin to the host. */ - Vst2EventHandler vst_host_callback_; + Vst2EventHandler plugin_host_callback_; /** * Used for both `getParameter` and `setParameter` since they mostly * overlap. */ - SocketHandler host_vst_parameters_; + SocketHandler host_plugin_parameters_; /** * Used for processing audio usign the `process()`, `processReplacing()` and * `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 * 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. */ - SocketHandler host_vst_control_; + SocketHandler host_plugin_control_; }; /** diff --git a/src/common/communication/vst3.h b/src/common/communication/vst3.h index ecd54d45..cf2f422a 100644 --- a/src/common/communication/vst3.h +++ b/src/common/communication/vst3.h @@ -28,8 +28,8 @@ * Wine host when hosting a VST3 plugin. * * 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 - * sockets, and the call to `connect()` will then accept any incoming + * `true` before launching the Wine plugin host. This will start listening on + * the sockets, and the call to `connect()` will then accept any incoming * connections. * * 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, bool listen) : Sockets(endpoint_base_dir), - host_vst_control_(io_context, - (base_dir_ / "host_vst_control.sock").string(), - listen), - vst_host_callback_(io_context, - (base_dir_ / "vst_host_callback.sock").string(), - listen), + host_plugin_control_( + io_context, + (base_dir_ / "host_plugin_control.sock").string(), + listen), + plugin_host_callback_( + io_context, + (base_dir_ / "plugin_host_callback.sock").string(), + listen), io_context_(io_context) {} // NOLINTNEXTLINE(clang-analyzer-optin.cplusplus.VirtualCall) ~Vst3Sockets() noexcept override { close(); } void connect() override { - host_vst_control_.connect(); - vst_host_callback_.connect(); + host_plugin_control_.connect(); + plugin_host_callback_.connect(); } void close() override { // Manually close all sockets so we break out of any blocking operations // that may still be active - host_vst_control_.close(); - vst_host_callback_.close(); + host_plugin_control_.close(); + plugin_host_callback_.close(); // This map should be empty at this point, but who knows 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_); audio_processor_sockets_.try_emplace( instance_id, io_context_, - (base_dir_ / ("host_vst_audio_processor_" + + (base_dir_ / ("host_plugin_audio_processor_" + std::to_string(instance_id) + ".sock")) .string(), false); @@ -140,7 +142,7 @@ class Vst3Sockets final : public Sockets { std::lock_guard lock(audio_processor_sockets_mutex_); audio_processor_sockets_.try_emplace( instance_id, io_context_, - (base_dir_ / ("host_vst_audio_processor_" + + (base_dir_ / ("host_plugin_audio_processor_" + std::to_string(instance_id) + ".sock")) .string(), true); @@ -237,14 +239,16 @@ class Vst3Sockets final : public Sockets { * This will be listened on by the Wine plugin host when it calls * `receive_multi()`. */ - TypedMessageHandler host_vst_control_; + TypedMessageHandler + host_plugin_control_; /** * 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 * want to provide an abstraction similar to `Vst2EventHandler`. */ - TypedMessageHandler vst_host_callback_; + TypedMessageHandler + plugin_host_callback_; private: /** diff --git a/src/common/configuration.h b/src/common/configuration.h index 5c0fcf55..aa16ffc1 100644 --- a/src/common/configuration.h +++ b/src/common/configuration.h @@ -31,8 +31,8 @@ * 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 - * to the copy of or symlink to `libyabridge-{clap,vst2,vst3}.so` that the plugin - * host has tried to load. + * to the copy of or symlink to `libyabridge-{clap,vst2,vst3}.so` that the + * plugin host has tried to load. * 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 * until we either find the file or we reach the filesystem root. diff --git a/src/common/linking.h b/src/common/linking.h index f645248b..22a99305 100644 --- a/src/common/linking.h +++ b/src/common/linking.h @@ -23,10 +23,10 @@ /** * 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` - * was loaded so we can search for a matching Windows plugin library. When the - * chainloaders are used, this path should be passed to the chainloaded plugin - * library using the provided exported functions since they can't detect the - * path themselves. + * this copy of `libyabridge-{clap,vst2,vst3}.so` or + * `libyabridge-chainloader-*.so` was loaded so we can search for a matching + * Windows plugin library. When the chainloaders are used, this path should be + * passed to the chainloaded plugin library using the provided exported + * functions since they can't detect the path themselves. */ ghc::filesystem::path get_this_file_location(); diff --git a/src/common/logging/common.h b/src/common/logging/common.h index df515016..fcd37927 100644 --- a/src/common/logging/common.h +++ b/src/common/logging/common.h @@ -86,8 +86,8 @@ class Logger { * editor window handling. If we end up adding more of these options, we * should move to a bitfield or something. * @param prefix An optional prefix for the logger. Useful for differentiate - * messages coming from the Wine VST host. Should end with a single space - * character. + * messages coming from the Wine plugin host. Should end with a single + * space character. * @param prefix_timestamp Whether the log messages should be prefixed with * a timestamp. The timestamp is added before `prefix`. This is set to * `false` in `create_wine_stderr()` because otherwise you would end up diff --git a/src/common/logging/vst3.cpp b/src/common/logging/vst3.cpp index f9caab4c..6c7b87e5 100644 --- a/src/common/logging/vst3.cpp +++ b/src/common/logging/vst3.cpp @@ -75,24 +75,25 @@ void Vst3Logger::log_query_interface( } } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const Vst3PluginFactoryProxy::Construct&) { - return log_request_base( - is_host_vst, [&](auto& message) { message << "GetPluginFactory()"; }); + return log_request_base(is_host_plugin, [&](auto& message) { + message << "GetPluginFactory()"; + }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const Vst3PlugViewProxy::Destruct& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { // We don't know what class this instance was originally instantiated // as, but it also doesn't really matter message << request.owner_instance_id << ": IPlugView::~IPlugView()"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const Vst3PluginProxy::Construct& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << "IPluginFactory::createInstance(cid = " << format_uid(Steinberg::FUID::fromTUID( request.cid.native_uid().data())) @@ -109,27 +110,27 @@ bool Vst3Logger::log_request(bool is_host_vst, }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const Vst3PluginProxy::Destruct& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { // We don't know what class this instance was originally instantiated // as, but it also doesn't really matter message << request.instance_id << ": FUnknown::~FUnknown()"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const Vst3PluginProxy::SetState& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": {IComponent,IEditController}::setState(state = " << format_bstream(request.state) << ")"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const Vst3PluginProxy::GetState& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": {IComponent,IEditController}::getState(state = " << format_bstream(request.state) << ")"; @@ -137,10 +138,10 @@ bool Vst3Logger::log_request(bool is_host_vst, } bool Vst3Logger::log_request( - bool is_host_vst, + bool is_host_plugin, const YaAudioPresentationLatency::SetAudioPresentationLatencySamples& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": " "IAudioPresentationLatency::" @@ -151,9 +152,9 @@ bool Vst3Logger::log_request( } bool Vst3Logger::log_request( - bool is_host_vst, + bool is_host_plugin, const YaAutomationState::SetAutomationState& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": " "IAutomationState::setAutomationState(state = " @@ -161,9 +162,9 @@ bool Vst3Logger::log_request( }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaConnectionPoint::Connect& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IConnectionPoint::connect(other = "; std::visit( @@ -179,9 +180,9 @@ bool Vst3Logger::log_request(bool is_host_vst, }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaConnectionPoint::Disconnect& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IConnectionPoint::disconnect(other = "; if (request.other_instance_id) { @@ -194,9 +195,9 @@ bool Vst3Logger::log_request(bool is_host_vst, }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaConnectionPoint::Notify& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { // We can safely print the pointer as long we don't dereference it message << request.instance_id << ": IConnectionPoint::notify(message = )"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaPluginBase::Terminate& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IPluginBase::terminate()"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaPluginFactory3::SetHostContext&) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << "IPluginFactory3::setHostContext(context = )"; }); } bool Vst3Logger::log_request( - bool is_host_vst, + bool is_host_plugin, const YaProcessContextRequirements::GetProcessContextRequirements&) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << "IProcessContextRequirements::getProcessContextRequirements()"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaProgramListData::ProgramDataSupported&) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << "IProgramListData::programDataSupported()"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaProgramListData::GetProgramData& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << "IProgramListData::getProgramData(listId = " << request.list_id << ", programIndex = " << request.program_index @@ -747,9 +748,9 @@ bool Vst3Logger::log_request(bool is_host_vst, }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaProgramListData::SetProgramData& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << "IProgramListData::setProgramData(listId = " << request.list_id << ", programIndex = " << request.program_index @@ -757,73 +758,73 @@ bool Vst3Logger::log_request(bool is_host_vst, }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaUnitData::UnitDataSupported&) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << "IUnitData::unitDataSupported()"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaUnitData::GetUnitData& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << "IUnitData::getUnitData(listId = " << request.unit_id << ", data = " << format_bstream(request.data) << ")"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaUnitData::SetUnitData& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << "IUnitData::setUnitData(listId = " << request.unit_id << ", data = " << format_bstream(request.data) << ")"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaUnitInfo::GetUnitCount& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IUnitInfo::getUnitCount()"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaUnitInfo::GetUnitInfo& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IUnitInfo::getUnitInfo(unitIndex = " << request.unit_index << ", &info)"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaUnitInfo::GetProgramListCount& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IUnitInfo::getProgramListCount()"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaUnitInfo::GetProgramListInfo& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IUnitInfo::getProgramListInfo(listIndex = " << request.list_index << ", &info)"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaUnitInfo::GetProgramName& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IUnitInfo::getProgramName(listId = " << request.list_id << ", programIndex = " << request.program_index << ", &name)"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaUnitInfo::GetProgramInfo& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IUnitInfo::getProgramInfo(listId = " << request.list_id << ", programIndex = " << request.program_index @@ -832,9 +833,9 @@ bool Vst3Logger::log_request(bool is_host_vst, }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaUnitInfo::HasProgramPitchNames& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IUnitInfo::hasProgramPitchNames(listId = " << request.list_id @@ -842,9 +843,9 @@ bool Vst3Logger::log_request(bool is_host_vst, }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaUnitInfo::GetProgramPitchName& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IUnitInfo::getProgramPitchName(listId = " << request.list_id @@ -853,25 +854,25 @@ bool Vst3Logger::log_request(bool is_host_vst, }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaUnitInfo::GetSelectedUnit& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IUnitInfo::getSelectedUnit()"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaUnitInfo::SelectUnit& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IUnitInfo::selectUnit(unitId = " << request.unit_id << ")"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaUnitInfo::GetUnitByBus& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IUnitInfo::getUnitByBus(type = " << request.type << ", dir = " << request.dir @@ -880,9 +881,9 @@ bool Vst3Logger::log_request(bool is_host_vst, }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaUnitInfo::SetUnitProgramData& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IUnitInfo::setUnitProgramData(listOrUnitId = " << request.list_or_unit_id @@ -892,9 +893,9 @@ bool Vst3Logger::log_request(bool is_host_vst, } bool Vst3Logger::log_request( - bool is_host_vst, + bool is_host_plugin, const YaXmlRepresentationController::GetXmlRepresentationStream& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": " "IXmlRepresentationController::getXmlRepresentationStream(" @@ -905,9 +906,9 @@ bool Vst3Logger::log_request( } bool Vst3Logger::log_request( - bool is_host_vst, + bool is_host_plugin, const YaAudioProcessor::SetBusArrangements& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IAudioProcessor::setBusArrangements(inputs = " "["; @@ -941,9 +942,9 @@ bool Vst3Logger::log_request( } bool Vst3Logger::log_request( - bool is_host_vst, + bool is_host_plugin, const YaAudioProcessor::GetBusArrangement& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IAudioProcessor::getBusArrangement(dir = " << request.dir << ", index = " << request.index << ", &arr)"; @@ -951,10 +952,10 @@ bool Vst3Logger::log_request( } bool Vst3Logger::log_request( - bool is_host_vst, + bool is_host_plugin, const YaAudioProcessor::CanProcessSampleSize& request) { return log_request_base( - is_host_vst, Logger::Verbosity::all_events, [&](auto& message) { + is_host_plugin, Logger::Verbosity::all_events, [&](auto& message) { message << request.instance_id << ": IAudioProcessor::canProcessSampleSize(symbolicSampleSize " @@ -964,18 +965,18 @@ bool Vst3Logger::log_request( } bool Vst3Logger::log_request( - bool is_host_vst, + bool is_host_plugin, const YaAudioProcessor::GetLatencySamples& request) { return log_request_base( - is_host_vst, Logger::Verbosity::all_events, [&](auto& message) { + is_host_plugin, Logger::Verbosity::all_events, [&](auto& message) { message << request.instance_id << ": IAudioProcessor::getLatencySamples()"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaAudioProcessor::SetupProcessing& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IAudioProcessor::setupProcessing(setup = " "& request_wrapper) { return log_request_base( - is_host_vst, Logger::Verbosity::all_events, [&](auto& message) { + is_host_plugin, Logger::Verbosity::all_events, [&](auto& message) { // This is incredibly verbose, but if you're really a plugin that // handles processing in a weird way you're going to need all of // this @@ -1075,45 +1076,45 @@ bool Vst3Logger::log_request( }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaAudioProcessor::GetTailSamples& request) { return log_request_base( - is_host_vst, Logger::Verbosity::all_events, [&](auto& message) { + is_host_plugin, Logger::Verbosity::all_events, [&](auto& message) { message << request.instance_id << ": IAudioProcessor::getTailSamples()"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaComponent::GetControllerClassId& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IComponent::getControllerClassId(&classId)"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaComponent::SetIoMode& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IComponent::setIoMode(mode = " << request.mode << ")"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaComponent::GetBusCount& request) { // JUCE-based hosts will call this every processing cycle, for some reason // (it shouldn't be allwoed to change during processing, right?) - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IComponent::getBusCount(type = " << request.type << ", dir = " << request.dir << ")"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaComponent::GetBusInfo& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IComponent::getBusInfo(type = " << request.type << ", dir = " << request.dir << ", index = " << request.index @@ -1121,9 +1122,9 @@ bool Vst3Logger::log_request(bool is_host_vst, }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaComponent::GetRoutingInfo& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.instance_id << ": IComponent::getRoutingInfo(inInfo = ::~IContextMenu()"; }); } -bool Vst3Logger::log_request(bool is_host_vst, const WantsConfiguration&) { - return log_request_base(is_host_vst, [&](auto& message) { +bool Vst3Logger::log_request(bool is_host_plugin, const WantsConfiguration&) { + return log_request_base(is_host_plugin, [&](auto& message) { message << "Requesting "; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaComponentHandler::BeginEdit& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.owner_instance_id << ": IComponentHandler::beginEdit(id = " << request.id << ")"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaComponentHandler::PerformEdit& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.owner_instance_id << ": IComponentHandler::performEdit(id = " << request.id << ", valueNormalized = " << request.value_normalized << ")"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaComponentHandler::EndEdit& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.owner_instance_id << ": IComponentHandler::endEdit(id = " << request.id << ")"; }); } bool Vst3Logger::log_request( - bool is_host_vst, + bool is_host_plugin, const YaComponentHandler::RestartComponent& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.owner_instance_id << ": IComponentHandler::restartComponent(flags = " << request.flags << ")"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaComponentHandler2::SetDirty& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.owner_instance_id << ": IComponentHandler2::setDirty(state = " << (request.state ? "true" : "False") << ")"; @@ -1219,9 +1220,9 @@ bool Vst3Logger::log_request(bool is_host_vst, } bool Vst3Logger::log_request( - bool is_host_vst, + bool is_host_plugin, const YaComponentHandler2::RequestOpenEditor& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.owner_instance_id << ": IComponentHandler2::requestOpenEditor(name = " << request.name << ")"; @@ -1229,27 +1230,27 @@ bool Vst3Logger::log_request( } bool Vst3Logger::log_request( - bool is_host_vst, + bool is_host_plugin, const YaComponentHandler2::StartGroupEdit& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.owner_instance_id << ": IComponentHandler2::startGroupEdit()"; }); } bool Vst3Logger::log_request( - bool is_host_vst, + bool is_host_plugin, const YaComponentHandler2::FinishGroupEdit& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.owner_instance_id << ": IComponentHandler2::finishGroupEdit()"; }); } bool Vst3Logger::log_request( - bool is_host_vst, + bool is_host_plugin, const YaComponentHandler3::CreateContextMenu& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.owner_instance_id << ": IComponentHandler3::createContextMenu(plugView = " ", paramId = " @@ -1260,9 +1261,9 @@ bool Vst3Logger::log_request( } bool Vst3Logger::log_request( - bool is_host_vst, + bool is_host_plugin, const YaComponentHandlerBusActivation::RequestBusActivation& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.owner_instance_id << ": IComponentHandlerBusActivation::requestBusActivation(type = " @@ -1272,9 +1273,9 @@ bool Vst3Logger::log_request( }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaContextMenu::AddItem& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.owner_instance_id << ": ::addItem(item = ::removeItem(item = ::popup(x = " << request.x << ", y = " << request.y << ")"; }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaHostApplication::GetName& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { // This can be called either from a plugin object or from the plugin's // plugin factory if (request.owner_instance_id) { @@ -1317,9 +1318,9 @@ bool Vst3Logger::log_request(bool is_host_vst, }); } -bool Vst3Logger::log_request(bool is_host_vst, +bool Vst3Logger::log_request(bool is_host_plugin, const YaPlugFrame::ResizeView& request) { - return log_request_base(is_host_vst, [&](auto& message) { + return log_request_base(is_host_plugin, [&](auto& message) { message << request.owner_instance_id << ": IPlugFrame::resizeView(view = , newSize = " "& result) { - log_response_base(is_host_vst, [&](auto& message) { + log_response_base(is_host_plugin, [&](auto& message) { std::visit(overload{[&](const Vst3PluginProxy::ConstructArgs& args) { message << ""; @@ -1461,15 +1462,15 @@ void Vst3Logger::log_response(bool is_host_vst, } void Vst3Logger::log_response( - bool is_host_vst, + bool is_host_plugin, const Vst3PluginProxy::InitializeResponse& response) { - log_response(is_host_vst, response.result); + log_response(is_host_plugin, response.result); } void Vst3Logger::log_response( - bool is_host_vst, + bool is_host_plugin, const Vst3PluginProxy::GetStateResponse& response) { - log_response_base(is_host_vst, [&](auto& message) { + log_response_base(is_host_plugin, [&](auto& message) { message << response.result.string(); if (response.result == Steinberg::kResultOk) { message << ", " << format_bstream(response.state); @@ -1478,10 +1479,10 @@ void Vst3Logger::log_response( } void Vst3Logger::log_response( - bool is_host_vst, + bool is_host_plugin, const YaEditController::GetParameterInfoResponse& response, bool from_cache) { - log_response_base(is_host_vst, [&](auto& message) { + log_response_base(is_host_plugin, [&](auto& message) { message << response.result.string(); if (response.result == Steinberg::kResultOk) { std::string param_title = @@ -1495,9 +1496,9 @@ void Vst3Logger::log_response( } void Vst3Logger::log_response( - bool is_host_vst, + bool is_host_plugin, const YaEditController::GetParamStringByValueResponse& response) { - log_response_base(is_host_vst, [&](auto& message) { + log_response_base(is_host_plugin, [&](auto& message) { message << response.result.string(); if (response.result == Steinberg::kResultOk) { std::string value = VST3::StringConvert::convert(response.string); @@ -1507,9 +1508,9 @@ void Vst3Logger::log_response( } void Vst3Logger::log_response( - bool is_host_vst, + bool is_host_plugin, const YaEditController::GetParamValueByStringResponse& response) { - log_response_base(is_host_vst, [&](auto& message) { + log_response_base(is_host_plugin, [&](auto& message) { message << response.result.string(); if (response.result == Steinberg::kResultOk) { message << ", " << response.value_normalized; @@ -1518,9 +1519,9 @@ void Vst3Logger::log_response( } void Vst3Logger::log_response( - bool is_host_vst, + bool is_host_plugin, const YaEditController::CreateViewResponse& response) { - log_response_base(is_host_vst, [&](auto& message) { + log_response_base(is_host_plugin, [&](auto& message) { if (response.plug_view_args) { message << ""; } else { @@ -1530,9 +1531,9 @@ void Vst3Logger::log_response( } void Vst3Logger::log_response( - bool is_host_vst, + bool is_host_plugin, const YaKeyswitchController::GetKeyswitchInfoResponse& response) { - log_response_base(is_host_vst, [&](auto& message) { + log_response_base(is_host_plugin, [&](auto& message) { message << response.result.string(); if (response.result == Steinberg::kResultOk) { message << ", "; }); } void Vst3Logger::log_response( - bool is_host_vst, + bool is_host_plugin, const YaProgramListData::GetProgramDataResponse& response) { - log_response_base(is_host_vst, [&](auto& message) { + log_response_base(is_host_plugin, [&](auto& message) { message << response.result.string(); if (response.result == Steinberg::kResultOk) { message << ", " << format_bstream(response.data); @@ -1677,9 +1678,9 @@ void Vst3Logger::log_response( }); } -void Vst3Logger::log_response(bool is_host_vst, +void Vst3Logger::log_response(bool is_host_plugin, const YaUnitData::GetUnitDataResponse& response) { - log_response_base(is_host_vst, [&](auto& message) { + log_response_base(is_host_plugin, [&](auto& message) { message << response.result.string(); if (response.result == Steinberg::kResultOk) { message << ", " << format_bstream(response.data); @@ -1687,9 +1688,9 @@ void Vst3Logger::log_response(bool is_host_vst, }); } -void Vst3Logger::log_response(bool is_host_vst, +void Vst3Logger::log_response(bool is_host_plugin, const YaUnitInfo::GetUnitInfoResponse& response) { - log_response_base(is_host_vst, [&](auto& message) { + log_response_base(is_host_plugin, [&](auto& message) { message << response.result.string(); if (response.result == Steinberg::kResultOk) { message << ", context_menu_id << ">"; @@ -1921,9 +1922,9 @@ void Vst3Logger::log_response( } void Vst3Logger::log_response( - bool is_host_vst, + bool is_host_plugin, const YaHostApplication::GetNameResponse& response) { - log_response_base(is_host_vst, [&](auto& message) { + log_response_base(is_host_plugin, [&](auto& message) { message << response.result.string(); if (response.result == Steinberg::kResultOk) { std::string value = VST3::StringConvert::convert(response.name); @@ -1932,9 +1933,9 @@ void Vst3Logger::log_response( }); } -void Vst3Logger::log_response(bool is_host_vst, +void Vst3Logger::log_response(bool is_host_plugin, const YaProgress::StartResponse& response) { - log_response_base(is_host_vst, [&](auto& message) { + log_response_base(is_host_plugin, [&](auto& message) { message << response.result.string(); if (response.result == Steinberg::kResultOk) { message << ", " << response.out_id; diff --git a/src/common/logging/vst3.h b/src/common/logging/vst3.h index fe88ea31..bad25399 100644 --- a/src/common/logging/vst3.h +++ b/src/common/logging/vst3.h @@ -60,280 +60,297 @@ class Vst3Logger { // way we can filter out the log message for the response together with the // request. - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const Vst3PluginFactoryProxy::Construct&); - bool log_request(bool is_host_vst, const Vst3PlugViewProxy::Destruct&); - bool log_request(bool is_host_vst, const Vst3PluginProxy::Construct&); - bool log_request(bool is_host_vst, const Vst3PluginProxy::Destruct&); - bool log_request(bool is_host_vst, const Vst3PluginProxy::Initialize&); - bool log_request(bool is_host_vst, const Vst3PluginProxy::SetState&); - bool log_request(bool is_host_vst, const Vst3PluginProxy::GetState&); + bool log_request(bool is_host_plugin, const Vst3PlugViewProxy::Destruct&); + bool log_request(bool is_host_plugin, const Vst3PluginProxy::Construct&); + bool log_request(bool is_host_plugin, const Vst3PluginProxy::Destruct&); + bool log_request(bool is_host_plugin, const Vst3PluginProxy::Initialize&); + bool log_request(bool is_host_plugin, const Vst3PluginProxy::SetState&); + bool log_request(bool is_host_plugin, const Vst3PluginProxy::GetState&); bool log_request( - bool is_host_vst, + bool is_host_plugin, const YaAudioPresentationLatency::SetAudioPresentationLatencySamples&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaAutomationState::SetAutomationState&); - bool log_request(bool is_host_vst, const YaConnectionPoint::Connect&); - bool log_request(bool is_host_vst, const YaConnectionPoint::Disconnect&); - bool log_request(bool is_host_vst, const YaConnectionPoint::Notify&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaConnectionPoint::Connect&); + bool log_request(bool is_host_plugin, const YaConnectionPoint::Disconnect&); + bool log_request(bool is_host_plugin, const YaConnectionPoint::Notify&); + bool log_request(bool is_host_plugin, const YaContextMenuTarget::ExecuteMenuItem&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaEditController::SetComponentState&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaEditController::GetParameterCount&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaEditController::GetParameterInfo&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaEditController::GetParamStringByValue&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaEditController::GetParamValueByString&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaEditController::NormalizedParamToPlain&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaEditController::PlainParamToNormalized&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaEditController::GetParamNormalized&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaEditController::SetParamNormalized&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaEditController::SetComponentHandler&); - bool log_request(bool is_host_vst, const YaEditController::CreateView&); - bool log_request(bool is_host_vst, const YaEditController2::SetKnobMode&); - bool log_request(bool is_host_vst, const YaEditController2::OpenHelp&); - bool log_request(bool is_host_vst, const YaEditController2::OpenAboutBox&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaEditController::CreateView&); + bool log_request(bool is_host_plugin, + const YaEditController2::SetKnobMode&); + bool log_request(bool is_host_plugin, const YaEditController2::OpenHelp&); + bool log_request(bool is_host_plugin, + const YaEditController2::OpenAboutBox&); + bool log_request(bool is_host_plugin, const YaEditControllerHostEditing::BeginEditFromHost&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaEditControllerHostEditing::EndEditFromHost&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaInfoListener::SetChannelContextInfos&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaKeyswitchController::GetKeyswitchCount&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaKeyswitchController::GetKeyswitchInfo&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaMidiLearn::OnLiveMIDIControllerInput&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaMidiMapping::GetMidiControllerAssignment&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaNoteExpressionController::GetNoteExpressionCount&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaNoteExpressionController::GetNoteExpressionInfo&); bool log_request( - bool is_host_vst, + bool is_host_plugin, const YaNoteExpressionController::GetNoteExpressionStringByValue&); bool log_request( - bool is_host_vst, + bool is_host_plugin, const YaNoteExpressionController::GetNoteExpressionValueByString&); bool log_request( - bool is_host_vst, + bool is_host_plugin, 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 is_host_vst, + bool is_host_plugin, const YaParameterFunctionName::GetParameterIDFromFunctionName&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaPlugView::IsPlatformTypeSupported&); - bool log_request(bool is_host_vst, const YaPlugView::Attached&); - bool log_request(bool is_host_vst, const YaPlugView::Removed&); - bool log_request(bool is_host_vst, const YaPlugView::OnWheel&); - bool log_request(bool is_host_vst, const YaPlugView::OnKeyDown&); - bool log_request(bool is_host_vst, const YaPlugView::OnKeyUp&); - bool log_request(bool is_host_vst, const YaPlugView::GetSize&); - bool log_request(bool is_host_vst, const YaPlugView::OnSize&); - bool log_request(bool is_host_vst, const YaPlugView::OnFocus&); - bool log_request(bool is_host_vst, const YaPlugView::SetFrame&); - bool log_request(bool is_host_vst, const YaPlugView::CanResize&); - bool log_request(bool is_host_vst, const YaPlugView::CheckSizeConstraint&); + bool log_request(bool is_host_plugin, const YaPlugView::Attached&); + bool log_request(bool is_host_plugin, const YaPlugView::Removed&); + bool log_request(bool is_host_plugin, const YaPlugView::OnWheel&); + bool log_request(bool is_host_plugin, const YaPlugView::OnKeyDown&); + bool log_request(bool is_host_plugin, const YaPlugView::OnKeyUp&); + bool log_request(bool is_host_plugin, const YaPlugView::GetSize&); + bool log_request(bool is_host_plugin, const YaPlugView::OnSize&); + bool log_request(bool is_host_plugin, const YaPlugView::OnFocus&); + bool log_request(bool is_host_plugin, const YaPlugView::SetFrame&); + bool log_request(bool is_host_plugin, const YaPlugView::CanResize&); + bool log_request(bool is_host_plugin, + const YaPlugView::CheckSizeConstraint&); bool log_request( - bool is_host_vst, + bool is_host_plugin, const YaPlugViewContentScaleSupport::SetContentScaleFactor&); - bool log_request(bool is_host_vst, const YaPluginBase::Terminate&); - bool log_request(bool is_host_vst, const YaPluginFactory3::SetHostContext&); + bool log_request(bool is_host_plugin, const YaPluginBase::Terminate&); + bool log_request(bool is_host_plugin, + const YaPluginFactory3::SetHostContext&); bool log_request( - bool is_host_vst, + bool is_host_plugin, const YaProcessContextRequirements::GetProcessContextRequirements&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaProgramListData::ProgramDataSupported&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaProgramListData::GetProgramData&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaProgramListData::SetProgramData&); - bool log_request(bool is_host_vst, const YaUnitData::UnitDataSupported&); - bool log_request(bool is_host_vst, const YaUnitData::GetUnitData&); - bool log_request(bool is_host_vst, const YaUnitData::SetUnitData&); - bool log_request(bool is_host_vst, const YaUnitInfo::GetUnitCount&); - bool log_request(bool is_host_vst, const YaUnitInfo::GetUnitInfo&); - bool log_request(bool is_host_vst, const YaUnitInfo::GetProgramListCount&); - bool log_request(bool is_host_vst, const YaUnitInfo::GetProgramListInfo&); - bool log_request(bool is_host_vst, const YaUnitInfo::GetProgramName&); - bool log_request(bool is_host_vst, const YaUnitInfo::GetProgramInfo&); - bool log_request(bool is_host_vst, const YaUnitInfo::HasProgramPitchNames&); - bool log_request(bool is_host_vst, const YaUnitInfo::GetProgramPitchName&); - bool log_request(bool is_host_vst, const YaUnitInfo::GetSelectedUnit&); - bool log_request(bool is_host_vst, const YaUnitInfo::SelectUnit&); - bool log_request(bool is_host_vst, const YaUnitInfo::GetUnitByBus&); - bool log_request(bool is_host_vst, const YaUnitInfo::SetUnitProgramData&); + bool log_request(bool is_host_plugin, const YaUnitData::UnitDataSupported&); + bool log_request(bool is_host_plugin, const YaUnitData::GetUnitData&); + bool log_request(bool is_host_plugin, const YaUnitData::SetUnitData&); + bool log_request(bool is_host_plugin, const YaUnitInfo::GetUnitCount&); + bool log_request(bool is_host_plugin, const YaUnitInfo::GetUnitInfo&); + bool log_request(bool is_host_plugin, + const YaUnitInfo::GetProgramListCount&); + bool log_request(bool is_host_plugin, + const YaUnitInfo::GetProgramListInfo&); + bool log_request(bool is_host_plugin, const YaUnitInfo::GetProgramName&); + bool log_request(bool is_host_plugin, const YaUnitInfo::GetProgramInfo&); + bool log_request(bool is_host_plugin, + const YaUnitInfo::HasProgramPitchNames&); + bool log_request(bool is_host_plugin, + 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 is_host_vst, + bool is_host_plugin, const YaXmlRepresentationController::GetXmlRepresentationStream&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaAudioProcessor::SetBusArrangements&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaAudioProcessor::GetBusArrangement&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaAudioProcessor::CanProcessSampleSize&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaAudioProcessor::GetLatencySamples&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaAudioProcessor::SetupProcessing&); - bool log_request(bool is_host_vst, const YaAudioProcessor::SetProcessing&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, + const YaAudioProcessor::SetProcessing&); + bool log_request(bool is_host_plugin, const MessageReference&); - bool log_request(bool is_host_vst, const YaAudioProcessor::GetTailSamples&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, + const YaAudioProcessor::GetTailSamples&); + bool log_request(bool is_host_plugin, const YaComponent::GetControllerClassId&); - bool log_request(bool is_host_vst, const YaComponent::SetIoMode&); - bool log_request(bool is_host_vst, const YaComponent::GetBusCount&); - bool log_request(bool is_host_vst, const YaComponent::GetBusInfo&); - bool log_request(bool is_host_vst, const YaComponent::GetRoutingInfo&); - bool log_request(bool is_host_vst, const YaComponent::ActivateBus&); - bool log_request(bool is_host_vst, const YaComponent::SetActive&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaComponent::SetIoMode&); + bool log_request(bool is_host_plugin, const YaComponent::GetBusCount&); + bool log_request(bool is_host_plugin, const YaComponent::GetBusInfo&); + bool log_request(bool is_host_plugin, const YaComponent::GetRoutingInfo&); + bool log_request(bool is_host_plugin, const YaComponent::ActivateBus&); + bool log_request(bool is_host_plugin, const YaComponent::SetActive&); + bool log_request(bool is_host_plugin, const YaPrefetchableSupport::GetPrefetchableSupport&); - bool log_request(bool is_host_vst, const Vst3ContextMenuProxy::Destruct&); - bool log_request(bool is_host_vst, const WantsConfiguration&); - bool log_request(bool is_host_vst, const YaComponentHandler::BeginEdit&); - bool log_request(bool is_host_vst, const YaComponentHandler::PerformEdit&); - bool log_request(bool is_host_vst, const YaComponentHandler::EndEdit&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, + const Vst3ContextMenuProxy::Destruct&); + bool log_request(bool is_host_plugin, const WantsConfiguration&); + bool log_request(bool is_host_plugin, const YaComponentHandler::BeginEdit&); + bool log_request(bool is_host_plugin, + const YaComponentHandler::PerformEdit&); + bool log_request(bool is_host_plugin, const YaComponentHandler::EndEdit&); + bool log_request(bool is_host_plugin, const YaComponentHandler::RestartComponent&); - bool log_request(bool is_host_vst, const YaComponentHandler2::SetDirty&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaComponentHandler2::SetDirty&); + bool log_request(bool is_host_plugin, const YaComponentHandler2::RequestOpenEditor&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaComponentHandler2::StartGroupEdit&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaComponentHandler2::FinishGroupEdit&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaComponentHandler3::CreateContextMenu&); bool log_request( - bool is_host_vst, + bool is_host_plugin, const YaComponentHandlerBusActivation::RequestBusActivation&); - bool log_request(bool is_host_vst, const YaContextMenu::AddItem&); - bool log_request(bool is_host_vst, const YaContextMenu::RemoveItem&); - bool log_request(bool is_host_vst, const YaContextMenu::Popup&); - bool log_request(bool is_host_vst, const YaHostApplication::GetName&); - bool log_request(bool is_host_vst, const YaPlugFrame::ResizeView&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaContextMenu::AddItem&); + bool log_request(bool is_host_plugin, const YaContextMenu::RemoveItem&); + bool log_request(bool is_host_plugin, const YaContextMenu::Popup&); + bool log_request(bool is_host_plugin, const YaHostApplication::GetName&); + bool log_request(bool is_host_plugin, const YaPlugFrame::ResizeView&); + bool log_request(bool is_host_plugin, const YaPlugInterfaceSupport::IsPlugInterfaceSupported&); - bool log_request(bool is_host_vst, const YaProgress::Start&); - bool log_request(bool is_host_vst, const YaProgress::Update&); - bool log_request(bool is_host_vst, const YaProgress::Finish&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaProgress::Start&); + bool log_request(bool is_host_plugin, const YaProgress::Update&); + bool log_request(bool is_host_plugin, const YaProgress::Finish&); + bool log_request(bool is_host_plugin, const YaUnitHandler::NotifyUnitSelection&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaUnitHandler::NotifyProgramListChange&); - bool log_request(bool is_host_vst, + bool log_request(bool is_host_plugin, const YaUnitHandler2::NotifyUnitByBusChange&); - void log_response(bool is_host_vst, const Ack&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const Ack&); + void log_response(bool is_host_plugin, const UniversalTResult&, bool from_cache = false); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const Vst3PluginFactoryProxy::ConstructArgs&); void log_response( - bool is_host_vst, + bool is_host_plugin, const std::variant&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const Vst3PluginProxy::InitializeResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const Vst3PluginProxy::GetStateResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaEditController::GetParameterInfoResponse&, bool from_cache = false); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaEditController::GetParamStringByValueResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaEditController::GetParamValueByStringResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaEditController::CreateViewResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaKeyswitchController::GetKeyswitchInfoResponse&); void log_response( - bool is_host_vst, + bool is_host_plugin, const YaMidiMapping::GetMidiControllerAssignmentResponse&); void log_response( - bool is_host_vst, + bool is_host_plugin, const YaNoteExpressionController::GetNoteExpressionInfoResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaNoteExpressionController:: GetNoteExpressionStringByValueResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaNoteExpressionController:: GetNoteExpressionValueByStringResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaNoteExpressionPhysicalUIMapping:: GetNotePhysicalUIMappingResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaParameterFinder::FindParameterResponse&); void log_response( - bool is_host_vst, + bool is_host_plugin, const YaParameterFunctionName::GetParameterIDFromFunctionNameResponse&); - void log_response(bool is_host_vst, const YaPlugView::GetSizeResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaPlugView::GetSizeResponse&); + void log_response(bool is_host_plugin, const YaPlugView::CheckSizeConstraintResponse&); - void log_response(bool is_host_vst, const Configuration&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const Configuration&); + void log_response(bool is_host_plugin, const YaProgramListData::GetProgramDataResponse&); - void log_response(bool is_host_vst, const YaUnitData::GetUnitDataResponse&); - void log_response(bool is_host_vst, const YaUnitInfo::GetUnitInfoResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, + const YaUnitData::GetUnitDataResponse&); + void log_response(bool is_host_plugin, + const YaUnitInfo::GetUnitInfoResponse&); + void log_response(bool is_host_plugin, const YaUnitInfo::GetProgramListInfoResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaUnitInfo::GetProgramNameResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaUnitInfo::GetProgramInfoResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaUnitInfo::GetProgramPitchNameResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaUnitInfo::GetUnitByBusResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaXmlRepresentationController:: GetXmlRepresentationStreamResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaAudioProcessor::GetBusArrangementResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaAudioProcessor::ProcessResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaComponent::GetControllerClassIdResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaComponent::GetBusInfoResponse&, bool from_cache = false); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, 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( - bool is_host_vst, + bool is_host_plugin, const YaPrefetchableSupport::GetPrefetchableSupportResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaComponentHandler3::CreateContextMenuResponse&); - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const YaHostApplication::GetNameResponse&); - void log_response(bool is_host_vst, const YaProgress::StartResponse&); + void log_response(bool is_host_plugin, const YaProgress::StartResponse&); template - void log_response(bool is_host_vst, + void log_response(bool is_host_plugin, const PrimitiveWrapper& value, bool from_cache = false) { // 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; if (from_cache) { message << " (from cache)"; @@ -360,12 +377,12 @@ class Vst3Logger { * thus also be logged. */ template F> - bool log_request_base(bool is_host_vst, + bool log_request_base(bool is_host_plugin, Logger::Verbosity min_verbosity, F callback) { if (logger_.verbosity_ >= min_verbosity) [[unlikely]] { std::ostringstream message; - if (is_host_vst) { + if (is_host_plugin) { message << "[host -> vst] >> "; } else { message << "[vst -> host] >> "; @@ -381,8 +398,8 @@ class Vst3Logger { } template F> - bool log_request_base(bool is_host_vst, F callback) { - return log_request_base(is_host_vst, Logger::Verbosity::most_events, + bool log_request_base(bool is_host_plugin, F callback) { + return log_request_base(is_host_plugin, Logger::Verbosity::most_events, callback); } @@ -394,9 +411,9 @@ class Vst3Logger { * `true`. */ template F> - void log_response_base(bool is_host_vst, F callback) { + void log_response_base(bool is_host_plugin, F callback) { std::ostringstream message; - if (is_host_vst) { + if (is_host_plugin) { message << "[vst <- host] "; } else { message << "[host <- vst] "; diff --git a/src/common/mutual-recursion.h b/src/common/mutual-recursion.h index bccad2ca..14989a45 100644 --- a/src/common/mutual-recursion.h +++ b/src/common/mutual-recursion.h @@ -168,8 +168,7 @@ class MutualRecursionHelper { // pretend that we're not doing any async things here std::packaged_task do_call(std::forward(fn)); std::future do_call_response = do_call.get_future(); - asio::dispatch(*mutual_recursion_contexts_.back(), - std::move(do_call)); + asio::dispatch(*mutual_recursion_contexts_.back(), std::move(do_call)); mutual_recursion_lock.unlock(); return do_call_response.get(); @@ -186,7 +185,6 @@ class MutualRecursionHelper { * active one. If the stack is empty, then there's currently no mutual * recursion going on. */ - std::vector> - mutual_recursion_contexts_; + std::vector> mutual_recursion_contexts_; std::mutex mutual_recursion_contexts_mutex_; }; diff --git a/src/common/serialization/vst2.h b/src/common/serialization/vst2.h index 849c212d..15fab58f 100644 --- a/src/common/serialization/vst2.h +++ b/src/common/serialization/vst2.h @@ -236,11 +236,11 @@ class alignas(16) DynamicSpeakerArrangement { }; /** - * Marker struct to indicate that the other side (the Wine VST host) should send - * an updated copy of the plugin's `AEffect` object. Should not be needed since - * the plugin should be calling `audioMasterIOChanged()` after it has changed - * its object, but some improperly coded plugins will only initialize their - * flags, IO properties and parameter counts after `effEditOpen()`. + * Marker struct to indicate that the other side (the Wine plugin host) should + * send an updated copy of the plugin's `AEffect` object. Should not be needed + * since the plugin should be calling `audioMasterIOChanged()` after it has + * changed its object, but some improperly coded plugins will only initialize + * their flags, IO properties and parameter counts after `effEditOpen()`. */ struct WantsAEffectUpdate { 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` * 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 { std::optional value; diff --git a/src/common/serialization/vst3.h b/src/common/serialization/vst3.h index 6cc07f02..917a3f9f 100644 --- a/src/common/serialization/vst3.h +++ b/src/common/serialization/vst3.h @@ -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 * 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 - * information we want or the operation we want to perform. A request of type - * `CallbackRequest(T)` should send back a `T::Response`. + * When we do a callback from the Wine plugin host to the plugin, this encodes + * the information we want or the operation we want to perform. A request of + * type `CallbackRequest(T)` should send back a `T::Response`. */ using CallbackRequest = std::variant YaAttributeList::keys_and_types() const { + std::vector YaAttributeList::keys_and_types() const { std::vector result{}; for (const auto& [key, value] : attrs_int_) { result.push_back("\"" + key + "\" (int)"); diff --git a/src/common/serialization/vst3/bstream.cpp b/src/common/serialization/vst3/bstream.cpp index ebbc712b..c28c06f1 100644 --- a/src/common/serialization/vst3/bstream.cpp +++ b/src/common/serialization/vst3/bstream.cpp @@ -80,17 +80,14 @@ YaBStream::YaBStream(Steinberg::IBStream* stream) { } } -YaBStream::~YaBStream() noexcept { - FUNKNOWN_DTOR -} - +YaBStream::~YaBStream() noexcept {FUNKNOWN_DTOR} #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" IMPLEMENT_REFCOUNT(YaBStream) #pragma GCC diagnostic pop -tresult PLUGIN_API YaBStream::queryInterface(Steinberg::FIDString _iid, - void** obj) { + tresult PLUGIN_API YaBStream::queryInterface(Steinberg::FIDString _iid, + void** obj) { QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, Steinberg::IBStream) QUERY_INTERFACE(_iid, obj, Steinberg::IBStream::iid, Steinberg::IBStream) QUERY_INTERFACE(_iid, obj, Steinberg::ISizeableStream::iid, diff --git a/src/common/serialization/vst3/component-handler-proxy.cpp b/src/common/serialization/vst3/component-handler-proxy.cpp index 4234c6a9..0bf3e5df 100644 --- a/src/common/serialization/vst3/component-handler-proxy.cpp +++ b/src/common/serialization/vst3/component-handler-proxy.cpp @@ -43,17 +43,15 @@ Vst3ComponentHandlerProxy::Vst3ComponentHandlerProxy( arguments_(std::move(args)){FUNKNOWN_CTOR} Vst3ComponentHandlerProxy::~Vst3ComponentHandlerProxy() noexcept { - FUNKNOWN_DTOR -} - + FUNKNOWN_DTOR} #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" -IMPLEMENT_REFCOUNT(Vst3ComponentHandlerProxy) + IMPLEMENT_REFCOUNT(Vst3ComponentHandlerProxy) #pragma GCC diagnostic pop -tresult PLUGIN_API -Vst3ComponentHandlerProxy::queryInterface(Steinberg::FIDString _iid, - void** obj) { + tresult PLUGIN_API Vst3ComponentHandlerProxy::queryInterface( + Steinberg::FIDString _iid, + void** obj) { if (YaComponentHandler::supported()) { QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, Steinberg::Vst::IComponentHandler) diff --git a/src/common/serialization/vst3/connection-point-proxy.cpp b/src/common/serialization/vst3/connection-point-proxy.cpp index 033f5381..4441ab16 100644 --- a/src/common/serialization/vst3/connection-point-proxy.cpp +++ b/src/common/serialization/vst3/connection-point-proxy.cpp @@ -22,17 +22,15 @@ Vst3ConnectionPointProxy::Vst3ConnectionPointProxy( arguments_(std::move(args)){FUNKNOWN_CTOR} Vst3ConnectionPointProxy::~Vst3ConnectionPointProxy() noexcept { - FUNKNOWN_DTOR -} - + FUNKNOWN_DTOR} #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" -IMPLEMENT_REFCOUNT(Vst3ConnectionPointProxy) + IMPLEMENT_REFCOUNT(Vst3ConnectionPointProxy) #pragma GCC diagnostic pop -tresult PLUGIN_API -Vst3ConnectionPointProxy::queryInterface(Steinberg::FIDString _iid, - void** obj) { + tresult PLUGIN_API Vst3ConnectionPointProxy::queryInterface( + Steinberg::FIDString _iid, + void** obj) { if (YaConnectionPoint::supported()) { QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, Steinberg::Vst::IConnectionPoint) diff --git a/src/common/serialization/vst3/context-menu-proxy.cpp b/src/common/serialization/vst3/context-menu-proxy.cpp index 2dea71f2..e6c57cd8 100644 --- a/src/common/serialization/vst3/context-menu-proxy.cpp +++ b/src/common/serialization/vst3/context-menu-proxy.cpp @@ -30,17 +30,15 @@ Vst3ContextMenuProxy::Vst3ContextMenuProxy(ConstructArgs&& args) noexcept : YaContextMenu(std::move(args.context_menu_args)), arguments_(std::move(args)){FUNKNOWN_CTOR} - Vst3ContextMenuProxy::~Vst3ContextMenuProxy() noexcept { - FUNKNOWN_DTOR -} - + Vst3ContextMenuProxy::~Vst3ContextMenuProxy() noexcept {FUNKNOWN_DTOR} #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" -IMPLEMENT_REFCOUNT(Vst3ContextMenuProxy) + IMPLEMENT_REFCOUNT(Vst3ContextMenuProxy) #pragma GCC diagnostic pop -tresult PLUGIN_API -Vst3ContextMenuProxy::queryInterface(Steinberg::FIDString _iid, void** obj) { + tresult PLUGIN_API Vst3ContextMenuProxy::queryInterface( + Steinberg::FIDString _iid, + void** obj) { if (YaContextMenu::supported()) { QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, Steinberg::Vst::IContextMenu) diff --git a/src/common/serialization/vst3/context-menu-target.cpp b/src/common/serialization/vst3/context-menu-target.cpp index 5295f87f..e7dcab4c 100644 --- a/src/common/serialization/vst3/context-menu-target.cpp +++ b/src/common/serialization/vst3/context-menu-target.cpp @@ -19,13 +19,11 @@ YaContextMenuTarget::YaContextMenuTarget(ConstructArgs&& args) noexcept : arguments_(std::move(args)){FUNKNOWN_CTOR} - YaContextMenuTarget::~YaContextMenuTarget() noexcept { - FUNKNOWN_DTOR -} + YaContextMenuTarget::~YaContextMenuTarget() noexcept {FUNKNOWN_DTOR} #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" -IMPLEMENT_FUNKNOWN_METHODS(YaContextMenuTarget, - Steinberg::Vst::IContextMenuTarget, - Steinberg::Vst::IContextMenuTarget::iid) + IMPLEMENT_FUNKNOWN_METHODS(YaContextMenuTarget, + Steinberg::Vst::IContextMenuTarget, + Steinberg::Vst::IContextMenuTarget::iid) #pragma GCC diagnostic pop diff --git a/src/common/serialization/vst3/host-context-proxy.cpp b/src/common/serialization/vst3/host-context-proxy.cpp index 383d2045..4b297fe9 100644 --- a/src/common/serialization/vst3/host-context-proxy.cpp +++ b/src/common/serialization/vst3/host-context-proxy.cpp @@ -30,17 +30,15 @@ Vst3HostContextProxy::Vst3HostContextProxy(ConstructArgs&& args) noexcept YaPlugInterfaceSupport(std::move(args.plug_interface_support_args)), arguments_(std::move(args)){FUNKNOWN_CTOR} - Vst3HostContextProxy::~Vst3HostContextProxy() noexcept { - FUNKNOWN_DTOR -} - + Vst3HostContextProxy::~Vst3HostContextProxy() noexcept {FUNKNOWN_DTOR} #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" -IMPLEMENT_REFCOUNT(Vst3HostContextProxy) + IMPLEMENT_REFCOUNT(Vst3HostContextProxy) #pragma GCC diagnostic pop -tresult PLUGIN_API -Vst3HostContextProxy::queryInterface(Steinberg::FIDString _iid, void** obj) { + tresult PLUGIN_API Vst3HostContextProxy::queryInterface( + Steinberg::FIDString _iid, + void** obj) { if (YaHostApplication::supported()) { QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, Steinberg::Vst::IHostApplication) diff --git a/src/common/serialization/vst3/message.cpp b/src/common/serialization/vst3/message.cpp index 12ca17f3..3ad52c96 100644 --- a/src/common/serialization/vst3/message.cpp +++ b/src/common/serialization/vst3/message.cpp @@ -25,18 +25,16 @@ YaMessagePtr::YaMessagePtr(IMessage& message) original_message_ptr_(static_cast( reinterpret_cast(&message))){FUNKNOWN_CTOR} - YaMessagePtr::~YaMessagePtr() noexcept { - FUNKNOWN_DTOR -} - + YaMessagePtr::~YaMessagePtr() noexcept {FUNKNOWN_DTOR} #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" -IMPLEMENT_FUNKNOWN_METHODS(YaMessagePtr, - Steinberg::Vst::IMessage, - Steinberg::Vst::IMessage::iid) + IMPLEMENT_FUNKNOWN_METHODS(YaMessagePtr, + Steinberg::Vst::IMessage, + Steinberg::Vst::IMessage::iid) #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` return reinterpret_cast( static_cast(original_message_ptr_)); @@ -64,10 +62,7 @@ Steinberg::Vst::IAttributeList* PLUGIN_API YaMessagePtr::getAttributes() { YaMessage::YaMessage() noexcept {FUNKNOWN_CTOR} -YaMessage::~YaMessage() noexcept { - FUNKNOWN_DTOR -} - +YaMessage::~YaMessage() noexcept {FUNKNOWN_DTOR} #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" IMPLEMENT_FUNKNOWN_METHODS(YaMessage, @@ -75,7 +70,7 @@ IMPLEMENT_FUNKNOWN_METHODS(YaMessage, Steinberg::Vst::IMessage::iid) #pragma GCC diagnostic pop -Steinberg::FIDString PLUGIN_API YaMessage::getMessageID() { + Steinberg::FIDString PLUGIN_API YaMessage::getMessageID() { if (message_id_) { return message_id_->c_str(); } else { diff --git a/src/common/serialization/vst3/plug-frame-proxy.cpp b/src/common/serialization/vst3/plug-frame-proxy.cpp index 487a1021..0648c26d 100644 --- a/src/common/serialization/vst3/plug-frame-proxy.cpp +++ b/src/common/serialization/vst3/plug-frame-proxy.cpp @@ -27,17 +27,15 @@ Vst3PlugFrameProxy::Vst3PlugFrameProxy(ConstructArgs&& args) noexcept : YaPlugFrame(std::move(args.plug_frame_args)), arguments_(std::move(args)){FUNKNOWN_CTOR} - Vst3PlugFrameProxy::~Vst3PlugFrameProxy() noexcept { - FUNKNOWN_DTOR -} - + Vst3PlugFrameProxy::~Vst3PlugFrameProxy() noexcept {FUNKNOWN_DTOR} #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" -IMPLEMENT_REFCOUNT(Vst3PlugFrameProxy) + IMPLEMENT_REFCOUNT(Vst3PlugFrameProxy) #pragma GCC diagnostic pop -tresult PLUGIN_API Vst3PlugFrameProxy::queryInterface(Steinberg::FIDString _iid, - void** obj) { + tresult PLUGIN_API Vst3PlugFrameProxy::queryInterface( + Steinberg::FIDString _iid, + void** obj) { if (YaPlugFrame::supported()) { QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, Steinberg::IPlugFrame) diff --git a/src/common/serialization/vst3/plug-view-proxy.cpp b/src/common/serialization/vst3/plug-view-proxy.cpp index d2348840..da439f88 100644 --- a/src/common/serialization/vst3/plug-view-proxy.cpp +++ b/src/common/serialization/vst3/plug-view-proxy.cpp @@ -33,17 +33,15 @@ Vst3PlugViewProxy::Vst3PlugViewProxy(ConstructArgs&& args) noexcept std::move(args.plug_view_content_scale_support_args)), arguments_(std::move(args)){FUNKNOWN_CTOR} - Vst3PlugViewProxy::~Vst3PlugViewProxy() noexcept { - FUNKNOWN_DTOR -} - + Vst3PlugViewProxy::~Vst3PlugViewProxy() noexcept {FUNKNOWN_DTOR} #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" -IMPLEMENT_REFCOUNT(Vst3PlugViewProxy) + IMPLEMENT_REFCOUNT(Vst3PlugViewProxy) #pragma GCC diagnostic pop -tresult PLUGIN_API Vst3PlugViewProxy::queryInterface(Steinberg::FIDString _iid, - void** obj) { + tresult PLUGIN_API Vst3PlugViewProxy::queryInterface( + Steinberg::FIDString _iid, + void** obj) { if (YaPlugView::supported()) { QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, Steinberg::IPlugView) diff --git a/src/common/serialization/vst3/plugin-factory-proxy.cpp b/src/common/serialization/vst3/plugin-factory-proxy.cpp index 9e64eb85..7fcc88f6 100644 --- a/src/common/serialization/vst3/plugin-factory-proxy.cpp +++ b/src/common/serialization/vst3/plugin-factory-proxy.cpp @@ -27,17 +27,15 @@ Vst3PluginFactoryProxy::Vst3PluginFactoryProxy(ConstructArgs&& args) noexcept arguments_(std::move(args)){FUNKNOWN_CTOR} // clang-format just doesn't understand these macros, I guess - Vst3PluginFactoryProxy::~Vst3PluginFactoryProxy() noexcept { - FUNKNOWN_DTOR -} - + Vst3PluginFactoryProxy::~Vst3PluginFactoryProxy() noexcept {FUNKNOWN_DTOR} #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" -IMPLEMENT_REFCOUNT(Vst3PluginFactoryProxy) + IMPLEMENT_REFCOUNT(Vst3PluginFactoryProxy) #pragma GCC diagnostic pop -tresult PLUGIN_API -Vst3PluginFactoryProxy::queryInterface(Steinberg::FIDString _iid, void** obj) { + tresult PLUGIN_API Vst3PluginFactoryProxy::queryInterface( + Steinberg::FIDString _iid, + void** obj) { if (YaPluginFactory3::supports_plugin_factory()) { QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid, Steinberg::IPluginFactory) diff --git a/src/common/serialization/vst3/plugin-proxy.cpp b/src/common/serialization/vst3/plugin-proxy.cpp index 79e7f55c..e57fb910 100644 --- a/src/common/serialization/vst3/plugin-proxy.cpp +++ b/src/common/serialization/vst3/plugin-proxy.cpp @@ -77,17 +77,15 @@ Vst3PluginProxy::Vst3PluginProxy(ConstructArgs&& args) noexcept std::move(args.xml_representation_controller_args)), arguments_(std::move(args)){FUNKNOWN_CTOR} - Vst3PluginProxy::~Vst3PluginProxy() noexcept { - FUNKNOWN_DTOR -} - + Vst3PluginProxy::~Vst3PluginProxy() noexcept {FUNKNOWN_DTOR} #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" -IMPLEMENT_REFCOUNT(Vst3PluginProxy) + IMPLEMENT_REFCOUNT(Vst3PluginProxy) #pragma GCC diagnostic pop -tresult PLUGIN_API Vst3PluginProxy::queryInterface(Steinberg::FIDString _iid, - void** obj) { + tresult PLUGIN_API Vst3PluginProxy::queryInterface( + Steinberg::FIDString _iid, + void** obj) { if (YaPluginBase::supported()) { // We had to expand the macro here because we need to cast through // `YaPluginBase`, since `IpluginBase` is also a base of `IComponent` diff --git a/src/plugin/bridges/vst2.cpp b/src/plugin/bridges/vst2.cpp index e8cde958..c5ba7d17 100644 --- a/src/plugin/bridges/vst2.cpp +++ b/src/plugin/bridges/vst2.cpp @@ -77,7 +77,7 @@ Vst2PluginBridge::Vst2PluginBridge(const ghc::filesystem::path& plugin_path, set_realtime_priority(true); pthread_setname_np(pthread_self(), "host-callbacks"); - sockets_.vst_host_callback_.receive_events( + sockets_.plugin_host_callback_.receive_events( std::pair(logger_, false), [&](Vst2Event& event, bool /*on_main_thread*/) { 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 // calls `audioMasterIOChanged()` and after the host calls `effOpen()`. const auto initialization_data = - sockets_.host_vst_control_.receive_single(); + sockets_.host_plugin_control_.receive_single(); const auto initialized_plugin = std::get(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 // back to complete the startup process - sockets_.host_vst_control_.send(config_); + sockets_.host_plugin_control_.send(config_); update_aeffect(plugin_, initialized_plugin); } @@ -250,7 +250,7 @@ class DispatchDataConverter : public DefaultDataConverter { break; case effEditOpen: // 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 // window into this X11 window handle. return reinterpret_cast(data); @@ -541,7 +541,7 @@ intptr_t Vst2PluginBridge::dispatch(AEffect* /*plugin*/, intptr_t return_value = 0; try { // 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(logger_, true), opcode, index, value, data, option); } 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 // receiving function temporarily allocate a large enough buffer rather than // 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(logger_, true), opcode, index, 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 // processing request parameters to the Wine plugin host so it can start // 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 // acknowledgement that audio processing has finished. At this point the // audio will have been written to our buffers. - sockets_.host_vst_process_replacing_.receive_single(); + sockets_.host_plugin_process_replacing_.receive_single(); for (int channel = 0; channel < plugin_.numOutputs; 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 { std::lock_guard lock(parameters_mutex_); - sockets_.host_vst_parameters_.send(request); + sockets_.host_plugin_parameters_.send(request); response = - sockets_.host_vst_parameters_.receive_single(); + sockets_.host_plugin_parameters_.receive_single(); } logger_.log_get_parameter_response(*response.value); @@ -798,10 +798,10 @@ void Vst2PluginBridge::set_parameter(AEffect* /*plugin*/, { std::lock_guard lock(parameters_mutex_); - sockets_.host_vst_parameters_.send(request); + sockets_.host_plugin_parameters_.send(request); response = - sockets_.host_vst_parameters_.receive_single(); + sockets_.host_plugin_parameters_.receive_single(); } logger_.log_set_parameter_response(); diff --git a/src/plugin/bridges/vst2.h b/src/plugin/bridges/vst2.h index 5f897a31..275f53c8 100644 --- a/src/plugin/bridges/vst2.h +++ b/src/plugin/bridges/vst2.h @@ -27,8 +27,8 @@ /** * 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 - * `AEffect` object. + * Wine plugin host. The functions below should be used as callback functions in + * an `AEffect` object. * * The naming scheme of all of these 'bridge' classes is `{,Plugin}Bridge` * for greppability reasons. The `Plugin` infix is added on the native plugin diff --git a/src/plugin/bridges/vst3.cpp b/src/plugin/bridges/vst3.cpp index 00c9a2d5..5fda94a1 100644 --- a/src/plugin/bridges/vst3.cpp +++ b/src/plugin/bridges/vst3.cpp @@ -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 // 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 - // 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. host_callback_handler_ = std::jthread([&]() { set_realtime_priority(true); pthread_setname_np(pthread_self(), "host-callbacks"); - sockets_.vst_host_callback_.receive_messages( + sockets_.plugin_host_callback_.receive_messages( std::pair(logger_, false), overload{ [&](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 // copy of the configuration during its initialization. Vst3PluginFactoryProxy::ConstructArgs factory_args = - sockets_.host_vst_control_.send_message( + sockets_.host_plugin_control_.send_message( Vst3PluginFactoryProxy::Construct{}, std::pair(logger_, true)); plugin_factory_ = Steinberg::owned( diff --git a/src/plugin/bridges/vst3.h b/src/plugin/bridges/vst3.h index 6c93521d..fb3e149e 100644 --- a/src/plugin/bridges/vst3.h +++ b/src/plugin/bridges/vst3.h @@ -117,15 +117,15 @@ class Vst3PluginBridge : PluginBridge> { /** * 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 - * use in VST3 interface implementations. This is mostly used for main + * This is a shorthand for `sockets_.host_plugin_control_.send_message()` + * for use in VST3 interface implementations. This is mostly used for main * thread messages but outside of the situations where plugins will crash or * misbehave thread guarantees are not always upheld in yabridge's VST3 * implementation. */ template 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(logger_, true)); } @@ -199,7 +199,7 @@ class Vst3PluginBridge : PluginBridge> { private: /** * Handles callbacks from the plugin to the host over the - * `vst_host_callback_` sockets. + * `plugin_host_callback_` sockets. */ std::jthread host_callback_handler_; diff --git a/src/plugin/host-process.cpp b/src/plugin/host-process.cpp index e1f1e1c7..b58bc1b6 100644 --- a/src/plugin/host-process.cpp +++ b/src/plugin/host-process.cpp @@ -107,8 +107,8 @@ IndividualHost::IndividualHost(asio::io_context& io_context, const HostRequest& host_request) : HostProcess(io_context, sockets), plugin_info_(plugin_info), - host_path_(find_vst_host(plugin_info.native_library_path_, - plugin_info.plugin_arch_)), + host_path_(find_plugin_host(plugin_info.native_library_path_, + plugin_info.plugin_arch_)), handle_(launch_host( host_path_, { @@ -168,8 +168,8 @@ GroupHost::GroupHost(asio::io_context& io_context, const HostRequest& host_request) : HostProcess(io_context, sockets), plugin_info_(plugin_info), - host_path_(find_vst_host(plugin_info.native_library_path_, - plugin_info.plugin_arch_)) { + host_path_(find_plugin_host(plugin_info.native_library_path_, + plugin_info.plugin_arch_)) { // 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, // then we'll start a new process. In the event that multiple yabridge diff --git a/src/plugin/utils.cpp b/src/plugin/utils.cpp index acd431bc..98e9c461 100644 --- a/src/plugin/utils.cpp +++ b/src/plugin/utils.cpp @@ -307,8 +307,8 @@ std::string create_logger_prefix(const fs::path& endpoint_base_dir) { return "[" + endpoint_name + "] "; } -fs::path find_vst_host(const ghc::filesystem::path& this_plugin_path, - LibArchitecture plugin_arch) { +fs::path find_plugin_host(const ghc::filesystem::path& this_plugin_path, + LibArchitecture plugin_arch) { auto host_name = yabridge_host_name; if (plugin_arch == LibArchitecture::dll_32) { 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; } - if (const std::optional vst_host_path = + if (const std::optional plugin_host_path = search_in_path(get_augmented_search_path(), host_name)) { - return *vst_host_path; + return *plugin_host_path; } else { throw std::runtime_error("Could not locate '" + std::string(host_name) + "'"); diff --git a/src/plugin/utils.h b/src/plugin/utils.h index d83b3bc1..98f96931 100644 --- a/src/plugin/utils.h +++ b/src/plugin/utils.h @@ -45,8 +45,9 @@ struct PluginInfo { public: /** * 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 - * to load. For VST2 plugins this is a file with the same name but with a + * `libyabridge-{clap,vst2,vst3}.so` file and the type of the plugin we're + * 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 * 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 @@ -181,13 +182,14 @@ std::string create_logger_prefix( const ghc::filesystem::path& endpoint_base_dir); /** - * Finds the Wine VST host (either `yabridge-host.exe` or `yabridge-host-32.exe` - * depending on the plugin). For this we will search in two places: + * Finds the Wine plugin host (either `yabridge-host.exe` or + * `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 - * useful when developing, as you can simply symlink the - * `libyabridge-{clap,vst2,vst3}.so` file in the build directory without having - * to install anything to /usr. + * 1. Alongside libyabridge-{clap,vst2,vst3}.so if the file got symlinked. + * This is useful when developing, as you can simply symlink the + * `libyabridge-{clap,vst2,vst3}.so` file in the build directory without + * having to install anything to /usr. * 2. In the regular search path, augmented with `~/.local/share/yabridge` to * ease the setup process. * @@ -197,9 +199,9 @@ std::string create_logger_prefix( * Used to determine which host application to use, if available. * * @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, 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 - * `libyabridge-{clap,vst2,vst3}.so`. If no configuration file could be found then - * this will return an empty configuration object with default settings. See the - * docstrong on the `Configuration` class for more details on how to choose the - * config file to load. + * `libyabridge-{clap,vst2,vst3}.so`. If no configuration file could be found + * then this will return an empty configuration object with default settings. + * See the docstrong on the `Configuration` class for more details on how to + * choose the config file to load. * * This function will take any optional compile-time features that have not been * enabled into account. diff --git a/src/wine-host/bridges/vst2.cpp b/src/wine-host/bridges/vst2.cpp index 4a78a36b..eb36ab22 100644 --- a/src/wine-host/bridges/vst2.cpp +++ b/src/wine-host/bridges/vst2.cpp @@ -216,14 +216,14 @@ Vst2Bridge::Vst2Bridge(MainContext& main_context, // done after the host calls `effOpen()`, and when the plugin calls // `audioMasterIOChanged()`. We will also send along this host's version so // 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, .payload = *plugin_, .value_payload = yabridge_git_version}); // After sending the AEffect struct we'll receive this instance's // configuration as a response - config_ = sockets_.host_vst_control_.receive_single(); + config_ = sockets_.host_plugin_control_.receive_single(); // Allow this plugin to configure the main context's tick rate main_context.update_timer_interval(config_.event_loop_interval()); @@ -232,7 +232,7 @@ Vst2Bridge::Vst2Bridge(MainContext& main_context, set_realtime_priority(true); pthread_setname_np(pthread_self(), "parameters"); - sockets_.host_vst_parameters_.receive_multi( + sockets_.host_plugin_parameters_.receive_multi( [&](Parameter& request, SerializationBufferBase& buffer) { // Both `getParameter` and `setParameter` functions are passed // through on this socket since they have a lot of overlap. The @@ -244,13 +244,13 @@ Vst2Bridge::Vst2Bridge(MainContext& main_context, *request.value); ParameterResult response{std::nullopt}; - sockets_.host_vst_parameters_.send(response, buffer); + sockets_.host_plugin_parameters_.send(response, buffer); } else { // `getParameter` float value = plugin_->getParameter(plugin_, request.index); 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 ScopedFlushToZero ftz_guard; - sockets_.host_vst_process_replacing_.receive_multi< + sockets_.host_plugin_process_replacing_.receive_multi< Vst2ProcessRequest>([&](Vst2ProcessRequest& process_request, SerializationBufferBase& buffer) { // 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 // we cannot reuse the request object because a plugin may have // 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 // don't just clear `next_buffer_midi_events` here @@ -388,7 +388,7 @@ bool Vst2Bridge::inhibits_event_loop() noexcept { void Vst2Bridge::run() { set_realtime_priority(true); - sockets_.host_vst_dispatch_.receive_events( + sockets_.host_plugin_dispatch_.receive_events( std::nullopt, [&](Vst2Event& event, bool /*on_main_thread*/) -> Vst2EventResult { if (event.opcode == effProcessEvents) { @@ -706,7 +706,7 @@ intptr_t Vst2Bridge::host_callback(AEffect* effect, HostCallbackDataConverter converter(effect, last_time_info_, mutual_recursion_); - return sockets_.vst_host_callback_.send_event( + return sockets_.plugin_host_callback_.send_event( converter, std::nullopt, opcode, index, value, data, option); } diff --git a/src/wine-host/bridges/vst3.cpp b/src/wine-host/bridges/vst3.cpp index 5e0af464..7688395e 100644 --- a/src/wine-host/bridges/vst3.cpp +++ b/src/wine-host/bridges/vst3.cpp @@ -104,7 +104,7 @@ Vst3Bridge::Vst3Bridge(MainContext& main_context, // Fetch this instance's configuration from the plugin to finish the setup // process - config_ = sockets_.vst_host_callback_.send_message( + config_ = sockets_.plugin_host_callback_.send_message( WantsConfiguration{.host_version = yabridge_git_version}, std::nullopt); // Allow this plugin to configure the main context's tick rate @@ -126,7 +126,7 @@ bool Vst3Bridge::inhibits_event_loop() noexcept { void Vst3Bridge::run() { set_realtime_priority(true); - sockets_.host_vst_control_.receive_messages( + sockets_.host_plugin_control_.receive_messages( std::nullopt, overload{ [&](const Vst3PluginFactoryProxy::Construct&) diff --git a/src/wine-host/bridges/vst3.h b/src/wine-host/bridges/vst3.h index bae8cbb9..c5ef3603 100644 --- a/src/wine-host/bridges/vst3.h +++ b/src/wine-host/bridges/vst3.h @@ -331,12 +331,13 @@ class Vst3Bridge : public HostBridge { public: /** * 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 - * interface implementations. + * shorthand for `sockets.plugin_host_callback_.send_message` for use in + * VST3 interface implementations. */ template 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); } /**