kAudioUnitProperty_FactoryPresets in AudioUnitSetProperty



I’m getting an error when trying to set the current program on a third-party AU synth. After some investigations, it seems the plugin returns a -10879 error on AudioUnitSetProperty, because kAudioUnitProperty_FactoryPresets is meant for getting data. According to the specs, we should be using kAudioUnitProperty_PresentPreset that replaces the deprecated kAudioUnitProperty_CurrentPreset.

Has anyone faced the same problem on some plugins?




Thanks - yes, it certainly should be using kAudioUnitProperty_PresentPreset there, I’ll get that sorted out!


Just caught and fixed a bug with preset selection in the current modules branch. Selecting a preset crashed all Rob Papen AU plugins, because AudioUnitSetProperty() is passed a null pointer for the preset name. Instead it should be passed an empty string with CFSTR("").

[code]void setCurrentProgram (int newIndex)
AUPreset current;
current.presetNumber = newIndex;
current.presetName = CFSTR("");

    AudioUnitSetProperty (audioUnit,
                          0, &current, sizeof (AUPreset));

The same plugins did not crash in Logic, so the fix is really necessary and not a bug with the plugins.


Ah, great, thanks!