mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-20 11:02:52 +02:00
Implement IAudioProcessor::getTailSamples()
This commit is contained in:
@@ -17,7 +17,9 @@ imcomplete list of things that still have to be done before this can be used:
|
|||||||
|
|
||||||
- Left to implement:
|
- Left to implement:
|
||||||
- `YaHostApplicationHostImpl::createComponent`.
|
- `YaHostApplicationHostImpl::createComponent`.
|
||||||
- `IAudioProcessor` and `IConnectionPoint` to supplement `IComponent`
|
- `IAudioProcessor::process()` along with every interface and struct involved
|
||||||
|
in `ProcessData`
|
||||||
|
- `IConnectionPoint` to supplement `IComponent`
|
||||||
- `IEditController{,2}`
|
- `IEditController{,2}`
|
||||||
- All other mandatory interfaces
|
- All other mandatory interfaces
|
||||||
- All other optional interfaces
|
- All other optional interfaces
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ void Vst3Logger::log_unknown_interface(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Vst3Logger::log_request(bool is_host_vst, const YaComponent::Construct&) {
|
void Vst3Logger::log_request(bool is_host_vst, const YaComponent::Construct&) {
|
||||||
log_request_base(is_host_vst, [](auto& message) {
|
log_request_base(is_host_vst, [&](auto& message) {
|
||||||
// TODO: Log the CID on verbosity level 2, and then also report all CIDs
|
// TODO: Log the CID on verbosity level 2, and then also report all CIDs
|
||||||
// in the plugin factory
|
// in the plugin factory
|
||||||
message << "IPluginFactory::createComponent(cid = ..., _iid = "
|
message << "IPluginFactory::createComponent(cid = ..., _iid = "
|
||||||
@@ -209,21 +209,29 @@ void Vst3Logger::log_request(bool is_host_vst,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Vst3Logger::log_request(bool is_host_vst,
|
||||||
|
const YaComponent::GetTailSamples& request) {
|
||||||
|
log_request_base(is_host_vst, [&](auto& message) {
|
||||||
|
message << "<IAudioProcessor* #" << request.instance_id
|
||||||
|
<< ">::getTailSamples()";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
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,
|
||||||
[](auto& message) { message << "GetPluginFactory()"; });
|
[&](auto& message) { message << "GetPluginFactory()"; });
|
||||||
}
|
}
|
||||||
|
|
||||||
void Vst3Logger::log_request(bool is_host_vst,
|
void Vst3Logger::log_request(bool is_host_vst,
|
||||||
const YaPluginFactory::SetHostContext&) {
|
const YaPluginFactory::SetHostContext&) {
|
||||||
log_request_base(is_host_vst, [](auto& message) {
|
log_request_base(is_host_vst, [&](auto& message) {
|
||||||
message << "IPluginFactory3::setHostContext(IHostApplication*)";
|
message << "IPluginFactory3::setHostContext(IHostApplication*)";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void Vst3Logger::log_request(bool is_host_vst, const WantsConfiguration&) {
|
void Vst3Logger::log_request(bool is_host_vst, const WantsConfiguration&) {
|
||||||
log_request_base(is_host_vst, [](auto& message) {
|
log_request_base(is_host_vst, [&](auto& message) {
|
||||||
message << "Requesting <Configuration>";
|
message << "Requesting <Configuration>";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -305,5 +313,5 @@ void Vst3Logger::log_response(bool is_host_vst,
|
|||||||
|
|
||||||
void Vst3Logger::log_response(bool is_host_vst, const Configuration&) {
|
void Vst3Logger::log_response(bool is_host_vst, const Configuration&) {
|
||||||
log_response_base(is_host_vst,
|
log_response_base(is_host_vst,
|
||||||
[](auto& message) { message << "<Configuration"; });
|
[&](auto& message) { message << "<Configuration"; });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ class Vst3Logger {
|
|||||||
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 YaComponent::SetupProcessing&);
|
||||||
void log_request(bool is_host_vst, const YaComponent::SetProcessing&);
|
void log_request(bool is_host_vst, const YaComponent::SetProcessing&);
|
||||||
|
void log_request(bool is_host_vst, const YaComponent::GetTailSamples&);
|
||||||
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&);
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ using ControlRequest = std::variant<YaComponent::Construct,
|
|||||||
YaComponent::GetLatencySamples,
|
YaComponent::GetLatencySamples,
|
||||||
YaComponent::SetupProcessing,
|
YaComponent::SetupProcessing,
|
||||||
YaComponent::SetProcessing,
|
YaComponent::SetProcessing,
|
||||||
|
// TODO: YaComponent::Process
|
||||||
|
YaComponent::GetTailSamples,
|
||||||
YaPluginFactory::Construct,
|
YaPluginFactory::Construct,
|
||||||
YaPluginFactory::SetHostContext>;
|
YaPluginFactory::SetHostContext>;
|
||||||
|
|
||||||
|
|||||||
@@ -582,6 +582,22 @@ class YaComponent : public Steinberg::Vst::IComponent,
|
|||||||
virtual tresult PLUGIN_API setProcessing(TBool state) override = 0;
|
virtual tresult PLUGIN_API setProcessing(TBool state) override = 0;
|
||||||
virtual tresult PLUGIN_API
|
virtual tresult PLUGIN_API
|
||||||
process(Steinberg::Vst::ProcessData& data) override = 0;
|
process(Steinberg::Vst::ProcessData& data) override = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Message to pass through a call to `IAudioProcessor::getTailSamples()`
|
||||||
|
* to the Wine plugin host.
|
||||||
|
*/
|
||||||
|
struct GetTailSamples {
|
||||||
|
using Response = PrimitiveWrapper<uint32>;
|
||||||
|
|
||||||
|
native_size_t instance_id;
|
||||||
|
|
||||||
|
template <typename S>
|
||||||
|
void serialize(S& s) {
|
||||||
|
s.value8b(instance_id);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
virtual uint32 PLUGIN_API getTailSamples() override = 0;
|
virtual uint32 PLUGIN_API getTailSamples() override = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -206,7 +206,6 @@ YaComponentPluginImpl::process(Steinberg::Vst::ProcessData& data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32 PLUGIN_API YaComponentPluginImpl::getTailSamples() {
|
uint32 PLUGIN_API YaComponentPluginImpl::getTailSamples() {
|
||||||
// TODO: Implement
|
return bridge.send_message(
|
||||||
bridge.logger.log("TODO: IAudioProcessor::getTailSamples()");
|
YaComponent::GetTailSamples{.instance_id = arguments.instance_id});
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,6 +205,11 @@ void Vst3Bridge::run() {
|
|||||||
return component_instances[request.instance_id]
|
return component_instances[request.instance_id]
|
||||||
.audio_processor->setProcessing(request.state);
|
.audio_processor->setProcessing(request.state);
|
||||||
},
|
},
|
||||||
|
[&](const YaComponent::GetTailSamples& request)
|
||||||
|
-> YaComponent::GetTailSamples::Response {
|
||||||
|
return component_instances[request.instance_id]
|
||||||
|
.audio_processor->getTailSamples();
|
||||||
|
},
|
||||||
[&](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