mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +02:00
Implement IAudioProcessor::setupProcessing()
This commit is contained in:
@@ -188,6 +188,18 @@ void Vst3Logger::log_request(bool is_host_vst,
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaComponent::SetupProcessing& request) {
|
||||
log_request_base(is_host_vst, [&](auto& message) {
|
||||
message << "<IAudioProcessor* #" << request.instance_id
|
||||
<< ">::setupProcessing(setup = <SetupProcessing with mode = "
|
||||
<< request.setup.processMode << ", symbolic_sample_size = "
|
||||
<< request.setup.symbolicSampleSize
|
||||
<< ", max_buffer_size = " << request.setup.maxSamplesPerBlock
|
||||
<< " and sample_rate = " << request.setup.sampleRate << ">)";
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaPluginFactory::Construct&) {
|
||||
log_request_base(is_host_vst,
|
||||
|
||||
@@ -73,6 +73,7 @@ class Vst3Logger {
|
||||
void log_request(bool is_host_vst,
|
||||
const YaComponent::CanProcessSampleSize&);
|
||||
void log_request(bool is_host_vst, const YaComponent::GetLatencySamples&);
|
||||
void log_request(bool is_host_vst, const YaComponent::SetupProcessing&);
|
||||
void log_request(bool is_host_vst, const YaPluginFactory::Construct&);
|
||||
void log_request(bool is_host_vst, const YaPluginFactory::SetHostContext&);
|
||||
void log_request(bool is_host_vst, const WantsConfiguration&);
|
||||
|
||||
@@ -73,6 +73,7 @@ using ControlRequest = std::variant<YaComponent::Construct,
|
||||
YaComponent::GetBusArrangement,
|
||||
YaComponent::CanProcessSampleSize,
|
||||
YaComponent::GetLatencySamples,
|
||||
YaComponent::SetupProcessing,
|
||||
YaPluginFactory::Construct,
|
||||
YaPluginFactory::SetHostContext>;
|
||||
|
||||
|
||||
@@ -524,9 +524,8 @@ class YaComponent : public Steinberg::Vst::IComponent,
|
||||
canProcessSampleSize(int32 symbolicSampleSize) override = 0;
|
||||
|
||||
/**
|
||||
* Message to pass through a call to
|
||||
* `IAudioProcessor::getLatencySamples()` to the Wine
|
||||
* plugin host.
|
||||
* Message to pass through a call to `IAudioProcessor::getLatencySamples()`
|
||||
* to the Wine plugin host.
|
||||
*/
|
||||
struct GetLatencySamples {
|
||||
using Response = PrimitiveWrapper<uint32>;
|
||||
@@ -540,6 +539,25 @@ class YaComponent : public Steinberg::Vst::IComponent,
|
||||
};
|
||||
|
||||
virtual uint32 PLUGIN_API getLatencySamples() override = 0;
|
||||
|
||||
/**
|
||||
* Message to pass through a call to
|
||||
* `IAudioProcessor::setupProcessing(setup)` to the Wine plugin host.
|
||||
*/
|
||||
struct SetupProcessing {
|
||||
using Response = UniversalTResult;
|
||||
|
||||
native_size_t instance_id;
|
||||
|
||||
Steinberg::Vst::ProcessSetup setup;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(instance_id);
|
||||
s.object(setup);
|
||||
}
|
||||
};
|
||||
|
||||
virtual tresult PLUGIN_API
|
||||
setupProcessing(Steinberg::Vst::ProcessSetup& setup) override = 0;
|
||||
virtual tresult PLUGIN_API setProcessing(TBool state) override = 0;
|
||||
@@ -578,5 +596,13 @@ void serialize(S& s, Steinberg::Vst::RoutingInfo& info) {
|
||||
s.value4b(info.busIndex);
|
||||
s.value4b(info.channel);
|
||||
}
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s, Steinberg::Vst::ProcessSetup& setup) {
|
||||
s.value4b(setup.processMode);
|
||||
s.value4b(setup.symbolicSampleSize);
|
||||
s.value4b(setup.maxSamplesPerBlock);
|
||||
s.value8b(setup.sampleRate);
|
||||
}
|
||||
} // namespace Vst
|
||||
} // namespace Steinberg
|
||||
|
||||
@@ -189,9 +189,8 @@ uint32 PLUGIN_API YaComponentPluginImpl::getLatencySamples() {
|
||||
|
||||
tresult PLUGIN_API
|
||||
YaComponentPluginImpl::setupProcessing(Steinberg::Vst::ProcessSetup& setup) {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO: IAudioProcessor::setupProcessing()");
|
||||
return Steinberg::kNotImplemented;
|
||||
return bridge.send_message(YaComponent::SetupProcessing{
|
||||
.instance_id = arguments.instance_id, .setup = setup});
|
||||
}
|
||||
|
||||
tresult PLUGIN_API YaComponentPluginImpl::setProcessing(TBool state) {
|
||||
|
||||
@@ -184,17 +184,22 @@ void Vst3Bridge::run() {
|
||||
return YaComponent::GetBusArrangementResponse{
|
||||
.result = result, .updated_arr = request.arr};
|
||||
},
|
||||
[&](YaComponent::CanProcessSampleSize& request)
|
||||
[&](const YaComponent::CanProcessSampleSize& request)
|
||||
-> YaComponent::CanProcessSampleSize::Response {
|
||||
return component_instances[request.instance_id]
|
||||
.audio_processor->canProcessSampleSize(
|
||||
request.symbolic_sample_size);
|
||||
},
|
||||
[&](YaComponent::GetLatencySamples& request)
|
||||
[&](const YaComponent::GetLatencySamples& request)
|
||||
-> YaComponent::GetLatencySamples::Response {
|
||||
return component_instances[request.instance_id]
|
||||
.audio_processor->getLatencySamples();
|
||||
},
|
||||
[&](YaComponent::SetupProcessing& request)
|
||||
-> YaComponent::SetupProcessing::Response {
|
||||
return component_instances[request.instance_id]
|
||||
.audio_processor->setupProcessing(request.setup);
|
||||
},
|
||||
[&](const YaPluginFactory::Construct&)
|
||||
-> YaPluginFactory::Construct::Response {
|
||||
return YaPluginFactory::ConstructArgs(
|
||||
|
||||
Reference in New Issue
Block a user