Rename Create/Destroy to Construct/Destruct

This is less likely to clash with names used by interfaces and it's a
bit clearer what's going on (since they are basically proxies for
constructors and destructors).
This commit is contained in:
Robbert van der Helm
2020-12-12 16:16:18 +01:00
parent 1088483f15
commit f637e6ad18
9 changed files with 33 additions and 33 deletions
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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,
@@ -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<YaComponent::CreateArgs, UniversalTResult> result =
bridge.send_message(YaComponent::Create{.cid = cid_array});
std::variant<YaComponent::ConstructArgs, UniversalTResult> 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;