mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-15 07:53:55 +02:00
Fully implement the CLAP params extension
This commit is contained in:
@@ -51,6 +51,11 @@ clap_host_proxy::clap_host_proxy(ClapBridge& bridge,
|
||||
ext_note_ports_vtable(clap_host_note_ports_t{
|
||||
.supported_dialects = ext_note_ports_supported_dialects,
|
||||
.rescan = ext_note_ports_rescan,
|
||||
}),
|
||||
ext_params_vtable(clap_host_params_t{
|
||||
.rescan = ext_params_rescan,
|
||||
.clear = ext_params_clear,
|
||||
.request_flush = ext_params_request_flush,
|
||||
}) {}
|
||||
|
||||
const void* CLAP_ABI
|
||||
@@ -66,6 +71,9 @@ clap_host_proxy::host_get_extension(const struct clap_host* host,
|
||||
} else if (self->supported_extensions_.supports_note_ports &&
|
||||
strcmp(extension_id, CLAP_EXT_NOTE_PORTS) == 0) {
|
||||
extension_ptr = &self->ext_note_ports_vtable;
|
||||
} else if (self->supported_extensions_.supports_params &&
|
||||
strcmp(extension_id, CLAP_EXT_PARAMS) == 0) {
|
||||
extension_ptr = &self->ext_params_vtable;
|
||||
}
|
||||
|
||||
self->bridge_.logger_.log_extension_query("clap_host::get_extension",
|
||||
@@ -161,3 +169,35 @@ void CLAP_ABI clap_host_proxy::ext_note_ports_rescan(const clap_host_t* host,
|
||||
self->bridge_.send_main_thread_message(clap::ext::note_ports::host::Rescan{
|
||||
.owner_instance_id = self->owner_instance_id(), .flags = flags});
|
||||
}
|
||||
|
||||
void CLAP_ABI
|
||||
clap_host_proxy::ext_params_rescan(const clap_host_t* host,
|
||||
clap_param_rescan_flags flags) {
|
||||
assert(host && host->host_data);
|
||||
auto self = static_cast<clap_host_proxy*>(host->host_data);
|
||||
|
||||
self->bridge_.send_main_thread_message(clap::ext::params::host::Rescan{
|
||||
.owner_instance_id = self->owner_instance_id(), .flags = flags});
|
||||
}
|
||||
|
||||
void CLAP_ABI clap_host_proxy::ext_params_clear(const clap_host_t* host,
|
||||
clap_id param_id,
|
||||
clap_param_clear_flags flags) {
|
||||
assert(host && host->host_data);
|
||||
auto self = static_cast<clap_host_proxy*>(host->host_data);
|
||||
|
||||
self->bridge_.send_main_thread_message(clap::ext::params::host::Clear{
|
||||
.owner_instance_id = self->owner_instance_id(),
|
||||
.param_id = param_id,
|
||||
.flags = flags});
|
||||
}
|
||||
|
||||
void CLAP_ABI
|
||||
clap_host_proxy::ext_params_request_flush(const clap_host_t* host) {
|
||||
assert(host && host->host_data);
|
||||
auto self = static_cast<clap_host_proxy*>(host->host_data);
|
||||
|
||||
self->bridge_.send_main_thread_message(
|
||||
clap::ext::params::host::RequestFlush{.owner_instance_id =
|
||||
self->owner_instance_id()});
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <clap/ext/audio-ports.h>
|
||||
#include <clap/ext/note-ports.h>
|
||||
#include <clap/ext/params.h>
|
||||
#include <clap/host.h>
|
||||
|
||||
#include "../../common/serialization/clap/plugin-factory.h"
|
||||
@@ -75,6 +76,13 @@ class clap_host_proxy {
|
||||
static void CLAP_ABI ext_note_ports_rescan(const clap_host_t* host,
|
||||
uint32_t flags);
|
||||
|
||||
static void CLAP_ABI ext_params_rescan(const clap_host_t* host,
|
||||
clap_param_rescan_flags flags);
|
||||
static void CLAP_ABI ext_params_clear(const clap_host_t* host,
|
||||
clap_id param_id,
|
||||
clap_param_clear_flags flags);
|
||||
static void CLAP_ABI ext_params_request_flush(const clap_host_t* host);
|
||||
|
||||
/**
|
||||
* The extensions supported by the host, set just before calling
|
||||
* `clap_plugin::init()` on the bridged plugin. We'll allow the plugin to
|
||||
@@ -99,6 +107,7 @@ class clap_host_proxy {
|
||||
// called `clap_plugin::init()`.
|
||||
const clap_host_audio_ports ext_audio_ports_vtable;
|
||||
const clap_host_note_ports ext_note_ports_vtable;
|
||||
const clap_host_params ext_params_vtable;
|
||||
|
||||
/**
|
||||
* Keeps track of whether there are pending host callbacks. Used to prevent
|
||||
|
||||
Reference in New Issue
Block a user