mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-16 13:40:05 +02:00
Implement Wine side for creating plugin instances
This commit is contained in:
@@ -29,6 +29,15 @@ bool ClapLogger::log_request(bool is_host_plugin,
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(bool is_host_plugin,
|
||||
const clap::plugin_factory::Create& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << "clap_plugin_factory::create(host = <clap_host_t*>, "
|
||||
"plugin_id = \""
|
||||
<< request.plugin_id << "\")";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(bool is_host_plugin, const WantsConfiguration&) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << "Requesting <Configuration>";
|
||||
@@ -40,10 +49,10 @@ bool ClapLogger::log_request(bool is_host_plugin, const WantsConfiguration&) {
|
||||
// });
|
||||
// }
|
||||
|
||||
bool ClapLogger::log_response(
|
||||
void ClapLogger::log_response(
|
||||
bool is_host_plugin,
|
||||
const clap::plugin_factory::ListResponse& response) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
return log_response_base(is_host_plugin, [&](auto& message) {
|
||||
if (response.descriptors) {
|
||||
message << "<clap_plugin_factory containing "
|
||||
<< response.descriptors->size() << " plugin descriptors>";
|
||||
@@ -53,6 +62,19 @@ bool ClapLogger::log_response(
|
||||
});
|
||||
}
|
||||
|
||||
void ClapLogger::log_response(
|
||||
bool is_host_plugin,
|
||||
const clap::plugin_factory::CreateResponse& response) {
|
||||
return log_response_base(is_host_plugin, [&](auto& message) {
|
||||
if (response.instance_id) {
|
||||
message << "<clap_plugin_t* with instance ID "
|
||||
<< *response.instance_id << ">";
|
||||
} else {
|
||||
message << "<nullptr*>";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void ClapLogger::log_response(bool is_host_plugin, const Configuration&) {
|
||||
log_response_base(is_host_plugin,
|
||||
[&](auto& message) { message << "<Configuration>"; });
|
||||
|
||||
@@ -46,6 +46,7 @@ class ClapLogger {
|
||||
// log message for the response together with the request.
|
||||
|
||||
bool log_request(bool is_host_plugin, const clap::plugin_factory::List&);
|
||||
bool log_request(bool is_host_plugin, const clap::plugin_factory::Create&);
|
||||
|
||||
// TODO: Audio thread requests
|
||||
// bool log_request(bool is_host_plugin,
|
||||
@@ -54,8 +55,10 @@ class ClapLogger {
|
||||
bool log_request(bool is_host_plugin, const WantsConfiguration&);
|
||||
|
||||
// void log_response(bool is_host_plugin, const Ack&);
|
||||
bool log_response(bool is_host_plugin,
|
||||
void log_response(bool is_host_plugin,
|
||||
const clap::plugin_factory::ListResponse&);
|
||||
void log_response(bool is_host_plugin,
|
||||
const clap::plugin_factory::CreateResponse&);
|
||||
|
||||
// TODO: Audio thread responses
|
||||
// void log_response(bool is_host_plugin,
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "../bitsery/ext/message-reference.h"
|
||||
#include "../utils.h"
|
||||
#include "clap/host.h"
|
||||
#include "clap/plugin-factory.h"
|
||||
#include "common.h"
|
||||
|
||||
@@ -38,8 +39,9 @@
|
||||
*/
|
||||
// FIXME: Remove the `WantsConfiguration`. For some reason bitsery just won't
|
||||
// serialize this without it.
|
||||
using ClapMainThreadControlRequest =
|
||||
std::variant<WantsConfiguration, clap::plugin_factory::List>;
|
||||
using ClapMainThreadControlRequest = std::variant<WantsConfiguration,
|
||||
clap::plugin_factory::List,
|
||||
clap::plugin_factory::Create>;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s, ClapMainThreadControlRequest& payload) {
|
||||
|
||||
Reference in New Issue
Block a user