Sources of AirySynth, with custom GUI from .nib file
Sources of AirySynth, with custom GUI from .nib file
- Subject: Sources of AirySynth, with custom GUI from .nib file
- From: Airy André <email@hidden>
- Date: Sun, 20 Oct 2002 17:02:35 +0200
I've put the sources and binaries of latest version of my AirySynth
AUIntrument and its GUI here :
http://airy.andre.online.fr/AU/AirySynth.tgz
It requires MacOS X 10.2.
It does include the CAUCarbonViewNib class, that make building of GUI
much easier (I think), since you can
use InterfaceBuilder for this purpose.
To build a view from a nib file, all you have to do is to make a class
that inherite from CAUCarbonViewNib,
then redefine the "GetBundleID()" method to return the bundle ID of
your component.
For example, the whole code of my AirySynth view is :
class CAirySynthView: public CAUCarbonViewNib
{
public:
// Construction ------------------------------
CAirySynthView (AudioUnitCarbonView inInstance):
CAUCarbonViewNib(inInstance) {};
// Baseclass overrides -----------------------
CFStringRef GetBundleID() { return CFSTR("com.airy.test.AISY"); };
};
and
COMPONENT_ENTRY(CAirySynthView);
COMPONENT_REGISTER(CAirySynthView, 'auvw', 'synt', 'airy');
to register it.
Then, you must have a "window" nib, with a window named "window", with
"compositing" attribute OFF.
This window must be filled with a UserPane having a control ID of {
'AUid', 9999 }.
All the controls must be embeded in this UserPane.
To bind a parameter to a control, just set the control ID of the
control to { 'AUid', x*1000+y }, where
x is any number from 0 to 32, and y the ID of the parameter. So,
several controls can be linked to a single
parameter.
The min and max value are automatically filled with the min and max
value of the matching parameter, so you
are sure that the UI is consistent with the code.
As I said in a previous message, if a parameter has indexed named value
and is not controlled by a Popup, then
the min value must be one.
I've tested the following kind of control :
- sliders
- popup
- radio group
- text
Custom controls should also work.
If you use custom controls, you can overide the "InitWindow(CFBundleRef
sBundle)" method, and register your
control classes here.
Also enclosed is a custom control that should be able to display a PNG
file from the bundle, the name of file being
the title of the control.
It does find the file, but display nothing. If anybody has an idea, he
will be very welcome.
All this code reflect what I've understood of how to code a AU and an
AU View. So, it's probably not what should be done.
It does also borrow code from SDK and Apple Sample Code.
As usual, feel free to comment, correct, enhance and use...
Airy
_______________________________________________
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.