mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Rename YaComponent::Arguments to CreateArgs
This commit is contained in:
@@ -44,7 +44,7 @@ void Vst3Logger::log_request(bool is_host_vst, const WantsPluginFactory&) {
|
||||
|
||||
void Vst3Logger::log_response(
|
||||
bool is_host_vst,
|
||||
const std::optional<YaComponent::Arguments>& args) {
|
||||
const std::optional<YaComponent::CreateArgs>& args) {
|
||||
log_response_base(is_host_vst, [&](auto& message) {
|
||||
if (args) {
|
||||
message << "<IComponent* #" << args->instance_id << ">";
|
||||
|
||||
@@ -52,7 +52,7 @@ class Vst3Logger {
|
||||
void log_request(bool is_host_vst, const WantsPluginFactory&);
|
||||
|
||||
void log_response(bool is_host_vst,
|
||||
const std::optional<YaComponent::Arguments>&);
|
||||
const std::optional<YaComponent::CreateArgs>&);
|
||||
void log_response(bool is_host_vst, const Configuration&);
|
||||
void log_response(bool is_host_vst, const YaPluginFactory&);
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
#include "component.h"
|
||||
|
||||
YaComponent::Arguments::Arguments() {}
|
||||
YaComponent::CreateArgs::CreateArgs() {}
|
||||
|
||||
YaComponent::Arguments::Arguments(
|
||||
YaComponent::CreateArgs::CreateArgs(
|
||||
Steinberg::IPtr<Steinberg::Vst::IComponent> component,
|
||||
size_t instance_id)
|
||||
: instance_id(instance_id) {
|
||||
@@ -29,7 +29,7 @@ YaComponent::Arguments::Arguments(
|
||||
}
|
||||
}
|
||||
|
||||
YaComponent::YaComponent(const Arguments&& args) : arguments(std::move(args)) {
|
||||
YaComponent::YaComponent(const CreateArgs&& args) : arguments(std::move(args)) {
|
||||
FUNKNOWN_CTOR
|
||||
|
||||
// Everything else is handled directly through callbacks to minimize the
|
||||
|
||||
@@ -47,14 +47,14 @@ class YaComponent : public Steinberg::Vst::IComponent {
|
||||
/**
|
||||
* These are the arguments for creating a `YaComponentPluginImpl`.
|
||||
*/
|
||||
struct Arguments {
|
||||
Arguments();
|
||||
struct CreateArgs {
|
||||
CreateArgs();
|
||||
|
||||
/**
|
||||
* Read arguments from an existing implementation.
|
||||
*/
|
||||
Arguments(Steinberg::IPtr<Steinberg::Vst::IComponent> component,
|
||||
size_t isntance_id);
|
||||
CreateArgs(Steinberg::IPtr<Steinberg::Vst::IComponent> component,
|
||||
size_t isntance_id);
|
||||
|
||||
/**
|
||||
* The unique identifier for this specific instance.
|
||||
@@ -83,7 +83,7 @@ class YaComponent : public Steinberg::Vst::IComponent {
|
||||
*/
|
||||
struct Create {
|
||||
// TODO: Create a `native_tvalue` wrapper, and then also add them here
|
||||
using Response = std::optional<Arguments>;
|
||||
using Response = std::optional<CreateArgs>;
|
||||
|
||||
ArrayUID cid;
|
||||
|
||||
@@ -97,7 +97,7 @@ class YaComponent : public Steinberg::Vst::IComponent {
|
||||
* Instantiate this instance with arguments read from another interface
|
||||
* implementation.
|
||||
*/
|
||||
YaComponent(const Arguments&& args);
|
||||
YaComponent(const CreateArgs&& args);
|
||||
|
||||
/**
|
||||
* @remark The plugin side implementation should send a control message to
|
||||
@@ -137,14 +137,14 @@ class YaComponent : public Steinberg::Vst::IComponent {
|
||||
getState(Steinberg::IBStream* state) override = 0;
|
||||
|
||||
private:
|
||||
Arguments arguments;
|
||||
CreateArgs arguments;
|
||||
|
||||
// TODO: As explained in a few other places, `YaComponent` objects should be
|
||||
// assigned a unique ID for identification
|
||||
};
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s, std::optional<YaComponent::Arguments>& args) {
|
||||
void serialize(S& s, std::optional<YaComponent::CreateArgs>& args) {
|
||||
s.ext(args, bitsery::ext::StdOptional{});
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "component.h"
|
||||
|
||||
YaComponentPluginImpl::YaComponentPluginImpl(Vst3PluginBridge& bridge,
|
||||
YaComponent::Arguments&& args)
|
||||
YaComponent::CreateArgs&& args)
|
||||
: YaComponent(std::move(args)), bridge(bridge) {}
|
||||
|
||||
YaComponentPluginImpl::~YaComponentPluginImpl() {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
class YaComponentPluginImpl : public YaComponent {
|
||||
public:
|
||||
YaComponentPluginImpl(Vst3PluginBridge& bridge,
|
||||
YaComponent::Arguments&& args);
|
||||
YaComponent::CreateArgs&& args);
|
||||
|
||||
/**
|
||||
* When the reference count reaches zero and this destructor is called,
|
||||
|
||||
@@ -31,7 +31,7 @@ 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::optional<YaComponent::Arguments> args =
|
||||
std::optional<YaComponent::CreateArgs> args =
|
||||
bridge.send_message(YaComponent::Create{.cid = cid_array});
|
||||
if (args) {
|
||||
// I find all of these raw pointers scary
|
||||
|
||||
@@ -64,7 +64,7 @@ void Vst3Bridge::run() {
|
||||
const size_t instance_id = generate_instance_id();
|
||||
component_instances[instance_id] = std::move(component);
|
||||
|
||||
return std::make_optional<YaComponent::Arguments>(
|
||||
return std::make_optional<YaComponent::CreateArgs>(
|
||||
component_instances[instance_id], instance_id);
|
||||
} else {
|
||||
return std::nullopt;
|
||||
|
||||
Reference in New Issue
Block a user