From 67091bc13c5e687540e981d004026142e9c4921b Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 12 Feb 2021 19:12:49 +0100 Subject: [PATCH] Don't serialize input info for IComponent::getBusInfo --- src/common/logging/vst3.cpp | 8 ++++---- src/common/serialization/vst3/plugin/component.h | 6 ++---- src/plugin/bridges/vst3-impls/plugin-proxy.cpp | 14 +++++--------- src/wine-host/bridges/vst3.cpp | 9 +++++---- 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/common/logging/vst3.cpp b/src/common/logging/vst3.cpp index 2f42d3bb..71adf0f2 100644 --- a/src/common/logging/vst3.cpp +++ b/src/common/logging/vst3.cpp @@ -1787,10 +1787,10 @@ void Vst3Logger::log_response(bool is_host_vst, message << response.result.string(); if (response.result == Steinberg::kResultOk) { message << ", "; + << VST3::StringConvert::convert(response.bus.name) + << "\" with " << response.bus.channelCount + << " channels, type = " << response.bus.busType + << ", flags = " << response.bus.flags << ">"; if (from_cache) { message << " (from cache)"; } diff --git a/src/common/serialization/vst3/plugin/component.h b/src/common/serialization/vst3/plugin/component.h index 30f7248f..3155e73f 100644 --- a/src/common/serialization/vst3/plugin/component.h +++ b/src/common/serialization/vst3/plugin/component.h @@ -151,12 +151,12 @@ class YaComponent : public Steinberg::Vst::IComponent { */ struct GetBusInfoResponse { UniversalTResult result; - Steinberg::Vst::BusInfo updated_bus; + Steinberg::Vst::BusInfo bus; template void serialize(S& s) { s.object(result); - s.object(updated_bus); + s.object(bus); } }; @@ -172,14 +172,12 @@ class YaComponent : public Steinberg::Vst::IComponent { Steinberg::Vst::BusType type; Steinberg::Vst::BusDirection dir; int32 index; - Steinberg::Vst::BusInfo bus; template void serialize(S& s) { s.value8b(instance_id); s.value4b(type); s.value4b(dir); - s.object(bus); } }; diff --git a/src/plugin/bridges/vst3-impls/plugin-proxy.cpp b/src/plugin/bridges/vst3-impls/plugin-proxy.cpp index f7583c96..ccedb8ea 100644 --- a/src/plugin/bridges/vst3-impls/plugin-proxy.cpp +++ b/src/plugin/bridges/vst3-impls/plugin-proxy.cpp @@ -260,11 +260,8 @@ Vst3PluginProxyImpl::getBusInfo(Steinberg::Vst::MediaType type, Steinberg::Vst::BusDirection dir, int32 index, Steinberg::Vst::BusInfo& bus /*out*/) { - const auto request = YaComponent::GetBusInfo{.instance_id = instance_id(), - .type = type, - .dir = dir, - .index = index, - .bus = bus}; + const auto request = YaComponent::GetBusInfo{ + .instance_id = instance_id(), .type = type, .dir = dir, .index = index}; // During processing we'll cache this info to work around an implementation // issue in REAPER @@ -281,8 +278,7 @@ Vst3PluginProxyImpl::getBusInfo(Steinberg::Vst::MediaType type, bridge.logger.log_response( true, YaComponent::GetBusInfo::Response{ - .result = Steinberg::kResultOk, - .updated_bus = it->second}, + .result = Steinberg::kResultOk, .bus = it->second}, true); } @@ -296,12 +292,12 @@ Vst3PluginProxyImpl::getBusInfo(Steinberg::Vst::MediaType type, const GetBusInfoResponse response = bridge.send_audio_processor_message(request); - bus = response.updated_bus; + bus = response.bus; { std::lock_guard lock(processing_bus_cache_mutex); if (processing_bus_cache) { - processing_bus_cache->bus_info[args] = response.updated_bus; + processing_bus_cache->bus_info[args] = response.bus; } } diff --git a/src/wine-host/bridges/vst3.cpp b/src/wine-host/bridges/vst3.cpp index e0a0eebf..135eaa15 100644 --- a/src/wine-host/bridges/vst3.cpp +++ b/src/wine-host/bridges/vst3.cpp @@ -1204,14 +1204,15 @@ size_t Vst3Bridge::register_object_instance( }, [&](YaComponent::GetBusInfo& request) -> YaComponent::GetBusInfo::Response { + Steinberg::Vst::BusInfo bus{}; const tresult result = object_instances[request.instance_id] - .component->getBusInfo( - request.type, request.dir, request.index, - request.bus); + .component->getBusInfo(request.type, + request.dir, + request.index, bus); return YaComponent::GetBusInfoResponse{ - .result = result, .updated_bus = request.bus}; + .result = result, .bus = std::move(bus)}; }, [&](YaComponent::GetRoutingInfo& request) -> YaComponent::GetRoutingInfo::Response {