From bdfd235ea051d11803f3a0153c0426d547ae0004 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 8 Jan 2021 17:05:23 +0100 Subject: [PATCH] Add logging for IKeyswitchController --- src/common/logging/vst3.cpp | 36 ++++++++++++++++++++++++++++++++++++ src/common/logging/vst3.h | 6 ++++++ 2 files changed, 42 insertions(+) diff --git a/src/common/logging/vst3.cpp b/src/common/logging/vst3.cpp index bc6ce472..335b2edb 100644 --- a/src/common/logging/vst3.cpp +++ b/src/common/logging/vst3.cpp @@ -337,6 +337,29 @@ bool Vst3Logger::log_request( }); } +bool Vst3Logger::log_request( + bool is_host_vst, + const YaKeyswitchController::GetKeyswitchCount& request) { + return log_request_base(is_host_vst, [&](auto& message) { + message << request.instance_id + << ": IKeyswitchController::getKeyswitchCount(busIndex = " + << request.bus_index << ", channel = " << request.channel + << ")"; + }); +} + +bool Vst3Logger::log_request( + bool is_host_vst, + const YaKeyswitchController::GetKeyswitchInfo& request) { + return log_request_base(is_host_vst, [&](auto& message) { + message << request.instance_id + << ": IKeyswitchController::getKeyswitchCount(busIndex = " + << request.bus_index << ", channel = " << request.channel + << ", keySwitchIndex = " << request.key_switch_index + << ", &info)"; + }); +} + bool Vst3Logger::log_request( bool is_host_vst, const YaMidiMapping::GetMidiControllerAssignment& request) { @@ -1218,6 +1241,19 @@ void Vst3Logger::log_response( }); } +void Vst3Logger::log_response( + bool is_host_vst, + const YaKeyswitchController::GetKeyswitchInfoResponse& response) { + log_response_base(is_host_vst, [&](auto& message) { + message << response.result.string(); + if (response.result == Steinberg::kResultOk) { + message << ", "; + } + }); +} + void Vst3Logger::log_response( bool is_host_vst, const YaMidiMapping::GetMidiControllerAssignmentResponse& response) { diff --git a/src/common/logging/vst3.h b/src/common/logging/vst3.h index 7fd4b244..32c77323 100644 --- a/src/common/logging/vst3.h +++ b/src/common/logging/vst3.h @@ -102,6 +102,10 @@ class Vst3Logger { const YaEditControllerHostEditing::BeginEditFromHost&); bool log_request(bool is_host_vst, const YaEditControllerHostEditing::EndEditFromHost&); + bool log_request(bool is_host_vst, + const YaKeyswitchController::GetKeyswitchCount&); + bool log_request(bool is_host_vst, + const YaKeyswitchController::GetKeyswitchInfo&); bool log_request(bool is_host_vst, const YaMidiMapping::GetMidiControllerAssignment&); bool log_request(bool is_host_vst, @@ -217,6 +221,8 @@ class Vst3Logger { const YaEditController::GetParamValueByStringResponse&); void log_response(bool is_host_vst, const YaEditController::CreateViewResponse&); + void log_response(bool is_host_vst, + const YaKeyswitchController::GetKeyswitchInfoResponse&); void log_response( bool is_host_vst, const YaMidiMapping::GetMidiControllerAssignmentResponse&);