Hello
I had asked this already, but apparently the message got lost.
Anyways, sorry if you're reading this a second time.
I have created an Audio unit with an accompanying Cocoa view.
An ordinary audio unit, that we can add to a Logic or MainStage project, mainly consists of two parts - an Audio Unit Kernel and an Audio Unit View, and they are designed to be separate things and "communicate" by changing parameters.
This dynamically generated view (or "Generic" view) is generated by the host application, based on what your audio unit's function returns in its AudioUnitParameterInfo parameter:
OSStatus GetParameterInfo(AudioUnitScope inScope, AudioUnitParameterID inParameterID, AudioUnitParameterInfo &outParameterInfo)
So if you return the following, you'll get a checkbox with the title "Hey there":
AUBase::FillInParameterName (outParameterInfo, CFSTR("Hey there"), false);
outParameterInfo.unit = kAudioUnitParameterUnit_Boolean;
outParameterInfo.minValue = 0;
outParameterInfo.maxValue = 1;
outParameterInfo.defaultValue = 0;
outParameterInfo.flags = kAudioUnitParameterFlag_IsWritable | kAudioUnitParameterFlag_IsReadable;
This was the introduction.
Now back to the question.
I would like to have a Push Button on my autogenerated by the host "Generic View".
And I can't figure out how to do this.
My research showed that this used to be possible by declaring a write only boolean parameter in GetParameterInfo. Here's some links that prove this:
The problem is that when I declare a write only boolean param, no control appears in the Generic view of Logic Pro X or Mainstage 3.
If I declare a read only boolean param, all I see is a disabled control with "< off >" text on it.
If i declare a read-write boolean param, I am getting a check box (the last is the correct behavior)
Apart from the kAudioUnitParameterUnit_Boolean, I have tried other types (kAudioUnitParameterUnit_Indexed, kAudioUnitParameterUnit_Generic), tried setting the "kAudioUnitParameterFlag_IsWritable" and "kAudioUnitParameterFlag_IsReadable" together and separately. To no avail - I can't manage to get a button on the generic view.
So how to get a regular push button on generic view?