Don't serialize input info for IComponent::getBusInfo

This commit is contained in:
Robbert van der Helm
2021-02-12 19:12:49 +01:00
parent e62bd603f9
commit 67091bc13c
4 changed files with 16 additions and 21 deletions
+4 -4
View File
@@ -1787,10 +1787,10 @@ void Vst3Logger::log_response(bool is_host_vst,
message << response.result.string();
if (response.result == Steinberg::kResultOk) {
message << ", <BusInfo for \""
<< VST3::StringConvert::convert(response.updated_bus.name)
<< "\" with " << response.updated_bus.channelCount
<< " channels, type = " << response.updated_bus.busType
<< ", flags = " << response.updated_bus.flags << ">";
<< 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)";
}
@@ -151,12 +151,12 @@ class YaComponent : public Steinberg::Vst::IComponent {
*/
struct GetBusInfoResponse {
UniversalTResult result;
Steinberg::Vst::BusInfo updated_bus;
Steinberg::Vst::BusInfo bus;
template <typename S>
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 <typename S>
void serialize(S& s) {
s.value8b(instance_id);
s.value4b(type);
s.value4b(dir);
s.object(bus);
}
};
@@ -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;
}
}
+5 -4
View File
@@ -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 {