From d08b526930bb01f038770f7ca116f9eb16fca686 Mon Sep 17 00:00:00 2001 From: reuk Date: Tue, 23 Mar 2021 13:00:25 +0000 Subject: [PATCH] AudioProcessor: Fix default behaviour of updateHostDisplay This patch fixes an issue where calling `updateHostDisplay` with no argument would have no effect. --- .../juce_audio_processors/processors/juce_AudioProcessor.h | 4 +++- .../processors/juce_AudioProcessorListener.h | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessor.h b/modules/juce_audio_processors/processors/juce_AudioProcessor.h index 39eac82112..fb7cb3806e 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessor.h +++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.h @@ -78,6 +78,8 @@ public: doublePrecision }; + using ChangeDetails = AudioProcessorListener::ChangeDetails; + //============================================================================== /** Destructor. */ virtual ~AudioProcessor(); @@ -991,7 +993,7 @@ public: It sends a hint to the host that something like the program, number of parameters, etc, has changed, and that it should update itself. */ - void updateHostDisplay (const AudioProcessorListener::ChangeDetails& details = {}); + void updateHostDisplay (const ChangeDetails& details = ChangeDetails::getAllChanged()); //============================================================================== /** Adds a parameter to the AudioProcessor. diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorListener.h b/modules/juce_audio_processors/processors/juce_AudioProcessorListener.h index 9a83d06c83..ad9070dffd 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorListener.h +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorListener.h @@ -69,6 +69,13 @@ public: ChangeDetails withParameterInfoChanged (bool b) const noexcept { return with (&ChangeDetails::parameterInfoChanged, b); } ChangeDetails withProgramChanged (bool b) const noexcept { return with (&ChangeDetails::programChanged, b); } + static ChangeDetails getAllChanged() + { + return ChangeDetails{}.withLatencyChanged (true) + .withParameterInfoChanged (true) + .withProgramChanged (true); + } + private: template ChangeDetails with (Member&& member, Value&& value) const noexcept