Re: Documenation
Re: Documenation
- Subject: Re: Documenation
- From: Marc Poirier <email@hidden>
- Date: Sun, 11 Jan 2004 12:04:10 -0600 (CST)
So far as setting up a project for an AU goes, it's a bundle. The
documentation for whichever IDE you use (CodeWarrior, Project Builder,
Xcode, etc.) explains how to do this for the particular IDE (it's
different for each one). There are only a couple of unique things with
AUs: 1) the bundle wrapper's extension should be .component and 2) the
bundle needs to contain a Resource Manager style resource file with
required Component resource (there's more documentation of this in the
QuickTime docs).
Failing to build an AU can be frustrating, though, I know because the
result is always that the AU simply isn't recognized at all. So you can't
even start trying it out and seeing how it fails, the Component Manager
simply will not recognize it. So it can be tricky at first if you have a
problem like this, but there are a few common gotchas, and hopefully one
of these may help you:
You need a .exp exports file that includes the entry point(s) for your
component, listed one per line and each prefixed with an _ (underscore).
When using the AUBase SDK, there is a convenience macro that you can use
to set up your entry point code called COMPONENT_ENTRY. As an argument to
that macro, you give the class name of your AU*Base derived class. So
if you had:
class PluginThatDoesNotWork : public AUEffectBase {
then in your source code, you would include this once somewhere:
COMPONENT_ENTRY(PluginThatDoesNotWork)
Now you have valid code for a Component entry point. If you look at the
implementation of that macro, you will see that it outputs a prototype and
implementation of a function that is named after the class name with Entry
appended. So if you are using this macro, which is the simplest solution,
then your entry point name would be _PluginThatDoesNotWorkEntry in your
whatever.exp file. For each AU in your Component, you need code for its
entry point and you need that entry point listed in the whatever.exp file.
If your AU has a custom GUI, then that's another AU. And you also can
have more than custom GUI and/or DSP AUs in a single component.
You also, as I said earlier, need a Resource file that has the Component
resource stuff. The simplest way is to use the AUResources.r file
included with the SDK. Unfortunately, this useful file is basically
undocumented, but I wrote an explanation of it that you can read here:
http://www.mat.ucsb.edu:8000/CoreAudio/91
Again, the entry point issue comes up here. Be aware, though, that in the
Component resources, you need to specify the entry point names as strings
and without the _ prepended. So the example that I've been using would be
"PluginThatDoesNotWorkEntry" in your whatever.r file.
With the other resource stuff, you have to make sure that you're using a
valid Component type value (kAudioUnitType_Effect,
kAudioUnitType_MusicEffect, kAudioUnitType_MusicDevice,
kAudioUnitCarbonViewComponentType, etc.) and unique manufacturer and
subtype codes. You need to register your own unique manufacturer code:
http://www.mat.ucsb.edu:8000/CoreAudio/81
and then can use any subtype codes that you want. Just don't reuse
subtype codes for different AUs. If there's a conflict with multiple AUs
that have these same 3 identifying values, the Component Manager will only
make 1 of the AUs available, based on various criteria (prefering higher
version values, prefering user domain over local domain, etc.).
If you're using Project Builder (I don't know about Xcode), another thing
that often causes the compilation of the resource file to fail is bad or
inadequate Rez include paths. Go to Target Settings -> Expert View and
then make sure that OTHER_REZFLAGS is there and that these are include for
that build setting's value:
-I /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase -I /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers
That puts the AUBase SDK stuff and AudioUnit.framework into the include
path for your .r files, so that the Eincluded .r files are found. If you
are #including any of your own files in a .r file that not located in the
same place as the .r file, then you'll need to add those to the Rez
include paths, too.
The last gotcha that I can think of is that sometimes the Component
Manager won't notice a new AU because you built it into the Components
directory and, when the Component Manager first noticed it, it wasn't done
building. I wrote something about this at the CoreAudio swiki:
http://www.mat.ucsb.edu:8000/CoreAudio/79
Also, I just wanted to mention that you can still use Project Builder if
you want in Panther. I do. As long as you upgraded from Jaguar and
didn't fresh install, then you still have PB.
Also, another one of the points I hope I've made clear is that the
CoreAudio swiki is a good thing!
http://www.mat.ucsb.edu:8000/CoreAudio
I hope that one of these tips solves your problems...
Marc
On Sun, 11 Jan 2004, John Mullins wrote:
>
Hey,
>
Ok, I'm not just joking around here anymore. And I don't want
>
some SH** reply like, oh the documentation is so WONDERFUL because I
>
know you probably work for Apple or have some commercial AU already
>
out.
>
>
Well here it is, and I'm just saying it, everyone's thinking it.
>
Your documentation for Audio Units are fuc*ing sh*t. You could at
>
least have some documentation on how to SET UP a project for audio
>
units. Come on. It's not that hard. If I knew how to actually get a
>
blank audio unit working I'd f*cking would write a tutorial. But I
>
can't even get a f*cking audio unit compiled with a project I setup
>
with the exact same settings of another example tutorial with the code
>
completely copied. Oh and yeah, Panthers been out for a while, and all
>
the examples of the audio units use Project Builder and don't even work
>
in Logic because OS X won't recognize it but anything other than a
>
folder even with a reboot, f*cking come on.
>
>
I've been patient and have seen a lot of stuff change, yet you don't
>
even have some sort of starters guide or anything... worthless...
>
worthless... AU's have been out for a while and I don't see very many
>
AU's out at all. It has a lot of potential, but come on people. At
>
least have a skeleton AU out or something.
>
>
I don't expect to pick up the format at start programming mad synth's
>
with no experience, but I've been programming linux and windows for a
>
while without a problem because of nice documentation, but yet... I
>
can't even get or find a simple empty example or tutorial that will
>
compile.
>
>
I'm really sorry if I'm being rude, but... I'm drunk... and I've
>
been trying to get a an audio unit even compiling that's in my own
>
project for off an on a few months, and then XCode comes out and makes
>
it even harder since most stuff used project builder....
>
so nothing personal but PLEAAAASEEE come out with a tutorial ... a
>
TUTORIAL... that just does something simple that generates a sine wave
>
or something, or that changes the volume, that tells you how to set up
>
a project also, because this is driving me CRAZY, and should not be
>
like this. Even if someone has NO programming experience at ALL, they
>
should at least be able to read something that will tell them how to
>
setup a very very simple program (Audio Unit) without any any at all
>
previous knowledge. That's the least you can do. I don't care if you
>
come out with a program that will solve the worlds problems, if no one
>
knows how to even turn it on it's worthless.
_______________________________________________
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.
References: | |
| >Documenation (From: John Mullins <email@hidden>) |