Implement IComponent::getRoutingInfo()

This commit is contained in:
Robbert van der Helm
2020-12-13 21:51:56 +01:00
parent 583645bb46
commit 5b6a8ebfac
6 changed files with 98 additions and 3 deletions
+1
View File
@@ -64,6 +64,7 @@ using ControlRequest = std::variant<YaComponent::Construct,
YaComponent::SetIoMode,
YaComponent::GetBusCount,
YaComponent::GetBusInfo,
YaComponent::GetRoutingInfo,
YaPluginFactory::Construct,
YaPluginFactory::SetHostContext>;
+45
View File
@@ -260,6 +260,44 @@ class YaComponent : public Steinberg::Vst::IComponent {
Steinberg::Vst::BusDirection dir,
int32 index,
Steinberg::Vst::BusInfo& bus /*out*/) override = 0;
/**
* The response code and returned routing information for a call to
* `IComponent::getRoutingInfo(inInfo, outInfo <out>)`.
*/
struct GetRoutingInfoResponse {
UniversalTResult result;
Steinberg::Vst::RoutingInfo updated_in_info;
Steinberg::Vst::RoutingInfo updated_out_info;
template <typename S>
void serialize(S& s) {
s.object(result);
s.object(updated_in_info);
s.object(updated_out_info);
}
};
/**
* Message to pass through a call to `IComponent::getRoutingInfo(inInfo,
* outInfo <out>)` to the Wine plugin host.
*/
struct GetRoutingInfo {
using Response = GetRoutingInfoResponse;
native_size_t instance_id;
Steinberg::Vst::RoutingInfo in_info;
Steinberg::Vst::RoutingInfo out_info;
template <typename S>
void serialize(S& s) {
s.value8b(instance_id);
s.object(in_info);
s.object(out_info);
}
};
virtual tresult PLUGIN_API
getRoutingInfo(Steinberg::Vst::RoutingInfo& inInfo,
Steinberg::Vst::RoutingInfo& outInfo /*out*/) override = 0;
@@ -297,5 +335,12 @@ void serialize(S& s, Steinberg::Vst::BusInfo& info) {
s.value4b(info.busType);
s.value4b(info.flags);
}
template <typename S>
void serialize(S& s, Steinberg::Vst::RoutingInfo& info) {
s.value4b(info.mediaType);
s.value4b(info.busIndex);
s.value4b(info.channel);
}
} // namespace Vst
} // namespace Steinberg