mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Add logging for the CLAP GUI extension
This commit is contained in:
@@ -143,6 +143,122 @@ bool ClapLogger::log_request(
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(
|
||||
bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::IsApiSupported& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.instance_id
|
||||
<< ": clap_plugin_gui::is_api_supported(api = ";
|
||||
switch (request.api) {
|
||||
case clap::ext::gui::ApiType::X11:
|
||||
message << request.instance_id << "\"" << CLAP_WINDOW_API_X11
|
||||
<< "\" (will be translated to \""
|
||||
<< CLAP_WINDOW_API_WIN32 << "\")";
|
||||
break;
|
||||
}
|
||||
message << ", is_floating = "
|
||||
<< (request.is_floating ? "true" : "false") << ")";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::Create& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.instance_id << ": clap_plugin_gui::create(api = ";
|
||||
switch (request.api) {
|
||||
case clap::ext::gui::ApiType::X11:
|
||||
message << request.instance_id << "\"" << CLAP_WINDOW_API_X11
|
||||
<< "\" (will be translated to \""
|
||||
<< CLAP_WINDOW_API_WIN32 << "\")";
|
||||
break;
|
||||
}
|
||||
message << ", is_floating = "
|
||||
<< (request.is_floating ? "true" : "false") << ")";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::Destroy& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.instance_id << ": clap_plugin_gui::destroy()";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::SetScale& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.instance_id
|
||||
<< ": clap_plugin_gui::set_scale(scale = " << request.scale
|
||||
<< ")";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::GetSize& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.instance_id
|
||||
<< ": clap_plugin_gui::get_size(*width, *height)";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::CanResize& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.instance_id << ": clap_plugin_gui::can_resize()";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(
|
||||
bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::GetResizeHints& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.instance_id
|
||||
<< ": clap_plugin_gui::get_resize_hints(*hints)";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(
|
||||
bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::AdjustSize& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.instance_id
|
||||
<< ": clap_plugin_gui::adjust_size(*width = " << request.width
|
||||
<< ", *height = " << request.height << ")";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::SetSize& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.instance_id
|
||||
<< ": clap_plugin_gui::set_size(width = " << request.width
|
||||
<< ", height = " << request.height << ")";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::SetParent& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.instance_id
|
||||
<< ": clap_plugin_gui::set_parent(window = <X11 window "
|
||||
<< request.x11_window << ">)";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::Show& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.instance_id << ": clap_plugin_gui::show()";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::Hide& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.instance_id << ": clap_plugin_gui::hide()";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(
|
||||
bool is_host_plugin,
|
||||
const clap::ext::note_ports::plugin::Count& request) {
|
||||
@@ -317,6 +433,50 @@ bool ClapLogger::log_request(
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(
|
||||
bool is_host_plugin,
|
||||
const clap::ext::gui::host::ResizeHintsChanged& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.owner_instance_id
|
||||
<< ": clap_host_gui::resize_hints_changed()";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(
|
||||
bool is_host_plugin,
|
||||
const clap::ext::gui::host::RequestResize& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.owner_instance_id
|
||||
<< ": clap_host_gui::request_resize(width = " << request.width
|
||||
<< ", height = " << request.height << ")";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::host::RequestShow& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.owner_instance_id
|
||||
<< ": clap_host_gui::request_show()";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::host::RequestHide& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.owner_instance_id
|
||||
<< ": clap_host_gui::request_hide()";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::host::Closed& request) {
|
||||
return log_request_base(is_host_plugin, [&](auto& message) {
|
||||
message << request.owner_instance_id
|
||||
<< ": clap_host_gui::closed(was_destroyed = "
|
||||
<< request.was_destroyed << ")";
|
||||
});
|
||||
}
|
||||
|
||||
bool ClapLogger::log_request(
|
||||
bool is_host_plugin,
|
||||
const clap::ext::note_ports::host::SupportedDialects& request) {
|
||||
@@ -470,6 +630,54 @@ void ClapLogger::log_response(
|
||||
});
|
||||
}
|
||||
|
||||
void ClapLogger::log_response(
|
||||
bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::GetSizeResponse& response) {
|
||||
return log_response_base(is_host_plugin, [&](auto& message) {
|
||||
if (response.result) {
|
||||
message << "true, *width = " << response.width
|
||||
<< ", *height = " << response.height;
|
||||
} else {
|
||||
message << "false";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void ClapLogger::log_response(
|
||||
bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::GetResizeHintsResponse& response) {
|
||||
return log_response_base(is_host_plugin, [&](auto& message) {
|
||||
if (response.result) {
|
||||
message
|
||||
<< "true, <clap_resize_hints_t* with can_resize_horizontally = "
|
||||
<< (response.result->can_resize_horizontally ? "true" : "false")
|
||||
<< ", can_resize_vertically = "
|
||||
<< (response.result->can_resize_vertically ? "true" : "false")
|
||||
<< ", preserve_aspect_ratio = "
|
||||
<< (response.result->preserve_aspect_ratio ? "true" : "false")
|
||||
<< ", aspect_ratio_width = "
|
||||
<< response.result->aspect_ratio_width
|
||||
<< ", aspect_ratio_height = "
|
||||
<< response.result->aspect_ratio_height << ">";
|
||||
} else {
|
||||
message << "false";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void ClapLogger::log_response(
|
||||
bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::AdjustSizeResponse& response) {
|
||||
return log_response_base(is_host_plugin, [&](auto& message) {
|
||||
if (response.result) {
|
||||
message << "true, *width = " << response.updated_width
|
||||
<< ", *height = " << response.updated_height;
|
||||
} else {
|
||||
message << "false";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void ClapLogger::log_response(
|
||||
bool is_host_plugin,
|
||||
const clap::ext::note_ports::plugin::GetResponse& response) {
|
||||
|
||||
@@ -82,6 +82,28 @@ class ClapLogger {
|
||||
const clap::ext::audio_ports::plugin::Count&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::audio_ports::plugin::Get&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::IsApiSupported&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::Create&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::Destroy&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::SetScale&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::GetSize&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::CanResize&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::GetResizeHints&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::AdjustSize&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::SetSize&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::SetParent&);
|
||||
bool log_request(bool is_host_plugin, const clap::ext::gui::plugin::Show&);
|
||||
bool log_request(bool is_host_plugin, const clap::ext::gui::plugin::Hide&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::note_ports::plugin::Count&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
@@ -120,6 +142,15 @@ class ClapLogger {
|
||||
const clap::ext::audio_ports::host::IsRescanFlagSupported&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::audio_ports::host::Rescan&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::host::ResizeHintsChanged&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::host::RequestResize&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::host::RequestShow&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::gui::host::RequestHide&);
|
||||
bool log_request(bool is_host_plugin, const clap::ext::gui::host::Closed&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
const clap::ext::note_ports::host::SupportedDialects&);
|
||||
bool log_request(bool is_host_plugin,
|
||||
@@ -150,6 +181,12 @@ class ClapLogger {
|
||||
const clap::plugin::ActivateResponse&);
|
||||
void log_response(bool is_host_plugin,
|
||||
const clap::ext::audio_ports::plugin::GetResponse&);
|
||||
void log_response(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::GetSizeResponse&);
|
||||
void log_response(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::GetResizeHintsResponse&);
|
||||
void log_response(bool is_host_plugin,
|
||||
const clap::ext::gui::plugin::AdjustSizeResponse&);
|
||||
void log_response(bool is_host_plugin,
|
||||
const clap::ext::note_ports::plugin::GetResponse&);
|
||||
void log_response(bool is_host_plugin,
|
||||
|
||||
Reference in New Issue
Block a user