mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-09 22:02:10 +02:00
Implement CLAP plugin initialization
This commit is contained in:
@@ -38,6 +38,34 @@ bool ClapLogger::log_request(bool is_host_plugin,
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(bool is_host_plugin,
|
||||
const clap::plugin::Init& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.instance_id
|
||||
<< ": clap_plugin::init(), supported host extensions: ";
|
||||
|
||||
// TODO: Log supported extensions
|
||||
bool first = true;
|
||||
// for (const auto& [supported, extension_name] : {}) {
|
||||
// if (!supported) {
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// if (first) {
|
||||
// message << extension_name;
|
||||
// } else {
|
||||
// message << ", " << extension_name;
|
||||
// }
|
||||
|
||||
// first = false;
|
||||
// }
|
||||
|
||||
if (first) {
|
||||
message << "<none>";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(bool is_host_plugin,
|
||||
const clap::plugin::Destroy& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
@@ -81,6 +109,34 @@ void ClapLogger::log_response(
|
||||
});
|
||||
}
|
||||
|
||||
void ClapLogger::log_response(bool is_host_plugin,
|
||||
const clap::plugin::InitResponse& response) {
|
||||
return log_response_base(is_host_plugin, [&](auto& message) {
|
||||
message << (response.result ? "true" : "false")
|
||||
<< ", supported plugin extensions: ";
|
||||
|
||||
// TODO: Log supported extensions
|
||||
bool first = true;
|
||||
// for (const auto& [supported, extension_name] : {}) {
|
||||
// if (!supported) {
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// if (first) {
|
||||
// message << extension_name;
|
||||
// } else {
|
||||
// message << ", " << extension_name;
|
||||
// }
|
||||
|
||||
// first = false;
|
||||
// }
|
||||
|
||||
if (first) {
|
||||
message << "<none>";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void ClapLogger::log_response(bool is_host_plugin, const Configuration&) {
|
||||
log_response_base(is_host_plugin,
|
||||
[&](auto& message) { message << "<Configuration>"; });
|
||||
|
||||
@@ -47,6 +47,7 @@ class ClapLogger {
|
||||
|
||||
bool log_request(bool is_host_plugin, const clap::plugin_factory::List&);
|
||||
bool log_request(bool is_host_plugin, const clap::plugin_factory::Create&);
|
||||
bool log_request(bool is_host_plugin, const clap::plugin::Init&);
|
||||
bool log_request(bool is_host_plugin, const clap::plugin::Destroy&);
|
||||
|
||||
// TODO: Audio thread requests
|
||||
@@ -60,6 +61,7 @@ class ClapLogger {
|
||||
const clap::plugin_factory::ListResponse&);
|
||||
void log_response(bool is_host_plugin,
|
||||
const clap::plugin_factory::CreateResponse&);
|
||||
void log_response(bool is_host_plugin, const clap::plugin::InitResponse&);
|
||||
|
||||
// TODO: Audio thread responses
|
||||
// void log_response(bool is_host_plugin,
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
using ClapMainThreadControlRequest = std::variant<WantsConfiguration,
|
||||
clap::plugin_factory::List,
|
||||
clap::plugin_factory::Create,
|
||||
clap::plugin::Init,
|
||||
clap::plugin::Destroy>;
|
||||
|
||||
template <typename S>
|
||||
@@ -92,7 +93,7 @@ struct ClapAudioThreadControlRequest {
|
||||
// // deserializing we'll deserialize into the persistent and
|
||||
// // thread local `process_request` object (see
|
||||
// // `ClapSockets::add_audio_processor_and_listen`) and then
|
||||
// // reassign the reference to point to that boject.
|
||||
// // reassign the reference to point to that object.
|
||||
// s.ext(request_ref,
|
||||
// bitsery::ext::MessageReference(process_request_));
|
||||
// },
|
||||
|
||||
@@ -155,7 +155,7 @@ struct Init {
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(instance_id);
|
||||
s.boject(supported_host_extensions);
|
||||
s.object(supported_host_extensions);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ struct Vst3AudioProcessorRequest {
|
||||
// deserializing we'll deserialize into the persistent and
|
||||
// thread local `process_request` object (see
|
||||
// `Vst3Sockets::add_audio_processor_and_listen`) and then
|
||||
// reassign the reference to point to that boject.
|
||||
// reassign the reference to point to that object.
|
||||
s.ext(request_ref,
|
||||
bitsery::ext::MessageReference(process_request_));
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user