Warnings and tips for using AUGenericView
Warnings and tips for using AUGenericView
- Subject: Warnings and tips for using AUGenericView
- From: Christopher Ashworth <email@hidden>
- Date: Thu, 7 Aug 2008 15:38:04 -0400
Below are five things I've learned while adding Audio Unit support to
my application. I'll try to find some time to write these up as
proper tickets on the bug tracker, but in the meantime here are a few
brief tips for others in the hopes they are helpful. To the best of
my knowledge the following are true:
1) AUGenericView leaks memory if it is simply allocated and
initialized. If you create it like so:
[[[AUGenericView alloc] initWithAudioUnit:_unit] autorelease];
and never add it to any view or use it in any way, it will not be
released.
2) The threading bug that leads to a crash when initializing an
AUGenericView for an AU that has many controls, which was originally
described here (and said to be fixed in Leopard):
http://lists.apple.com/archives/Coreaudio-api/2007/Jan/msg00173.html
is not actually fixed in Leopard as of 10.5.4. You must still add in
a usleep after initialization to avoid crashing.
3) AUGenericView does not allow you to set the frame size. Well, it
does, but it does not lay out the controls correctly if you do. If
you want the view to be any size other than the default, you must set
the frame on the animator proxy and let it animate to that new frame.
Also note that the view will not necessarily be its default size when
it is first created. You may need to look at the first several
NSViewFrameDidChangeNotifications to find out when it has been sized
to fit the controls for the AudioUnit.
4) The viewWillMoveToWindow bug that leads to a crash, originally
described here:
http://lists.apple.com/archives/coreaudio-api/2007/Nov/msg00019.html
still exists, so be careful how you manipulate your views.
5) The Cocoa View produced when you query and instantiate the
kAudioUnitProperty_CocoaUI property of an AU may be an AUGenericView.
So don't assume you're safe from AUGenericView because you didn't
explicitly create one.
Hope that helps someone else,
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden