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

AUv3 Client: Notify host when updating current program

This commit is contained in:
reuk 2021-08-03 18:27:23 +01:00
parent 087cda7e1f
commit 334bd2a926

View file

@ -934,14 +934,39 @@ public:
}
#endif
struct ScopedKeyChange
{
ScopedKeyChange (AUAudioUnit* a, NSString* k)
: au (a), key (k)
{
[au willChangeValueForKey: key];
}
~ScopedKeyChange()
{
[au didChangeValueForKey: key];
}
AUAudioUnit* au;
NSString* key;
};
//==============================================================================
void audioProcessorChanged (AudioProcessor* processor, const ChangeDetails&) override
void audioProcessorChanged (AudioProcessor* processor, const ChangeDetails& details) override
{
ignoreUnused (processor);
[au willChangeValueForKey: @"allParameterValues"];
addPresets();
[au didChangeValueForKey: @"allParameterValues"];
if (! details.programChanged)
return;
{
ScopedKeyChange scope (au, @"allParameterValues");
addPresets();
}
{
ScopedKeyChange scope (au, @"currentPreset");
}
}
void audioProcessorParameterChanged (AudioProcessor*, int idx, float newValue) override