Let me rephrase my question :)
Basically I want to have a simple push button on an AudioUnit's view. So I created a Cocoa view, placed an NSButton on it, put the view in a bundle, and returning its factory when the host requests the kAudioUnitProperty_CocoaUI property. So far so good - The Audio unit loads, the view displays.
In my AudioUnit's GetParameterInfo, I am returning the following for my button:
case kMyButtonAction:
AUBase::FillInParameterName (outParameterInfo, CFSTR("My Button"), false);
outParameterInfo.unit = kAudioUnitParameterUnit_Boolean;
outParameterInfo.minValue = 0;
outParameterInfo.maxValue = 1;
outParameterInfo.defaultValue = 0;
outParameterInfo.flags = kAudioUnitParameterFlag_IsWritable;
break;
Which means the button is basically defined as a write-only parameter.
So on every AudioUnit's view there are two sections - Controls and MyAudioUnitName. You can check :).
The MyAudioUnitName section just displays a cocoa view the way i designed it in Interface Builder. The Controls section, howevcer, shows its own controls that the AU host created dynamically, based on parameters I return in GetParameterInfo. And I would like to get a button there as well as on the MyAudioUnitName section. But instead a button simply doesn't show there. When i change the flags to
outParameterInfo.flags = kAudioUnitParameterFlag_IsReadable;
So how can I get a normal button on the Controls section of my audio unit's view?
I took the idea here:
But apparently it's not working, or i did something wrong.
Can you give me a hint what am i doing wrong?
Thank you!