mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Implement IAudioProcessor::getLatencySamples()
This commit is contained in:
@@ -180,6 +180,14 @@ void Vst3Logger::log_request(bool is_host_vst,
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaComponent::GetLatencySamples& request) {
|
||||
log_request_base(is_host_vst, [&](auto& message) {
|
||||
message << "<IAudioProcessor* #" << request.instance_id
|
||||
<< ">::getLatencySamples()";
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaPluginFactory::Construct&) {
|
||||
log_request_base(is_host_vst,
|
||||
@@ -199,6 +207,10 @@ void Vst3Logger::log_request(bool is_host_vst, const WantsConfiguration&) {
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_response(bool is_host_vst, const uint32& value) {
|
||||
log_response_base(is_host_vst, [&](auto& message) { message << value; });
|
||||
}
|
||||
|
||||
void Vst3Logger::log_response(bool is_host_vst, const Ack&) {
|
||||
log_response_base(is_host_vst, [&](auto& message) { message << "ACK"; });
|
||||
}
|
||||
|
||||
@@ -72,10 +72,12 @@ class Vst3Logger {
|
||||
void log_request(bool is_host_vst, const YaComponent::GetBusArrangement&);
|
||||
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 YaPluginFactory::Construct&);
|
||||
void log_request(bool is_host_vst, const YaPluginFactory::SetHostContext&);
|
||||
void log_request(bool is_host_vst, const WantsConfiguration&);
|
||||
|
||||
void log_response(bool is_host_vst, const uint32&);
|
||||
void log_response(bool is_host_vst, const Ack&);
|
||||
void log_response(
|
||||
bool is_host_vst,
|
||||
|
||||
@@ -72,6 +72,7 @@ using ControlRequest = std::variant<YaComponent::Construct,
|
||||
YaComponent::SetBusArrangements,
|
||||
YaComponent::GetBusArrangement,
|
||||
YaComponent::CanProcessSampleSize,
|
||||
YaComponent::GetLatencySamples,
|
||||
YaPluginFactory::Construct,
|
||||
YaPluginFactory::SetHostContext>;
|
||||
|
||||
|
||||
@@ -522,6 +522,23 @@ class YaComponent : public Steinberg::Vst::IComponent,
|
||||
|
||||
virtual tresult PLUGIN_API
|
||||
canProcessSampleSize(int32 symbolicSampleSize) override = 0;
|
||||
|
||||
/**
|
||||
* Message to pass through a call to
|
||||
* `IAudioProcessor::getLatencySamples()` to the Wine
|
||||
* plugin host.
|
||||
*/
|
||||
struct GetLatencySamples {
|
||||
using Response = PrimitiveWrapper<uint32>;
|
||||
|
||||
native_size_t instance_id;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(instance_id);
|
||||
}
|
||||
};
|
||||
|
||||
virtual uint32 PLUGIN_API getLatencySamples() override = 0;
|
||||
virtual tresult PLUGIN_API
|
||||
setupProcessing(Steinberg::Vst::ProcessSetup& setup) override = 0;
|
||||
|
||||
@@ -201,9 +201,8 @@ YaComponentPluginImpl::canProcessSampleSize(int32 symbolicSampleSize) {
|
||||
}
|
||||
|
||||
uint32 PLUGIN_API YaComponentPluginImpl::getLatencySamples() {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO: IAudioProcessor::getLatencySamples()");
|
||||
return 0;
|
||||
return bridge.send_message(
|
||||
YaComponent::GetLatencySamples{.instance_id = arguments.instance_id});
|
||||
}
|
||||
|
||||
tresult PLUGIN_API
|
||||
|
||||
@@ -190,6 +190,11 @@ void Vst3Bridge::run() {
|
||||
.audio_processor->canProcessSampleSize(
|
||||
request.symbolic_sample_size);
|
||||
},
|
||||
[&](YaComponent::GetLatencySamples& request)
|
||||
-> YaComponent::GetLatencySamples::Response {
|
||||
return component_instances[request.instance_id]
|
||||
.audio_processor->getLatencySamples();
|
||||
},
|
||||
[&](const YaPluginFactory::Construct&)
|
||||
-> YaPluginFactory::Construct::Response {
|
||||
return YaPluginFactory::ConstructArgs(
|
||||
|
||||
Reference in New Issue
Block a user