mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 20:40:11 +02:00
Add shared audio buffers config to IAudioProcessor::setupProcessing()
This commit is contained in:
@@ -1766,6 +1766,19 @@ void Vst3Logger::log_response(
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_response(
|
||||
bool is_host_vst,
|
||||
const YaAudioProcessor::SetupProcessingResponse& response) {
|
||||
log_response_base(is_host_vst, [&](auto& message) {
|
||||
message << response.result.string();
|
||||
if (response.result == Steinberg::kResultOk) {
|
||||
message << ", <shared memory configuration for \""
|
||||
<< response.audio_buffers_config.name << "\", "
|
||||
<< response.audio_buffers_config.size << " bytes>";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_response(
|
||||
bool is_host_vst,
|
||||
const YaAudioProcessor::ProcessResponse& response) {
|
||||
|
||||
@@ -309,6 +309,8 @@ class Vst3Logger {
|
||||
|
||||
void log_response(bool is_host_vst,
|
||||
const YaAudioProcessor::GetBusArrangementResponse&);
|
||||
void log_response(bool is_host_vst,
|
||||
const YaAudioProcessor::SetupProcessingResponse&);
|
||||
void log_response(bool is_host_vst,
|
||||
const YaAudioProcessor::ProcessResponse&);
|
||||
void log_response(bool is_host_vst,
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <bitsery/ext/std_optional.h>
|
||||
#include <pluginterfaces/vst/ivstaudioprocessor.h>
|
||||
|
||||
#include "../../../audio-shm.h"
|
||||
#include "../../common.h"
|
||||
#include "../base.h"
|
||||
#include "../process-data.h"
|
||||
@@ -175,12 +176,27 @@ 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.
|
||||
*/
|
||||
struct SetupProcessing {
|
||||
using Response = UniversalTResult;
|
||||
using Response = SetupProcessingResponse;
|
||||
|
||||
native_size_t instance_id;
|
||||
|
||||
|
||||
@@ -182,9 +182,11 @@ uint32 PLUGIN_API Vst3PluginProxyImpl::getLatencySamples() {
|
||||
|
||||
tresult PLUGIN_API
|
||||
Vst3PluginProxyImpl::setupProcessing(Steinberg::Vst::ProcessSetup& setup) {
|
||||
return bridge.send_audio_processor_message(
|
||||
YaAudioProcessor::SetupProcessing{.instance_id = instance_id(),
|
||||
.setup = setup});
|
||||
// TOOD: Set up the shared audio buffers next
|
||||
return bridge
|
||||
.send_audio_processor_message(YaAudioProcessor::SetupProcessing{
|
||||
.instance_id = instance_id(), .setup = setup})
|
||||
.result;
|
||||
}
|
||||
|
||||
tresult PLUGIN_API Vst3PluginProxyImpl::setProcessing(TBool state) {
|
||||
|
||||
@@ -1219,8 +1219,15 @@ size_t Vst3Bridge::register_object_instance(
|
||||
},
|
||||
[&](YaAudioProcessor::SetupProcessing& request)
|
||||
-> YaAudioProcessor::SetupProcessing::Response {
|
||||
return object_instances[request.instance_id]
|
||||
.audio_processor->setupProcessing(request.setup);
|
||||
const tresult result =
|
||||
object_instances[request.instance_id]
|
||||
.audio_processor->setupProcessing(
|
||||
request.setup);
|
||||
return YaAudioProcessor::SetupProcessingResponse{
|
||||
.result = result,
|
||||
// TODO: Send the configuration for the shared audio
|
||||
// buffers
|
||||
.audio_buffers_config{}};
|
||||
},
|
||||
[&](const YaAudioProcessor::SetProcessing& request)
|
||||
-> YaAudioProcessor::SetProcessing::Response {
|
||||
|
||||
Reference in New Issue
Block a user