Redesign how interface instantiation works

Transferring some argument pack is much easier than trying to
deserialize into an existing object when you also have to transfer more
information than just that object.
This commit is contained in:
Robbert van der Helm
2020-12-08 17:33:51 +01:00
parent f4a5aa91fb
commit 5eb1fe2de2
7 changed files with 100 additions and 42 deletions
+6 -10
View File
@@ -66,17 +66,13 @@ void Vst3Bridge::run() {
// ID to that.
// - Add that ID to `YaComponent` and set it in the object
// we create here.
// - In case `factory` is a null pointer, allow returning
// `nullopt`. Not sure how that is going to work with
// the deserialization.
if (!component) {
// TODO: Handle
if (component) {
// TODO: Generate a unique instance ID
return std::make_optional<YaComponent::Arguments>(
component, 420691337);
} else {
return std::nullopt;
}
// TODO: Implement `YaComponentHostImpl` and create an instance
// based on `component`
YaComponent* removeme = nullptr;
return *removeme;
},
[&](const WantsPluginFactory&) -> WantsPluginFactory::Response {
return *plugin_factory;