Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Warnings and tips for using AUGenericView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Warnings and tips for using AUGenericView




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


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.