diff --git a/src/common/logging/vst3.cpp b/src/common/logging/vst3.cpp index 1fa0a09a..0c809c80 100644 --- a/src/common/logging/vst3.cpp +++ b/src/common/logging/vst3.cpp @@ -22,7 +22,7 @@ Vst3Logger::Vst3Logger(Logger& generic_logger) : logger(generic_logger) {} -void Vst3Logger::log_request(bool is_host_vst, const YaComponent::Create&) { +void Vst3Logger::log_request(bool is_host_vst, const YaComponent::Construct&) { log_request_base(is_host_vst, [](auto& message) { // TODO: Log the cid in some readable way, if possible message << "IPluginFactory::createComponent(cid, IComponent::iid, " @@ -31,7 +31,7 @@ void Vst3Logger::log_request(bool is_host_vst, const YaComponent::Create&) { } void Vst3Logger::log_request(bool is_host_vst, - const YaComponent::Destroy& request) { + const YaComponent::Destruct& request) { log_request_base(is_host_vst, [&](auto& message) { message << "::~IComponent()"; @@ -63,9 +63,9 @@ void Vst3Logger::log_response(bool is_host_vst, const Ack&) { void Vst3Logger::log_response( bool is_host_vst, - const std::variant& result) { + const std::variant& result) { log_response_base(is_host_vst, [&](auto& message) { - std::visit(overload{[&](const YaComponent::CreateArgs& args) { + std::visit(overload{[&](const YaComponent::ConstructArgs& args) { message << ""; }, diff --git a/src/common/logging/vst3.h b/src/common/logging/vst3.h index a4dfe316..cac56886 100644 --- a/src/common/logging/vst3.h +++ b/src/common/logging/vst3.h @@ -47,8 +47,8 @@ class Vst3Logger { // flag here indicates whether the request was initiated on the host side // (what we'll call a control message). - void log_request(bool is_host_vst, const YaComponent::Create&); - void log_request(bool is_host_vst, const YaComponent::Destroy&); + void log_request(bool is_host_vst, const YaComponent::Construct&); + void log_request(bool is_host_vst, const YaComponent::Destruct&); void log_request(bool is_host_vst, const YaComponent::Terminate&); void log_request(bool is_host_vst, const WantsConfiguration&); void log_request(bool is_host_vst, const WantsPluginFactory&); @@ -56,7 +56,7 @@ class Vst3Logger { void log_response(bool is_host_vst, const Ack&); void log_response( bool is_host_vst, - const std::variant&); + const std::variant&); void log_response(bool is_host_vst, const Configuration&); void log_response(bool is_host_vst, const YaPluginFactory&); diff --git a/src/common/serialization/vst3.h b/src/common/serialization/vst3.h index 8c34e6fa..5dde5922 100644 --- a/src/common/serialization/vst3.h +++ b/src/common/serialization/vst3.h @@ -68,8 +68,8 @@ struct WantsPluginFactory { * encodes the information we request or the operation we want to perform. A * request of type `ControlRequest(T)` should send back a `T::Response`. */ -using ControlRequest = std::variant; diff --git a/src/common/serialization/vst3/component.cpp b/src/common/serialization/vst3/component.cpp index 494b5f18..974743a4 100644 --- a/src/common/serialization/vst3/component.cpp +++ b/src/common/serialization/vst3/component.cpp @@ -16,9 +16,9 @@ #include "component.h" -YaComponent::CreateArgs::CreateArgs() {} +YaComponent::ConstructArgs::ConstructArgs() {} -YaComponent::CreateArgs::CreateArgs( +YaComponent::ConstructArgs::ConstructArgs( Steinberg::IPtr component, size_t instance_id) : instance_id(instance_id) { @@ -29,7 +29,7 @@ YaComponent::CreateArgs::CreateArgs( } } -YaComponent::YaComponent(const CreateArgs&& args) : arguments(std::move(args)) { +YaComponent::YaComponent(const ConstructArgs&& args) : arguments(std::move(args)) { FUNKNOWN_CTOR // Everything else is handled directly through callbacks to minimize the diff --git a/src/common/serialization/vst3/component.h b/src/common/serialization/vst3/component.h index 9d6d9923..1066b577 100644 --- a/src/common/serialization/vst3/component.h +++ b/src/common/serialization/vst3/component.h @@ -49,14 +49,14 @@ class YaComponent : public Steinberg::Vst::IComponent { /** * These are the arguments for creating a `YaComponentPluginImpl`. */ - struct CreateArgs { - CreateArgs(); + struct ConstructArgs { + ConstructArgs(); /** * Read arguments from an existing implementation. */ - CreateArgs(Steinberg::IPtr component, - size_t isntance_id); + ConstructArgs(Steinberg::IPtr component, + size_t isntance_id); /** * The unique identifier for this specific instance. @@ -83,8 +83,8 @@ class YaComponent : public Steinberg::Vst::IComponent { * IComponent::iid, * ...)`. */ - struct Create { - using Response = std::variant; + struct Construct { + using Response = std::variant; ArrayUID cid; @@ -98,14 +98,14 @@ class YaComponent : public Steinberg::Vst::IComponent { * Instantiate this instance with arguments read from another interface * implementation. */ - YaComponent(const CreateArgs&& args); + YaComponent(const ConstructArgs&& args); /** * Message to request the Wine plugin host to destroy the IComponent * instance with the given instance ID. Sent from the destructor of * `YaComponentPluginImpl`. */ - struct Destroy { + struct Destruct { using Response = Ack; native_size_t instance_id; @@ -170,7 +170,7 @@ class YaComponent : public Steinberg::Vst::IComponent { getState(Steinberg::IBStream* state) override = 0; protected: - CreateArgs arguments; + ConstructArgs arguments; }; #pragma GCC diagnostic pop @@ -178,6 +178,6 @@ class YaComponent : public Steinberg::Vst::IComponent { template void serialize( S& s, - std::variant& result) { + std::variant& result) { s.ext(result, bitsery::ext::StdVariant{}); } diff --git a/src/plugin/bridges/vst3-impls/component.cpp b/src/plugin/bridges/vst3-impls/component.cpp index 3d035a03..4978b9b5 100644 --- a/src/plugin/bridges/vst3-impls/component.cpp +++ b/src/plugin/bridges/vst3-impls/component.cpp @@ -17,12 +17,12 @@ #include "component.h" YaComponentPluginImpl::YaComponentPluginImpl(Vst3PluginBridge& bridge, - YaComponent::CreateArgs&& args) + YaComponent::ConstructArgs&& args) : YaComponent(std::move(args)), bridge(bridge) {} YaComponentPluginImpl::~YaComponentPluginImpl() { bridge.send_message( - YaComponent::Destroy{.instance_id = arguments.instance_id}); + YaComponent::Destruct{.instance_id = arguments.instance_id}); } tresult PLUGIN_API diff --git a/src/plugin/bridges/vst3-impls/component.h b/src/plugin/bridges/vst3-impls/component.h index afe2edfe..dddd1b88 100644 --- a/src/plugin/bridges/vst3-impls/component.h +++ b/src/plugin/bridges/vst3-impls/component.h @@ -21,7 +21,7 @@ class YaComponentPluginImpl : public YaComponent { public: YaComponentPluginImpl(Vst3PluginBridge& bridge, - YaComponent::CreateArgs&& args); + YaComponent::ConstructArgs&& args); /** * When the reference count reaches zero and this destructor is called, diff --git a/src/plugin/bridges/vst3-impls/plugin-factory.cpp b/src/plugin/bridges/vst3-impls/plugin-factory.cpp index fad34cb4..28c77be8 100644 --- a/src/plugin/bridges/vst3-impls/plugin-factory.cpp +++ b/src/plugin/bridges/vst3-impls/plugin-factory.cpp @@ -31,11 +31,11 @@ YaPluginFactoryPluginImpl::createInstance(Steinberg::FIDString cid, ArrayUID cid_array; std::copy(cid, cid + sizeof(Steinberg::TUID), cid_array.begin()); if (Steinberg::FIDStringsEqual(_iid, Steinberg::Vst::IComponent::iid)) { - std::variant result = - bridge.send_message(YaComponent::Create{.cid = cid_array}); + std::variant result = + bridge.send_message(YaComponent::Construct{.cid = cid_array}); return std::visit( overload{ - [&](YaComponent::CreateArgs&& args) -> tresult { + [&](YaComponent::ConstructArgs&& args) -> tresult { // I find all of these raw pointers scary *obj = new YaComponentPluginImpl(bridge, std::move(args)); return Steinberg::kResultOk; diff --git a/src/wine-host/bridges/vst3.cpp b/src/wine-host/bridges/vst3.cpp index 0e321644..8fcc2318 100644 --- a/src/wine-host/bridges/vst3.cpp +++ b/src/wine-host/bridges/vst3.cpp @@ -51,8 +51,8 @@ void Vst3Bridge::run() { sockets.host_vst_control.receive_messages( std::nullopt, overload{ - [&](const YaComponent::Create& args) - -> YaComponent::Create::Response { + [&](const YaComponent::Construct& args) + -> YaComponent::Construct::Response { Steinberg::TUID cid; std::copy(args.cid.begin(), args.cid.end(), cid); Steinberg::IPtr component = @@ -64,15 +64,15 @@ void Vst3Bridge::run() { const size_t instance_id = generate_instance_id(); component_instances[instance_id] = std::move(component); - return YaComponent::CreateArgs( + return YaComponent::ConstructArgs( component_instances[instance_id], instance_id); } else { // The actual result is lost here return UniversalTResult(Steinberg::kNotImplemented); } }, - [&](const YaComponent::Destroy& request) - -> YaComponent::Destroy::Response { + [&](const YaComponent::Destruct& request) + -> YaComponent::Destruct::Response { std::lock_guard lock(component_instances_mutex); component_instances.erase(request.instance_id);