Keep track of active YaComponentPluginImpls

So we can do host callbacks later.
This commit is contained in:
Robbert van der Helm
2020-12-12 21:24:11 +01:00
parent efc840a51a
commit 1b30000147
3 changed files with 64 additions and 1 deletions
+4 -1
View File
@@ -18,11 +18,14 @@
YaComponentPluginImpl::YaComponentPluginImpl(Vst3PluginBridge& bridge,
YaComponent::ConstructArgs&& args)
: YaComponent(std::move(args)), bridge(bridge) {}
: YaComponent(std::move(args)), bridge(bridge) {
bridge.register_component(arguments.instance_id, *this);
}
YaComponentPluginImpl::~YaComponentPluginImpl() {
bridge.send_message(
YaComponent::Destruct{.instance_id = arguments.instance_id});
bridge.unregister_component(arguments.instance_id);
}
tresult PLUGIN_API