mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 12:30:12 +02:00
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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user