mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-13 20:09:59 +02:00
Implement the CLAP log extension
This commit is contained in:
@@ -25,6 +25,8 @@ ClapHostExtensions::ClapHostExtensions(const clap_host& host) noexcept
|
||||
host.get_extension(&host, CLAP_EXT_GUI))),
|
||||
latency(static_cast<const clap_host_latency_t*>(
|
||||
host.get_extension(&host, CLAP_EXT_LATENCY))),
|
||||
log(static_cast<const clap_host_log_t*>(
|
||||
host.get_extension(&host, CLAP_EXT_LOG))),
|
||||
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*>(
|
||||
@@ -42,6 +44,7 @@ clap::host::SupportedHostExtensions ClapHostExtensions::supported()
|
||||
.supports_audio_ports = audio_ports != nullptr,
|
||||
.supports_gui = gui != nullptr,
|
||||
.supports_latency = latency != nullptr,
|
||||
.supports_log = log != nullptr,
|
||||
.supports_note_ports = note_ports != nullptr,
|
||||
.supports_params = params != nullptr,
|
||||
.supports_state = state != nullptr,
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <clap/ext/audio-ports.h>
|
||||
#include <clap/ext/gui.h>
|
||||
#include <clap/ext/latency.h>
|
||||
#include <clap/ext/log.h>
|
||||
#include <clap/ext/note-ports.h>
|
||||
#include <clap/ext/params.h>
|
||||
#include <clap/ext/state.h>
|
||||
@@ -65,6 +66,7 @@ struct ClapHostExtensions {
|
||||
const clap_host_audio_ports_t* audio_ports = nullptr;
|
||||
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_ports_t* note_ports = nullptr;
|
||||
const clap_host_params_t* params = nullptr;
|
||||
const clap_host_state_t* state = nullptr;
|
||||
|
||||
@@ -346,6 +346,17 @@ void ClapPluginBridge::register_plugin_proxy(
|
||||
// hell. I haven't been able to figure out why.
|
||||
return {};
|
||||
},
|
||||
[&](const clap::ext::log::host::Log& request)
|
||||
-> clap::ext::log::host::Log::Response {
|
||||
const auto& [plugin_proxy, _] =
|
||||
get_proxy(request.owner_instance_id);
|
||||
|
||||
plugin_proxy.host_extensions_.log->log(plugin_proxy.host_,
|
||||
request.severity,
|
||||
request.msg.c_str());
|
||||
|
||||
return Ack{};
|
||||
},
|
||||
[&](const clap::ext::params::host::RequestFlush& request)
|
||||
-> clap::ext::params::host::RequestFlush::Response {
|
||||
const auto& [plugin_proxy, _] =
|
||||
|
||||
Reference in New Issue
Block a user