Re: AudioUnit View - write only boolean parameter doesn't appear as a Push Button
Re: AudioUnit View - write only boolean parameter doesn't appear as a Push Button
- Subject: Re: AudioUnit View - write only boolean parameter doesn't appear as a Push Button
- From: Christian Rober <email@hidden>
- Date: Mon, 19 Jan 2015 11:50:12 -0500
These are just a few shots in the dark:
1. Have you tried setting the max value to the same thing as the min
and the default? I only suggest this because of Mr. Stewart's
comment, in the linked post, about state-less parameters (i.e.
booleans with write-only flag) being perceived by the generic view as
a button. Maybe the host checks the min vs. the max and when it sees
a difference between the two it decides the user needs a state-ful
control.
2. Have you tried different combinations of
kAudioUnitParameterFlag_HasCFNameString and
kAudioUnitParameterFlag_ValuesHaveStrings? Maybe the view is trying
to create a button, but is expecting one or both of those flags to be
set. Since it doesn't see them, it might just create an empty button,
or skip creating a button altogether. You may be clobbering those
string flags when you set it to writable. You may just need to set
the writable flag using " |= " instead of " = ".
--Christian
On Mon, Jan 19, 2015 at 2:05 AM, Nick <email@hidden> wrote:
> 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.
>
> The Audio Unit view can be presented by the host (by Logic Pro X, for
> example) either as a nicely drawn cocoa view
> (http://rghost.net/60432973/image.png), which is an NSView from a xib,
> loaded from the AudioUnit's bundle, or you can select in a drop-down menu
> the "Controls" option (http://rghost.net/60432978/image.png) and get an
> ascetic dynamically generated view (http://rghost.net/60432987/image.png).
> 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:
>
> http://lists.apple.com/archives/coreaudio-api/2005/Jun/msg00023.html
> http://lists.apple.com/archives/coreaudio-api/2005/May/msg00280.html
> http://lists.apple.com/archives/coreaudio-api/2005/Jul/msg00032.html
>
> 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?
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden