1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

AudioProcessor: Fix default behaviour of updateHostDisplay

This patch fixes an issue where calling `updateHostDisplay` with no
argument would have no effect.
This commit is contained in:
reuk 2021-03-23 13:00:25 +00:00
parent 0f6f2728f2
commit d08b526930
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11
2 changed files with 10 additions and 1 deletions

View file

@ -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.

View file

@ -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 <typename Member, typename Value>
ChangeDetails with (Member&& member, Value&& value) const noexcept