From 3b49c9ecc0acebc6c29e4ba3ee06a51d68c7ae36 Mon Sep 17 00:00:00 2001 From: zsliu98 Date: Thu, 21 Nov 2024 09:30:58 -0500 Subject: [PATCH] m --- source/PluginProcessor.cpp | 1 + source/PluginProcessor.h | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/PluginProcessor.cpp b/source/PluginProcessor.cpp index 0d2e27b..31e8287 100644 --- a/source/PluginProcessor.cpp +++ b/source/PluginProcessor.cpp @@ -76,6 +76,7 @@ void PluginProcessor::prepareToPlay(double sampleRate, int samplesPerBlock) { // Use this method as the place to do any pre-playback // initialisation that you need.. juce::ignoreUnused(sampleRate, samplesPerBlock); + triggerAsyncUpdate(); } void PluginProcessor::releaseResources() { diff --git a/source/PluginProcessor.h b/source/PluginProcessor.h index 02c22f5..673a3ad 100644 --- a/source/PluginProcessor.h +++ b/source/PluginProcessor.h @@ -6,7 +6,7 @@ #include "ipps.h" #endif -class PluginProcessor : public juce::AudioProcessor { +class PluginProcessor : public juce::AudioProcessor , private juce::AsyncUpdater { public: PluginProcessor(); @@ -50,4 +50,8 @@ class PluginProcessor : public juce::AudioProcessor { private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PluginProcessor) + + void handleAsyncUpdate() override { + setLatencySamples(10); + } };