From 0f7a5f81091c60403954700f5f97ef6fa359e44e Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Mon, 10 Oct 2022 15:42:47 +0200 Subject: [PATCH] Add logging for the render extension --- src/common/logging/clap.cpp | 28 ++++++++++++++++++++++++++++ src/common/logging/clap.h | 5 +++++ 2 files changed, 33 insertions(+) diff --git a/src/common/logging/clap.cpp b/src/common/logging/clap.cpp index 9b34ae3e..47834d54 100644 --- a/src/common/logging/clap.cpp +++ b/src/common/logging/clap.cpp @@ -338,6 +338,34 @@ bool ClapLogger::log_request(bool is_host_plugin, }); } +bool ClapLogger::log_request( + bool is_host_plugin, + const clap::ext::render::plugin::HasHardRealtimeRequirement& request) { + return log_request_base(is_host_plugin, [&](auto& message) { + message << request.instance_id + << ": clap_plugin_render::has_hard_realtime_requirement()"; + }); +} + +bool ClapLogger::log_request(bool is_host_plugin, + const clap::ext::render::plugin::Set& request) { + return log_request_base(is_host_plugin, [&](auto& message) { + message << request.instance_id << ": clap_plugin_render::set(mode = "; + switch (request.mode) { + case CLAP_RENDER_REALTIME: + message << "CLAP_RENDER_REALTIME"; + break; + case CLAP_RENDER_OFFLINE: + message << "CLAP_RENDER_OFFLINE"; + break; + default: + message << request.mode << " (unknown)"; + break; + } + message << ")"; + }); +} + bool ClapLogger::log_request(bool is_host_plugin, const clap::ext::state::plugin::Save& request) { return log_request_base(is_host_plugin, [&](auto& message) { diff --git a/src/common/logging/clap.h b/src/common/logging/clap.h index d88b047e..5d62268f 100644 --- a/src/common/logging/clap.h +++ b/src/common/logging/clap.h @@ -128,6 +128,11 @@ class ClapLogger { const clap::ext::params::plugin::TextToValue&); bool log_request(bool is_host_plugin, const clap::ext::latency::plugin::Get&); + bool log_request( + bool is_host_plugin, + const clap::ext::render::plugin::HasHardRealtimeRequirement&); + bool log_request(bool is_host_plugin, + const clap::ext::render::plugin::Set&); bool log_request(bool is_host_plugin, const clap::ext::state::plugin::Save&); bool log_request(bool is_host_plugin,