Re: AU from scratch
Re: AU from scratch
- Subject: Re: AU from scratch
- From: Scott Ruda <email@hidden>
- Date: Fri, 28 Nov 2003 09:03:25 -0800
On Nov 20, 2003, at 5:17 PM, nick <email@hidden> wrote:
Along the same lines as this thread, has anyone had any luck creating
an AudioUnit from scratch? I mean creating a new PB project etc.. What
type of project does one have to start with?
How to configure the targets... other setting that are required etc..?
I did try by specifying a Carbon Bundle, is this the right thing? I
couldn't see how to make the target a .component as opposed to a
.bundle
The documentation out there seems to ignore this stage
[...]
FWIW:
in ProjectBuilder, New Project, type = Carbon Bundle
then in target setting, "Expert View" change WRAPPER_EXTENSION value
from 'bundle' to 'component'
also need to use an 'Exports file' (under Settings->Linker Settings)
still digging...
I did one from scratch in XCode. That's pretty much what I did. I'm
deriving mine from the MusicDeviceBase class in the AUPublic stuff
supplied in the CoreAudio examples code. You could just use AUBase if
you just want an effect AU. So I added <copies of> the AUPublic and
PublicUtility folders to my project. Also added the AudioToolbox,
AudioUnit, CoreAudio, CoreFoundation and CoreServices Frameworks. I
created a prefix file and added the CAPrefix.h file to it and set that
in the project Build Settings. Added a .exp file with the entry point,
and set that in the project Build Settings. Had to supply about a half
dozen methods of the MusicDeviceBase class to get things hooked up. I
can't remember what else I had to do, if anything. Let me know if you
have problems and I can tell you what settings I have.
I also set the custom exectuable of my AU project to SynthTest as a
host so that I can source debug my AU. I also added a shell script copy
phase to automatically copy my component to my plug-ins folder after a
build.
The only problem I'm having now is trying to get a custom view working.
Currently it only works with the built-in generic view stuff. I didn't
want to use the Airy custom UI stuff because I wanted to stay with the
roots of the Apple supplied stuff (for now). But you might want to look
at the Airy UI kit, as he has added support for loading a custom view
from a nib file, along with support for custom view objects, which is
non-trivial.
One problem I'm having with trying to do a custom view is that if I add
AUResources.r to my resource file I get a 'SyError 0 during open of
AUResources.r. Fatal Error, can't recover.'. (XCode 1.01) I traced
that down to it including something in CoreResources.r file. So I
pulled out the resources I needed from that and the ones needed in
AUResources.r and have everything inline in my own .r file.
As far as getting a custom view happening, I'm currently looking at the
GenericAUView source as a guide. Still no luck on that front yet. I've
got a blank window to pop up, but no widgets.
Yes, a step by step tutorial going from scratch to an AU with a custom
view would be nice. Right now it seems the only way is to dig through
all the example code, including the great work by Airy. As I said, I'm
trying to build mine up from the core of what Apple supplies. The
AUPublic stuff is as far down as I am willing to go, and I don't see
any need to recreate that level and go directly to the C APIs.
-s
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.