mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +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:
@@ -1897,6 +1897,19 @@ void Vst3Logger::log_response(
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_response(bool is_host_vst,
|
||||
const YaComponent::SetActiveResponse& response) {
|
||||
log_response_base(is_host_vst, [&](auto& message) {
|
||||
message << response.result.string();
|
||||
if (response.result == Steinberg::kResultOk &&
|
||||
response.updated_audio_buffers_config) {
|
||||
message << ", <new shared memory configuration for \""
|
||||
<< response.updated_audio_buffers_config->name << "\", "
|
||||
<< response.updated_audio_buffers_config->size << " bytes>";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_response(
|
||||
bool is_host_vst,
|
||||
const YaPrefetchableSupport::GetPrefetchableSupportResponse& response) {
|
||||
|
||||
@@ -319,6 +319,7 @@ class Vst3Logger {
|
||||
bool from_cache = false);
|
||||
void log_response(bool is_host_vst,
|
||||
const YaComponent::GetRoutingInfoResponse&);
|
||||
void log_response(bool is_host_vst, const YaComponent::SetActiveResponse&);
|
||||
void log_response(
|
||||
bool is_host_vst,
|
||||
const YaPrefetchableSupport::GetPrefetchableSupportResponse&);
|
||||
|
||||
@@ -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