• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
AudioUnit View - write only boolean parameter doesn't appear as a Push Button
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AudioUnit View - write only boolean parameter doesn't appear as a Push Button


  • Subject: AudioUnit View - write only boolean parameter doesn't appear as a Push Button
  • From: Nick <email@hidden>
  • Date: Mon, 19 Jan 2015 09:05:01 +0200

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

  • Follow-Ups:
    • Re: AudioUnit View - write only boolean parameter doesn't appear as a Push Button
      • From: Christian Rober <email@hidden>
  • Prev by Date: Using HostTime.h and breakpoints
  • Next by Date: Re: AudioUnit View - write only boolean parameter doesn't appear as a Push Button
  • Previous by thread: Using HostTime.h and breakpoints
  • Next by thread: Re: AudioUnit View - write only boolean parameter doesn't appear as a Push Button
  • Index(es):
    • Date
    • Thread