mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +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,
|
void Vst3Logger::log_request(bool is_host_vst,
|
||||||
const YaPluginFactory::Construct&) {
|
const YaPluginFactory::Construct&) {
|
||||||
log_request_base(is_host_vst,
|
log_request_base(is_host_vst,
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ class Vst3Logger {
|
|||||||
void log_request(bool is_host_vst,
|
void log_request(bool is_host_vst,
|
||||||
const YaComponent::CanProcessSampleSize&);
|
const YaComponent::CanProcessSampleSize&);
|
||||||
void log_request(bool is_host_vst, const YaComponent::GetLatencySamples&);
|
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::Construct&);
|
||||||
void log_request(bool is_host_vst, const YaPluginFactory::SetHostContext&);
|
void log_request(bool is_host_vst, const YaPluginFactory::SetHostContext&);
|
||||||
void log_request(bool is_host_vst, const WantsConfiguration&);
|
void log_request(bool is_host_vst, const WantsConfiguration&);
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ using ControlRequest = std::variant<YaComponent::Construct,
|
|||||||
YaComponent::GetBusArrangement,
|
YaComponent::GetBusArrangement,
|
||||||
YaComponent::CanProcessSampleSize,
|
YaComponent::CanProcessSampleSize,
|
||||||
YaComponent::GetLatencySamples,
|
YaComponent::GetLatencySamples,
|
||||||
|
YaComponent::SetupProcessing,
|
||||||
YaPluginFactory::Construct,
|
YaPluginFactory::Construct,
|
||||||
YaPluginFactory::SetHostContext>;
|
YaPluginFactory::SetHostContext>;
|
||||||
|
|
||||||
|
|||||||
@@ -524,9 +524,8 @@ class YaComponent : public Steinberg::Vst::IComponent,
|
|||||||
canProcessSampleSize(int32 symbolicSampleSize) override = 0;
|
canProcessSampleSize(int32 symbolicSampleSize) override = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Message to pass through a call to
|
* Message to pass through a call to `IAudioProcessor::getLatencySamples()`
|
||||||
* `IAudioProcessor::getLatencySamples()` to the Wine
|
* to the Wine plugin host.
|
||||||
* plugin host.
|
|
||||||
*/
|
*/
|
||||||
struct GetLatencySamples {
|
struct GetLatencySamples {
|
||||||
using Response = PrimitiveWrapper<uint32>;
|
using Response = PrimitiveWrapper<uint32>;
|
||||||
@@ -540,6 +539,25 @@ class YaComponent : public Steinberg::Vst::IComponent,
|
|||||||
};
|
};
|
||||||
|
|
||||||
virtual uint32 PLUGIN_API getLatencySamples() override = 0;
|
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
|
virtual tresult PLUGIN_API
|
||||||
setupProcessing(Steinberg::Vst::ProcessSetup& setup) override = 0;
|
setupProcessing(Steinberg::Vst::ProcessSetup& setup) override = 0;
|
||||||
virtual tresult PLUGIN_API setProcessing(TBool state) 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.busIndex);
|
||||||
s.value4b(info.channel);
|
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 Vst
|
||||||
} // namespace Steinberg
|
} // namespace Steinberg
|
||||||
|
|||||||
@@ -189,9 +189,8 @@ uint32 PLUGIN_API YaComponentPluginImpl::getLatencySamples() {
|
|||||||
|
|
||||||
tresult PLUGIN_API
|
tresult PLUGIN_API
|
||||||
YaComponentPluginImpl::setupProcessing(Steinberg::Vst::ProcessSetup& setup) {
|
YaComponentPluginImpl::setupProcessing(Steinberg::Vst::ProcessSetup& setup) {
|
||||||
// TODO: Implement
|
return bridge.send_message(YaComponent::SetupProcessing{
|
||||||
bridge.logger.log("TODO: IAudioProcessor::setupProcessing()");
|
.instance_id = arguments.instance_id, .setup = setup});
|
||||||
return Steinberg::kNotImplemented;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tresult PLUGIN_API YaComponentPluginImpl::setProcessing(TBool state) {
|
tresult PLUGIN_API YaComponentPluginImpl::setProcessing(TBool state) {
|
||||||
|
|||||||
@@ -184,17 +184,22 @@ void Vst3Bridge::run() {
|
|||||||
return YaComponent::GetBusArrangementResponse{
|
return YaComponent::GetBusArrangementResponse{
|
||||||
.result = result, .updated_arr = request.arr};
|
.result = result, .updated_arr = request.arr};
|
||||||
},
|
},
|
||||||
[&](YaComponent::CanProcessSampleSize& request)
|
[&](const YaComponent::CanProcessSampleSize& request)
|
||||||
-> YaComponent::CanProcessSampleSize::Response {
|
-> YaComponent::CanProcessSampleSize::Response {
|
||||||
return component_instances[request.instance_id]
|
return component_instances[request.instance_id]
|
||||||
.audio_processor->canProcessSampleSize(
|
.audio_processor->canProcessSampleSize(
|
||||||
request.symbolic_sample_size);
|
request.symbolic_sample_size);
|
||||||
},
|
},
|
||||||
[&](YaComponent::GetLatencySamples& request)
|
[&](const YaComponent::GetLatencySamples& request)
|
||||||
-> YaComponent::GetLatencySamples::Response {
|
-> YaComponent::GetLatencySamples::Response {
|
||||||
return component_instances[request.instance_id]
|
return component_instances[request.instance_id]
|
||||||
.audio_processor->getLatencySamples();
|
.audio_processor->getLatencySamples();
|
||||||
},
|
},
|
||||||
|
[&](YaComponent::SetupProcessing& request)
|
||||||
|
-> YaComponent::SetupProcessing::Response {
|
||||||
|
return component_instances[request.instance_id]
|
||||||
|
.audio_processor->setupProcessing(request.setup);
|
||||||
|
},
|
||||||
[&](const YaPluginFactory::Construct&)
|
[&](const YaPluginFactory::Construct&)
|
||||||
-> YaPluginFactory::Construct::Response {
|
-> YaPluginFactory::Construct::Response {
|
||||||
return YaPluginFactory::ConstructArgs(
|
return YaPluginFactory::ConstructArgs(
|
||||||
|
|||||||
Reference in New Issue
Block a user