Allow serializing CLAP plugin factory list message

This commit is contained in:
Robbert van der Helm
2022-08-31 16:28:36 +02:00
parent edc0cbbe38
commit ec8028f78c
5 changed files with 59 additions and 38 deletions
+19 -6
View File
@@ -22,12 +22,12 @@
ClapLogger::ClapLogger(Logger& generic_logger) : logger_(generic_logger) {}
// bool ClapLogger::log_request(bool is_host_plugin,
// const ClapPluginFactoryProxy::Construct&) {
// return log_request_base(is_host_plugin, [&](auto& message) {
// message << "GetPluginFactory()";
// });
// }
bool ClapLogger::log_request(bool is_host_plugin,
const clap::plugin_factory::List&) {
return log_request_base(is_host_plugin, [&](auto& message) {
message << "clap_plugin_factory::list()";
});
}
bool ClapLogger::log_request(bool is_host_plugin, const WantsConfiguration&) {
return log_request_base(is_host_plugin, [&](auto& message) {
@@ -40,6 +40,19 @@ bool ClapLogger::log_request(bool is_host_plugin, const WantsConfiguration&) {
// });
// }
bool ClapLogger::log_response(
bool is_host_plugin,
const clap::plugin_factory::ListResponse& response) {
return log_request_base(is_host_plugin, [&](auto& message) {
if (response.descriptors) {
message << "<clap_plugin_factory containing "
<< response.descriptors->size() << " plugin descriptors>";
} else {
message << "<not supported>";
}
});
}
void ClapLogger::log_response(bool is_host_plugin, const Configuration&) {
log_response_base(is_host_plugin,
[&](auto& message) { message << "<Configuration>"; });
+3 -7
View File
@@ -45,9 +45,7 @@ class ClapLogger {
// `log_request()` call returned `true`. This way we can filter out the
// log message for the response together with the request.
// TODO: Main thread rquests
// bool log_request(bool is_host_plugin,
// const ClapPluginFactoryProxy::Construct&);
bool log_request(bool is_host_plugin, const clap::plugin_factory::List&);
// TODO: Audio thread requests
// bool log_request(bool is_host_plugin,
@@ -55,11 +53,9 @@ class ClapLogger {
bool log_request(bool is_host_plugin, const WantsConfiguration&);
// TOOD: Main thread responses
// void log_response(bool is_host_plugin, const Ack&);
// void log_response(bool is_host_plugin,
// const UniversalTResult&,
// bool from_cache = false);
bool log_response(bool is_host_plugin,
const clap::plugin_factory::ListResponse&);
// TODO: Audio thread responses
// void log_response(bool is_host_plugin,