mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 12:30:12 +02:00
Store plugin and host extension struct pointers
This commit is contained in:
@@ -18,6 +18,12 @@
|
||||
|
||||
#include "../clap.h"
|
||||
|
||||
ClapHostExtensions::ClapHostExtensions(const clap_host& host) noexcept
|
||||
: audio_ports(static_cast<const clap_host_audio_ports_t*>(
|
||||
host.get_extension(&host, CLAP_EXT_AUDIO_PORTS))) {}
|
||||
|
||||
ClapHostExtensions::ClapHostExtensions() noexcept {}
|
||||
|
||||
clap_plugin_proxy::clap_plugin_proxy(ClapPluginBridge& bridge,
|
||||
size_t instance_id,
|
||||
clap::plugin::Descriptor descriptor,
|
||||
@@ -52,6 +58,12 @@ bool CLAP_ABI clap_plugin_proxy::plugin_init(const struct clap_plugin* plugin) {
|
||||
assert(plugin && plugin->plugin_data);
|
||||
auto self = static_cast<clap_plugin_proxy*>(plugin->plugin_data);
|
||||
|
||||
// At this point we are allowed to query the host for extension structs.
|
||||
// We'll store pointers to the host's extensions vtables, and then send
|
||||
// whether or not those extensions were supported as booleans to the Wine
|
||||
// plugin host so it can expose the same interfaces there.
|
||||
self->extensions_ = ClapHostExtensions(*self->host_);
|
||||
|
||||
const clap::plugin::InitResponse response =
|
||||
self->bridge_.send_main_thread_message(
|
||||
clap::plugin::Init{.instance_id = self->instance_id(),
|
||||
|
||||
Reference in New Issue
Block a user