Rename YaComponent::Arguments to CreateArgs

This commit is contained in:
Robbert van der Helm
2020-12-11 22:43:12 +01:00
parent d1d85711f0
commit cdb9dae2df
8 changed files with 17 additions and 17 deletions
+1 -1
View File
@@ -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 << ">";
+1 -1
View File
@@ -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&);
+3 -3
View File
@@ -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
+8 -8
View File
@@ -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{});
}
+1 -1
View File
@@ -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() {
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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;