commit ca8f83de76bad741286620b5060fedd9ad598a0e
parent 8db6c2f5fe0b42c5bf30f369ea5e62a623bb412b
Author: falkTX <falktx@falktx.com>
Date: Wed, 12 Oct 2022 02:01:44 +0100
Implement/set latency value for VST2
Signed-off-by: falkTX <falktx@falktx.com>
Diffstat:
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/distrho/src/DistrhoPlugin.cpp b/distrho/src/DistrhoPlugin.cpp
@@ -125,7 +125,7 @@ const TimePosition& Plugin::getTimePosition() const noexcept
#endif
#if DISTRHO_PLUGIN_WANT_LATENCY
-void Plugin::setLatency(uint32_t frames) noexcept
+void Plugin::setLatency(const uint32_t frames) noexcept
{
pData->latency = frames;
}
diff --git a/distrho/src/DistrhoPluginVST2.cpp b/distrho/src/DistrhoPluginVST2.cpp
@@ -1212,6 +1212,10 @@ private:
const ParameterRanges& ranges(fPlugin.getParameterRanges(i));
hostCallback(VST_HOST_OPCODE_00, i, 0, nullptr, ranges.getNormalizedValue(curValue));
}
+
+ #if DISTRHO_PLUGIN_WANT_LATENCY
+ fEffect->delay = fPlugin.getLatency();
+ #endif
}
#if DISTRHO_PLUGIN_HAS_UI