Add dedicated IAudioProcessor/IComponent sockets

This way every relevant object instance will get its own thread for
handling these calls. The alternative would be creating a full fat
Vst3MessageHandler pair for all object instances, but that would be a
huge waste.
This commit is contained in:
Robbert van der Helm
2020-12-21 17:25:08 +01:00
parent 415c1b5683
commit 51877796fa
10 changed files with 764 additions and 500 deletions
+29 -15
View File
@@ -64,21 +64,6 @@ using ControlRequest = std::variant<Vst3PlugViewProxy::Destruct,
Vst3PluginProxy::Destruct,
Vst3PluginProxy::SetState,
Vst3PluginProxy::GetState,
YaAudioProcessor::SetBusArrangements,
YaAudioProcessor::GetBusArrangement,
YaAudioProcessor::CanProcessSampleSize,
YaAudioProcessor::GetLatencySamples,
YaAudioProcessor::SetupProcessing,
YaAudioProcessor::SetProcessing,
YaAudioProcessor::Process,
YaAudioProcessor::GetTailSamples,
YaComponent::GetControllerClassId,
YaComponent::SetIoMode,
YaComponent::GetBusCount,
YaComponent::GetBusInfo,
YaComponent::GetRoutingInfo,
YaComponent::ActivateBus,
YaComponent::SetActive,
YaConnectionPoint::Connect,
YaConnectionPoint::Disconnect,
YaEditController::SetComponentState,
@@ -107,6 +92,35 @@ void serialize(S& s, ControlRequest& payload) {
s.ext(payload, bitsery::ext::StdVariant{});
}
/**
* A subset of all functions a host can call on a plugin. These functions are
* called from a hot loop every processing cycle, so we want a dedicated socket
* for these for every plugin instance.
*/
using AudioProcessorRequest =
std::variant<YaAudioProcessor::SetBusArrangements,
YaAudioProcessor::GetBusArrangement,
YaAudioProcessor::CanProcessSampleSize,
YaAudioProcessor::GetLatencySamples,
YaAudioProcessor::SetupProcessing,
YaAudioProcessor::SetProcessing,
YaAudioProcessor::Process,
YaAudioProcessor::GetTailSamples,
YaComponent::GetControllerClassId,
YaComponent::SetIoMode,
YaComponent::GetBusCount,
YaComponent::GetBusInfo,
YaComponent::GetRoutingInfo,
YaComponent::ActivateBus,
YaComponent::SetActive>;
template <typename S>
void serialize(S& s, AudioProcessorRequest& payload) {
// All of the objects in `AudioProcessorRequest` should have their own
// serialization function.
s.ext(payload, bitsery::ext::StdVariant{});
}
/**
* When we do a callback from the Wine VST host to the plugin, this encodes the
* information we want or the operation we want to perform. A request of type