Change terminology from 'VST' to 'plugin'

This commit is contained in:
Robbert van der Helm
2022-08-23 18:34:03 +02:00
parent bf7280fc7e
commit 4ca7ea17b2
35 changed files with 703 additions and 706 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ if with_clap
compiler_options += '-DWITH_CLAP'
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'
+1 -1
View File
@@ -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.'
)
+13 -13
View File
@@ -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<asio::local::stream_protocol::acceptor> acceptor_;
@@ -1010,8 +1010,8 @@ class TypedMessageHandler : public AdHocSocketHandler<Thread> {
// only print the responses when the request was not filtered out.
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<Thread> {
});
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<Thread> {
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<Thread> {
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) {
+35 -32
View File
@@ -322,8 +322,8 @@ class Vst2EventHandler : public AdHocSocketHandler<Thread> {
* 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 `<from>_<to>_<event>`. For
// instance the socket named `host_vst_dispatch` forwards
// instance the socket named `host_plugin_dispatch` forwards
// `AEffect.dispatch()` calls from the native VST host to the Windows VST
// 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<Thread> host_vst_dispatch_;
Vst2EventHandler<Thread> host_plugin_dispatch_;
/**
* The socket that forwards all `audioMaster()` calls from the Windows VST
* plugin to the host.
*/
Vst2EventHandler<Thread> vst_host_callback_;
Vst2EventHandler<Thread> 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_;
};
/**
+20 -16
View File
@@ -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<Thread, Vst3Logger, ControlRequest> host_vst_control_;
TypedMessageHandler<Thread, Vst3Logger, ControlRequest>
host_plugin_control_;
/**
* For sending callbacks from the plugin back to the host. After we have a
* better idea of what our communication model looks like we'll probably
* want to provide an abstraction similar to `Vst2EventHandler`.
*/
TypedMessageHandler<Thread, Vst3Logger, CallbackRequest> vst_host_callback_;
TypedMessageHandler<Thread, Vst3Logger, CallbackRequest>
plugin_host_callback_;
private:
/**
+2 -2
View File
@@ -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.
+5 -5
View File
@@ -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();
+2 -2
View File
@@ -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
File diff suppressed because it is too large Load Diff
+181 -164
View File
@@ -60,280 +60,297 @@ class Vst3Logger {
// way we can filter out the log message for the response together with the
// 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<YaAudioProcessor::Process>&);
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<Vst3PluginProxy::ConstructArgs, UniversalTResult>&);
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 <typename T>
void log_response(bool is_host_vst,
void log_response(bool is_host_plugin,
const PrimitiveWrapper<T>& 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 <std::invocable<std::ostringstream&> F>
bool log_request_base(bool is_host_vst,
bool log_request_base(bool is_host_plugin,
Logger::Verbosity min_verbosity,
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 <std::invocable<std::ostringstream&> 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 <std::invocable<std::ostringstream&> F>
void log_response_base(bool is_host_vst, F callback) {
void log_response_base(bool is_host_plugin, F callback) {
std::ostringstream message;
if (is_host_vst) {
if (is_host_plugin) {
message << "[vst <- host] ";
} else {
message << "[host <- vst] ";
+2 -4
View File
@@ -168,8 +168,7 @@ class MutualRecursionHelper {
// pretend that we're not doing any async things here
std::packaged_task<Result()> do_call(std::forward<F>(fn));
std::future<Result> 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<std::shared_ptr<asio::io_context>>
mutual_recursion_contexts_;
std::vector<std::shared_ptr<asio::io_context>> mutual_recursion_contexts_;
std::mutex mutual_recursion_contexts_mutex_;
};
+6 -6
View File
@@ -236,11 +236,11 @@ class alignas(16) DynamicSpeakerArrangement {
};
/**
* Marker struct to indicate that the other side (the Wine VST host) should send
* 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<float> value;
+4 -4
View File
@@ -67,7 +67,7 @@ struct WantsConfiguration {
};
/**
* When we send a control message from the plugin to the Wine VST host, this
* When we send a control message from the plugin to the Wine plugin host, this
* encodes the information we request or the operation we want to perform. A
* 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<Vst3ContextMenuProxy::Destruct,
@@ -78,10 +78,7 @@ static const char* stream_meta_data_string_keys[] = {
YaAttributeList::YaAttributeList() noexcept {FUNKNOWN_CTOR}
YaAttributeList::~YaAttributeList() noexcept {
FUNKNOWN_DTOR
}
YaAttributeList::~YaAttributeList() noexcept {FUNKNOWN_DTOR}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
IMPLEMENT_FUNKNOWN_METHODS(YaAttributeList,
@@ -89,7 +86,7 @@ IMPLEMENT_FUNKNOWN_METHODS(YaAttributeList,
Steinberg::Vst::IAttributeList::iid)
#pragma GCC diagnostic pop
std::vector<std::string> YaAttributeList::keys_and_types() const {
std::vector<std::string> YaAttributeList::keys_and_types() const {
std::vector<std::string> result{};
for (const auto& [key, value] : attrs_int_) {
result.push_back("\"" + key + "\" (int)");
+3 -6
View File
@@ -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,
@@ -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)
@@ -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)
@@ -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)
@@ -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
@@ -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)
+8 -13
View File
@@ -25,18 +25,16 @@ YaMessagePtr::YaMessagePtr(IMessage& message)
original_message_ptr_(static_cast<native_size_t>(
reinterpret_cast<size_t>(&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<IMessage*>(
static_cast<size_t>(original_message_ptr_));
@@ -64,10 +62,7 @@ Steinberg::Vst::IAttributeList* PLUGIN_API YaMessagePtr::getAttributes() {
YaMessage::YaMessage() noexcept {FUNKNOWN_CTOR}
YaMessage::~YaMessage() noexcept {
FUNKNOWN_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 {
@@ -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)
@@ -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)
@@ -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)
@@ -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`
+12 -12
View File
@@ -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<Vst2Logger&, bool>(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<Vst2EventResult>();
sockets_.host_plugin_control_.receive_single<Vst2EventResult>();
const auto initialized_plugin =
std::get<AEffect>(initialization_data.payload);
@@ -188,7 +188,7 @@ Vst2PluginBridge::Vst2PluginBridge(const ghc::filesystem::path& plugin_path,
// After receiving the `AEffect` values we'll want to send the configuration
// 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<size_t>(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<Vst2Logger&, bool>(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<Vst2Logger&, bool>(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<Ack>();
sockets_.host_plugin_process_replacing_.receive_single<Ack>();
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<ParameterResult>();
sockets_.host_plugin_parameters_.receive_single<ParameterResult>();
}
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<ParameterResult>();
sockets_.host_plugin_parameters_.receive_single<ParameterResult>();
}
logger_.log_set_parameter_response();
+2 -2
View File
@@ -27,8 +27,8 @@
/**
* This handles the communication between the Linux native VST2 plugin and the
* 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 `<type>{,Plugin}Bridge`
* for greppability reasons. The `Plugin` infix is added on the native plugin
+3 -3
View File
@@ -46,13 +46,13 @@ Vst3PluginBridge::Vst3PluginBridge(const ghc::filesystem::path& plugin_path)
// Now that communication is set up the Wine host can send callbacks to this
// 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<Vst3Logger&, bool>(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<Vst3Logger&, bool>(logger_, true));
plugin_factory_ = Steinberg::owned(
+4 -4
View File
@@ -117,15 +117,15 @@ class Vst3PluginBridge : PluginBridge<Vst3Sockets<std::jthread>> {
/**
* Send a control message to the Wine plugin host and return the response.
* 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>
typename T::Response send_message(const T& object) {
return sockets_.host_vst_control_.send_message(
return sockets_.host_plugin_control_.send_message(
object, std::pair<Vst3Logger&, bool>(logger_, true));
}
@@ -199,7 +199,7 @@ class Vst3PluginBridge : PluginBridge<Vst3Sockets<std::jthread>> {
private:
/**
* Handles callbacks from the plugin to the host over the
* `vst_host_callback_` sockets.
* `plugin_host_callback_` sockets.
*/
std::jthread host_callback_handler_;
+4 -4
View File
@@ -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
+4 -4
View File
@@ -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<fs::path> vst_host_path =
if (const std::optional<fs::path> 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) +
"'");
+16 -14
View File
@@ -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.
+9 -9
View File
@@ -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<Configuration>();
config_ = sockets_.host_plugin_control_.receive_single<Configuration>();
// 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<Parameter>(
sockets_.host_plugin_parameters_.receive_multi<Parameter>(
[&](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);
}
+2 -2
View File
@@ -104,7 +104,7 @@ Vst3Bridge::Vst3Bridge(MainContext& main_context,
// Fetch this instance's configuration from the plugin to finish the setup
// 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&)
+4 -3
View File
@@ -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>
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);
}
/**