Only set up VST3 SHM audio buffers in setActive()

This avoids doing the duplicate check (since both `setProcessing()` and
`setActive()` would be called), and this also gets rid of the assumption
added a couple commits ago that `setupProcessing()` is only ever called
once, which is not true.
This commit is contained in:
Robbert van der Helm
2022-05-19 14:43:59 +02:00
parent 8c10edf861
commit 162aeed661
11 changed files with 21 additions and 78 deletions
@@ -178,32 +178,12 @@ class YaAudioProcessor : public Steinberg::Vst::IAudioProcessor {
virtual uint32 PLUGIN_API getLatencySamples() override = 0;
/**
* The response code and written state for a call to
* `IAudioProcessor::setupProcessing(setup)`.
*/
struct SetupProcessingResponse {
UniversalTResult result;
AudioShmBuffer::Config audio_buffers_config;
template <typename S>
void serialize(S& s) {
s.object(result);
s.object(audio_buffers_config);
}
};
/**
* Message to pass through a call to
* `IAudioProcessor::setupProcessing(setup)` to the Wine plugin host.
*
* Here Wine plugin host will set up the shared memory buffers.
*
* NOTE: This process is repeated as part of `SetActive`. Apparently REAPER
* can change bus arrangements after the processing has been set up.
*/
struct SetupProcessing {
using Response = SetupProcessingResponse;
using Response = UniversalTResult;
native_size_t instance_id;