From b360831c5f6bcbf2c90a1575aa1321a527ac01f2 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 21 Oct 2022 17:05:30 +0200 Subject: [PATCH] Add logging for the note name extension --- src/common/logging/clap.cpp | 42 +++++++++++++++++++++++++++++++++++++ src/common/logging/clap.h | 8 +++++++ 2 files changed, 50 insertions(+) diff --git a/src/common/logging/clap.cpp b/src/common/logging/clap.cpp index 41ca6e1f..eb641a68 100644 --- a/src/common/logging/clap.cpp +++ b/src/common/logging/clap.cpp @@ -290,6 +290,23 @@ bool ClapLogger::log_request(bool is_host_plugin, }); } +bool ClapLogger::log_request( + bool is_host_plugin, + const clap::ext::note_name::plugin::Count& request) { + return log_request_base(is_host_plugin, [&](auto& message) { + message << request.instance_id << ": clap_plugin_note_name::count()"; + }); +} + +bool ClapLogger::log_request(bool is_host_plugin, + const clap::ext::note_name::plugin::Get& request) { + return log_request_base(is_host_plugin, [&](auto& message) { + message << request.instance_id + << ": clap_plugin_note_name::get(index = " << request.index + << ", *note_name)"; + }); +} + bool ClapLogger::log_request( bool is_host_plugin, const clap::ext::note_ports::plugin::Count& request) { @@ -623,6 +640,15 @@ bool ClapLogger::log_request(bool is_host_plugin, }); } +bool ClapLogger::log_request( + bool is_host_plugin, + const clap::ext::note_name::host::Changed& request) { + return log_request_base(is_host_plugin, [&](auto& message) { + message << request.owner_instance_id + << ": clap_host_note_name::changed()"; + }); +} + bool ClapLogger::log_request( bool is_host_plugin, const clap::ext::note_ports::host::SupportedDialects& request) { @@ -885,6 +911,22 @@ void ClapLogger::log_response( }); } +void ClapLogger::log_response( + bool is_host_plugin, + const clap::ext::note_name::plugin::GetResponse& response) { + log_response_base(is_host_plugin, [&](auto& message) { + if (response.result) { + message << "true, name + << "\" with port = " << response.result->port + << ", key = " << response.result->key + << ", channel = " << response.result->channel << ">"; + } else { + message << "false"; + } + }); +} + void ClapLogger::log_response( bool is_host_plugin, const clap::ext::note_ports::plugin::GetResponse& response) { diff --git a/src/common/logging/clap.h b/src/common/logging/clap.h index d0c09ca3..577700db 100644 --- a/src/common/logging/clap.h +++ b/src/common/logging/clap.h @@ -118,6 +118,10 @@ class ClapLogger { 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_name::plugin::Count&); + bool log_request(bool is_host_plugin, + const clap::ext::note_name::plugin::Get&); bool log_request(bool is_host_plugin, const clap::ext::note_ports::plugin::Count&); bool log_request(bool is_host_plugin, @@ -176,6 +180,8 @@ class ClapLogger { 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_name::host::Changed&); bool log_request(bool is_host_plugin, const clap::ext::note_ports::host::SupportedDialects&); bool log_request(bool is_host_plugin, @@ -218,6 +224,8 @@ class ClapLogger { 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_name::plugin::GetResponse&); void log_response(bool is_host_plugin, const clap::ext::note_ports::plugin::GetResponse&); void log_response(bool is_host_plugin,