Implement IAudioProcessor::setupProcessing()

This commit is contained in:
Robbert van der Helm
2020-12-14 21:25:05 +01:00
parent cb7413c521
commit b1bcfd3873
6 changed files with 52 additions and 8 deletions
+12
View File
@@ -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,
+1
View File
@@ -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&);
+1
View File
@@ -73,6 +73,7 @@ using ControlRequest = std::variant<YaComponent::Construct,
YaComponent::GetBusArrangement,
YaComponent::CanProcessSampleSize,
YaComponent::GetLatencySamples,
YaComponent::SetupProcessing,
YaPluginFactory::Construct,
YaPluginFactory::SetHostContext>;
+29 -3
View File
@@ -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