Store host pointer in the plugin proxy

This commit is contained in:
Robbert van der Helm
2022-09-09 14:54:13 +02:00
parent c98ca66838
commit 82e552098a
3 changed files with 12 additions and 3 deletions
+8 -1
View File
@@ -38,7 +38,8 @@ class clap_plugin_proxy {
*/
clap_plugin_proxy(ClapPluginBridge& bridge,
size_t instance_id,
clap::plugin::Descriptor descriptor);
clap::plugin::Descriptor descriptor,
const clap_host_t* host);
clap_plugin_proxy(const clap_plugin_proxy&) = delete;
clap_plugin_proxy& operator=(const clap_plugin_proxy&) = delete;
@@ -82,6 +83,12 @@ class clap_plugin_proxy {
size_t instance_id_;
clap::plugin::Descriptor descriptor_;
/**
* The `clap_host_t*` passed when creating the instance. Any callbacks made
* by the proxied plugin instance must go through ere.
*/
const clap_host_t* host_;
/**
* The vtable for `clap_plugin`, requires that this object is never moved or
* copied. We'll use the host data pointer instead of placing this vtable at