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); + } };