mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +02:00
Implement IAudioProcessor::setProcessing()
This commit is contained in:
@@ -200,6 +200,15 @@ void Vst3Logger::log_request(bool is_host_vst,
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaComponent::SetProcessing& request) {
|
||||
log_request_base(is_host_vst, [&](auto& message) {
|
||||
message << "<IAudioProcessor* #" << request.instance_id
|
||||
<< ">::setProcessing(state = "
|
||||
<< (request.state ? "true" : "false") << ")";
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaPluginFactory::Construct&) {
|
||||
log_request_base(is_host_vst,
|
||||
|
||||
@@ -74,6 +74,7 @@ class Vst3Logger {
|
||||
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 YaComponent::SetProcessing&);
|
||||
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&);
|
||||
|
||||
@@ -74,6 +74,7 @@ using ControlRequest = std::variant<YaComponent::Construct,
|
||||
YaComponent::CanProcessSampleSize,
|
||||
YaComponent::GetLatencySamples,
|
||||
YaComponent::SetupProcessing,
|
||||
YaComponent::SetProcessing,
|
||||
YaPluginFactory::Construct,
|
||||
YaPluginFactory::SetHostContext>;
|
||||
|
||||
|
||||
@@ -560,6 +560,25 @@ class YaComponent : public Steinberg::Vst::IComponent,
|
||||
|
||||
virtual tresult PLUGIN_API
|
||||
setupProcessing(Steinberg::Vst::ProcessSetup& setup) override = 0;
|
||||
|
||||
/**
|
||||
* Message to pass through a call to `IAudioProcessor::setProcessing(state)`
|
||||
* to the Wine plugin host.
|
||||
*/
|
||||
struct SetProcessing {
|
||||
using Response = UniversalTResult;
|
||||
|
||||
native_size_t instance_id;
|
||||
|
||||
TBool state;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(instance_id);
|
||||
s.value1b(state);
|
||||
}
|
||||
};
|
||||
|
||||
virtual tresult PLUGIN_API setProcessing(TBool state) override = 0;
|
||||
virtual tresult PLUGIN_API
|
||||
process(Steinberg::Vst::ProcessData& data) override = 0;
|
||||
|
||||
@@ -194,9 +194,8 @@ YaComponentPluginImpl::setupProcessing(Steinberg::Vst::ProcessSetup& setup) {
|
||||
}
|
||||
|
||||
tresult PLUGIN_API YaComponentPluginImpl::setProcessing(TBool state) {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO: IAudioProcessor::setProcessing()");
|
||||
return Steinberg::kNotImplemented;
|
||||
return bridge.send_message(YaComponent::SetProcessing{
|
||||
.instance_id = arguments.instance_id, .state = state});
|
||||
}
|
||||
|
||||
tresult PLUGIN_API
|
||||
|
||||
@@ -200,6 +200,11 @@ void Vst3Bridge::run() {
|
||||
return component_instances[request.instance_id]
|
||||
.audio_processor->setupProcessing(request.setup);
|
||||
},
|
||||
[&](const YaComponent::SetProcessing& request)
|
||||
-> YaComponent::SetProcessing::Response {
|
||||
return component_instances[request.instance_id]
|
||||
.audio_processor->setProcessing(request.state);
|
||||
},
|
||||
[&](const YaPluginFactory::Construct&)
|
||||
-> YaPluginFactory::Construct::Response {
|
||||
return YaPluginFactory::ConstructArgs(
|
||||
|
||||
Reference in New Issue
Block a user