I got a problem trying to load MDA plugins in my application:
I recover the list of plugins from XML[/]
Instantiate the plugin[/]
Try to create a default editor window[/][/list]
And then I get a crash inside apple’s methods. When googling it, I found someone who got the exact problem and stack (and who is apparently on this forum as well): http://web.archiveorange.com/archive/v/q7bubyotq80HVdIPTLW0
I confirmed that, when first loading another AU plugin, like Apple’s Filters, or just rescanning all my plugins (which will in turn try to initialize those Apple Audio Units), creating a default window for this MDA plugin then works.
This sounded like a Dynamic Loading issue to me, so I tried to use NSBundle class methods to see the difference between before and after loading the Apple plugin:
> "NSBundle </System/Library/ColorPickers/NSColorPickerPageableNameList.colorPicker> (not yet loaded)", > "NSBundle </System/Library/ColorPickers/NSColorPickerSliders.colorPicker> (not yet loaded)", > "NSBundle </System/Library/Components/CoreAudio.component/Contents/Resources/CoreAudioAUUI.bundle> (loaded)", > "NSBundle </System/Library/ColorPickers/NSColorPickerCrayon.colorPicker> (not yet loaded)", > "NSBundle </System/Library/ColorPickers/NSColorPickerWheel.colorPicker> (not yet loaded)", > "NSBundle </System/Library/ColorPickers/NSColorPickerUser.colorPicker> (not yet loaded)"
Apparently, the only difference is CoreAudio. But unfortunately, calling
[[NSBundle bundleWithPath:@"/System/Library/Components/CoreAudio.component/Contents/Resources/CoreAudioAUUI.bundle"] load];
before creating the other plugin doesn’t seem to solve the issue…