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