mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-16 16:33:55 +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,
|
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,
|
||||||
@@ -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&) {
|
void Vst3Logger::log_response(bool is_host_vst, const Ack&) {
|
||||||
log_response_base(is_host_vst, [&](auto& message) { message << "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::GetBusArrangement&);
|
||||||
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 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&);
|
||||||
|
|
||||||
|
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, const Ack&);
|
||||||
void log_response(
|
void log_response(
|
||||||
bool is_host_vst,
|
bool is_host_vst,
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ using ControlRequest = std::variant<YaComponent::Construct,
|
|||||||
YaComponent::SetBusArrangements,
|
YaComponent::SetBusArrangements,
|
||||||
YaComponent::GetBusArrangement,
|
YaComponent::GetBusArrangement,
|
||||||
YaComponent::CanProcessSampleSize,
|
YaComponent::CanProcessSampleSize,
|
||||||
|
YaComponent::GetLatencySamples,
|
||||||
YaPluginFactory::Construct,
|
YaPluginFactory::Construct,
|
||||||
YaPluginFactory::SetHostContext>;
|
YaPluginFactory::SetHostContext>;
|
||||||
|
|
||||||
|
|||||||
@@ -522,6 +522,23 @@ class YaComponent : public Steinberg::Vst::IComponent,
|
|||||||
|
|
||||||
virtual tresult PLUGIN_API
|
virtual tresult PLUGIN_API
|
||||||
canProcessSampleSize(int32 symbolicSampleSize) override = 0;
|
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 uint32 PLUGIN_API getLatencySamples() override = 0;
|
||||||
virtual tresult PLUGIN_API
|
virtual tresult PLUGIN_API
|
||||||
setupProcessing(Steinberg::Vst::ProcessSetup& setup) override = 0;
|
setupProcessing(Steinberg::Vst::ProcessSetup& setup) override = 0;
|
||||||
|
|||||||
@@ -201,9 +201,8 @@ YaComponentPluginImpl::canProcessSampleSize(int32 symbolicSampleSize) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32 PLUGIN_API YaComponentPluginImpl::getLatencySamples() {
|
uint32 PLUGIN_API YaComponentPluginImpl::getLatencySamples() {
|
||||||
// TODO: Implement
|
return bridge.send_message(
|
||||||
bridge.logger.log("TODO: IAudioProcessor::getLatencySamples()");
|
YaComponent::GetLatencySamples{.instance_id = arguments.instance_id});
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tresult PLUGIN_API
|
tresult PLUGIN_API
|
||||||
|
|||||||
@@ -190,6 +190,11 @@ void Vst3Bridge::run() {
|
|||||||
.audio_processor->canProcessSampleSize(
|
.audio_processor->canProcessSampleSize(
|
||||||
request.symbolic_sample_size);
|
request.symbolic_sample_size);
|
||||||
},
|
},
|
||||||
|
[&](YaComponent::GetLatencySamples& request)
|
||||||
|
-> YaComponent::GetLatencySamples::Response {
|
||||||
|
return component_instances[request.instance_id]
|
||||||
|
.audio_processor->getLatencySamples();
|
||||||
|
},
|
||||||
[&](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