Don't serialize input output info for IComponent::getRoutingInfo

Yes, input output info.
This commit is contained in:
Robbert van der Helm
2021-02-12 19:24:04 +01:00
parent 67091bc13c
commit 4e4ed3a6b4
4 changed files with 17 additions and 32 deletions
+3 -9
View File
@@ -1086,9 +1086,7 @@ bool Vst3Logger::log_request(bool is_host_vst,
<< request.instance_id << request.instance_id
<< ": IComponent::getRoutingInfo(inInfo = <RoutingInfo& for bus " << ": IComponent::getRoutingInfo(inInfo = <RoutingInfo& for bus "
<< request.in_info.busIndex << " and channel " << request.in_info.busIndex << " and channel "
<< request.in_info.channel << ">, outInfo = <RoutingInfo& for bus " << request.in_info.channel << ">, &outInfo)";
<< request.out_info.busIndex << " and channel "
<< request.out_info.channel << ">)";
}); });
} }
@@ -1804,12 +1802,8 @@ void Vst3Logger::log_response(
log_response_base(is_host_vst, [&](auto& message) { log_response_base(is_host_vst, [&](auto& message) {
message << response.result.string(); message << response.result.string();
if (response.result == Steinberg::kResultOk) { if (response.result == Steinberg::kResultOk) {
message << ", <RoutingInfo& for bus " message << ", <RoutingInfo& for bus " << response.out_info.busIndex
<< response.updated_in_info.busIndex << " and channel " << " and channel " << response.out_info.channel << ">";
<< response.updated_in_info.channel
<< ", <RoutingInfo& for bus "
<< response.updated_out_info.busIndex << " and channel "
<< response.updated_out_info.channel << ">";
} }
}); });
} }
@@ -30,9 +30,6 @@
* part of `Vst3PluginProxy`. Event though `IComponent` inherits from * part of `Vst3PluginProxy`. Event though `IComponent` inherits from
* `IPlguinBase`, we'll implement that separately in `YaPluginBase` because * `IPlguinBase`, we'll implement that separately in `YaPluginBase` because
* `IEditController` also inherits from `IPluginBase`. * `IEditController` also inherits from `IPluginBase`.
*
* TODO: Remove the original fields for out parameters in the structs. They're
* really supposed to be empty.
*/ */
class YaComponent : public Steinberg::Vst::IComponent { class YaComponent : public Steinberg::Vst::IComponent {
public: public:
@@ -147,7 +144,7 @@ class YaComponent : public Steinberg::Vst::IComponent {
/** /**
* The response code and returned bus information for a call to * The response code and returned bus information for a call to
* `IComponent::getBusInfo(type, dir, index, bus <out>)`. * `IComponent::getBusInfo(type, dir, index, &bus)`.
*/ */
struct GetBusInfoResponse { struct GetBusInfoResponse {
UniversalTResult result; UniversalTResult result;
@@ -162,7 +159,7 @@ class YaComponent : public Steinberg::Vst::IComponent {
/** /**
* Message to pass through a call to `IComponent::getBusInfo(type, dir, * Message to pass through a call to `IComponent::getBusInfo(type, dir,
* index, bus <out>)` to the Wine plugin host. * index, &bus)` to the Wine plugin host.
*/ */
struct GetBusInfo { struct GetBusInfo {
using Response = GetBusInfoResponse; using Response = GetBusInfoResponse;
@@ -189,24 +186,22 @@ class YaComponent : public Steinberg::Vst::IComponent {
/** /**
* The response code and returned routing information for a call to * The response code and returned routing information for a call to
* `IComponent::getRoutingInfo(in_info, out_info <out>)`. * `IComponent::getRoutingInfo(in_info, &out_info)`.
*/ */
struct GetRoutingInfoResponse { struct GetRoutingInfoResponse {
UniversalTResult result; UniversalTResult result;
Steinberg::Vst::RoutingInfo updated_in_info; Steinberg::Vst::RoutingInfo out_info;
Steinberg::Vst::RoutingInfo updated_out_info;
template <typename S> template <typename S>
void serialize(S& s) { void serialize(S& s) {
s.object(result); s.object(result);
s.object(updated_in_info); s.object(out_info);
s.object(updated_out_info);
} }
}; };
/** /**
* Message to pass through a call to `IComponent::getRoutingInfo(in_info, * Message to pass through a call to `IComponent::getRoutingInfo(in_info,
* out_info <out>)` to the Wine plugin host. * &out_info)` to the Wine plugin host.
*/ */
struct GetRoutingInfo { struct GetRoutingInfo {
using Response = GetRoutingInfoResponse; using Response = GetRoutingInfoResponse;
@@ -214,13 +209,11 @@ class YaComponent : public Steinberg::Vst::IComponent {
native_size_t instance_id; native_size_t instance_id;
Steinberg::Vst::RoutingInfo in_info; Steinberg::Vst::RoutingInfo in_info;
Steinberg::Vst::RoutingInfo out_info;
template <typename S> template <typename S>
void serialize(S& s) { void serialize(S& s) {
s.value8b(instance_id); s.value8b(instance_id);
s.object(in_info); s.object(in_info);
s.object(out_info);
} }
}; };
@@ -307,13 +307,12 @@ Vst3PluginProxyImpl::getBusInfo(Steinberg::Vst::MediaType type,
tresult PLUGIN_API Vst3PluginProxyImpl::getRoutingInfo( tresult PLUGIN_API Vst3PluginProxyImpl::getRoutingInfo(
Steinberg::Vst::RoutingInfo& inInfo, Steinberg::Vst::RoutingInfo& inInfo,
Steinberg::Vst::RoutingInfo& outInfo /*out*/) { Steinberg::Vst::RoutingInfo& outInfo /*out*/) {
const GetRoutingInfoResponse response = bridge.send_audio_processor_message( const GetRoutingInfoResponse response =
YaComponent::GetRoutingInfo{.instance_id = instance_id(), bridge.send_audio_processor_message(YaComponent::GetRoutingInfo{
.in_info = inInfo, .instance_id = instance_id(), .in_info = inInfo});
.out_info = outInfo});
outInfo = response.out_info;
inInfo = response.updated_in_info;
outInfo = response.updated_out_info;
return response.result; return response.result;
} }
+3 -4
View File
@@ -1216,15 +1216,14 @@ size_t Vst3Bridge::register_object_instance(
}, },
[&](YaComponent::GetRoutingInfo& request) [&](YaComponent::GetRoutingInfo& request)
-> YaComponent::GetRoutingInfo::Response { -> YaComponent::GetRoutingInfo::Response {
Steinberg::Vst::RoutingInfo out_info{};
const tresult result = const tresult result =
object_instances[request.instance_id] object_instances[request.instance_id]
.component->getRoutingInfo(request.in_info, .component->getRoutingInfo(request.in_info,
request.out_info); out_info);
return YaComponent::GetRoutingInfoResponse{ return YaComponent::GetRoutingInfoResponse{
.result = result, .result = result, .out_info = std::move(out_info)};
.updated_in_info = request.in_info,
.updated_out_info = request.out_info};
}, },
[&](const YaComponent::ActivateBus& request) [&](const YaComponent::ActivateBus& request)
-> YaComponent::ActivateBus::Response { -> YaComponent::ActivateBus::Response {