mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 04:20:13 +02:00
Implement host side of the note-name extension
This commit is contained in:
@@ -29,6 +29,8 @@ ClapHostExtensions::ClapHostExtensions(const clap_host& host) noexcept
|
||||
host.get_extension(&host, CLAP_EXT_LATENCY))),
|
||||
log(static_cast<const clap_host_log_t*>(
|
||||
host.get_extension(&host, CLAP_EXT_LOG))),
|
||||
note_name(static_cast<const clap_host_note_name_t*>(
|
||||
host.get_extension(&host, CLAP_EXT_NOTE_NAME))),
|
||||
note_ports(static_cast<const clap_host_note_ports_t*>(
|
||||
host.get_extension(&host, CLAP_EXT_NOTE_PORTS))),
|
||||
params(static_cast<const clap_host_params_t*>(
|
||||
@@ -50,6 +52,7 @@ clap::host::SupportedHostExtensions ClapHostExtensions::supported()
|
||||
.supports_gui = gui != nullptr,
|
||||
.supports_latency = latency != nullptr,
|
||||
.supports_log = log != nullptr,
|
||||
.supports_note_name = note_name != nullptr,
|
||||
.supports_note_ports = note_ports != nullptr,
|
||||
.supports_params = params != nullptr,
|
||||
.supports_state = state != nullptr,
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <clap/ext/gui.h>
|
||||
#include <clap/ext/latency.h>
|
||||
#include <clap/ext/log.h>
|
||||
#include <clap/ext/note-name.h>
|
||||
#include <clap/ext/note-ports.h>
|
||||
#include <clap/ext/params.h>
|
||||
#include <clap/ext/render.h>
|
||||
@@ -71,6 +72,7 @@ struct ClapHostExtensions {
|
||||
const clap_host_gui_t* gui = nullptr;
|
||||
const clap_host_latency_t* latency = nullptr;
|
||||
const clap_host_log_t* log = nullptr;
|
||||
const clap_host_note_name_t* note_name = nullptr;
|
||||
const clap_host_note_ports_t* note_ports = nullptr;
|
||||
const clap_host_params_t* params = nullptr;
|
||||
const clap_host_state_t* state = nullptr;
|
||||
|
||||
@@ -196,6 +196,22 @@ ClapPluginBridge::ClapPluginBridge(const ghc::filesystem::path& plugin_path)
|
||||
|
||||
return Ack{};
|
||||
},
|
||||
[&](const clap::ext::note_name::host::Changed& request)
|
||||
-> clap::ext::note_name::host::Changed::Response {
|
||||
const auto& [plugin_proxy, _] =
|
||||
get_proxy(request.owner_instance_id);
|
||||
|
||||
plugin_proxy
|
||||
.run_on_main_thread(
|
||||
[&, host = plugin_proxy.host_,
|
||||
note_name =
|
||||
plugin_proxy.host_extensions_.note_name]() {
|
||||
note_name->changed(host);
|
||||
})
|
||||
.wait();
|
||||
|
||||
return Ack{};
|
||||
},
|
||||
[&](const clap::ext::note_ports::host::SupportedDialects&
|
||||
request)
|
||||
-> clap::ext::note_ports::host::SupportedDialects::
|
||||
|
||||
Reference in New Issue
Block a user