mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 12:30:12 +02:00
Allow resizing shared memory buffers in setActive
REAPER apparently changes bus arrangements between `IAudioProcessor::setupProcessing()` and `IAudioProcessor::setActive()`.
This commit is contained in:
@@ -194,6 +194,11 @@ class YaAudioProcessor : public Steinberg::Vst::IAudioProcessor {
|
||||
/**
|
||||
* 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;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <pluginterfaces/vst/ivstcomponent.h>
|
||||
|
||||
#include "../../../audio-shm.h"
|
||||
#include "../../../bitsery/ext/in-place-optional.h"
|
||||
#include "../../common.h"
|
||||
#include "../base.h"
|
||||
@@ -251,12 +252,32 @@ class YaComponent : public Steinberg::Vst::IComponent {
|
||||
int32 index,
|
||||
TBool state) override = 0;
|
||||
|
||||
/**
|
||||
* The response code and written state for a call to
|
||||
* `IAudioProcessor::setupProcessing(setup)`.
|
||||
*/
|
||||
struct SetActiveResponse {
|
||||
UniversalTResult result;
|
||||
std::optional<AudioShmBuffer::Config> updated_audio_buffers_config;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.object(result);
|
||||
s.ext(updated_audio_buffers_config,
|
||||
bitsery::ext::InPlaceOptional{});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Message to pass through a call to `IComponent::setActive(state)` to the
|
||||
* Wine plugin host.
|
||||
*
|
||||
* NOTE: REAPER may change a plugin's bus arrangements after the processing
|
||||
* has been set up, so we need to check for this on every
|
||||
* `setActive()` call
|
||||
*/
|
||||
struct SetActive {
|
||||
using Response = UniversalTResult;
|
||||
using Response = SetActiveResponse;
|
||||
|
||||
native_size_t instance_id;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user