mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Add PrimitiveWrapper<T> response logging
This commit is contained in:
@@ -207,10 +207,6 @@ void Vst3Logger::log_request(bool is_host_vst, const WantsConfiguration&) {
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_response(bool is_host_vst, const uint32& value) {
|
||||
log_response_base(is_host_vst, [&](auto& message) { message << value; });
|
||||
}
|
||||
|
||||
void Vst3Logger::log_response(bool is_host_vst, const Ack&) {
|
||||
log_response_base(is_host_vst, [&](auto& message) { message << "ACK"; });
|
||||
}
|
||||
|
||||
@@ -77,7 +77,6 @@ class Vst3Logger {
|
||||
void log_request(bool is_host_vst, const YaPluginFactory::SetHostContext&);
|
||||
void log_request(bool is_host_vst, const WantsConfiguration&);
|
||||
|
||||
void log_response(bool is_host_vst, const uint32&);
|
||||
void log_response(bool is_host_vst, const Ack&);
|
||||
void log_response(
|
||||
bool is_host_vst,
|
||||
@@ -91,6 +90,13 @@ class Vst3Logger {
|
||||
void log_response(bool is_host_vst, const YaPluginFactory::ConstructArgs&);
|
||||
void log_response(bool is_host_vst, const Configuration&);
|
||||
|
||||
template <typename T>
|
||||
void log_response(bool is_host_vst, const PrimitiveWrapper<T>& value) {
|
||||
// For logging all primitive return values other than `tresult`
|
||||
log_response_base(is_host_vst,
|
||||
[&](auto& message) { message << value; });
|
||||
}
|
||||
|
||||
Logger& logger;
|
||||
|
||||
private:
|
||||
|
||||
@@ -71,7 +71,7 @@ class PrimitiveWrapper {
|
||||
PrimitiveWrapper() {}
|
||||
PrimitiveWrapper(T value) : value(value) {}
|
||||
|
||||
operator T() { return value; }
|
||||
operator T() const { return value; }
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
|
||||
Reference in New Issue
Block a user