• 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
Re: 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]

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: Nick <email@hidden>
  • Date: Thu, 22 Jan 2015 17:42:37 +0200

An update: I tried removing a Cocoa view from my audio unit, by returning 

if(inID == kAudioUnitProperty_CocoaUI) {

                outDataSize = 0;

                outWritable = false;

                return noErr;
}

in GetPropertyInfo.

Now I got the "generic view" (which is not what i thought it was) and a button on it!. Actually a generic view - is an auto generated cocoa view, but not the "dark" one (the "dark" view is called "Controls view"?). This is what the auto generated generic view looks like:

http://higgs.rghost.net/60495610/image.png

Nevertheless the "dark" auto generated Controls view still doesn't have this button on it:
http://tau.rghost.net/60495630/image.png

But the Arpeggiator AU's "dark controls view" has buttons (http://rghost.net/60473354/image.png). The question is how did they put them there? :)



2015-01-21 13:50 GMT+02:00 Nick <email@hidden>:
On the other hand, there's a MIDI Arpeggiator MIDI FX Audio Unit, whose Generic View has buttons on it (http://rghost.net/60473354/image.png). So it is possible to add a button, just not documented?...

2015-01-19 20:13 GMT+02:00 Nick <email@hidden>:
Hi Christian,
Thank you for the response.
Yes i tried setting Mix and Max to the same value, which always resulted in the control not displaying at all on the generic view.
I also tried using |=, and i have just tried setting kAudioUnitParameterFlag_HasCFNameString and
kAudioUnitParameterFlag_ValuesHaveStrings. 
Still nothing.

Apparently Apple just "broke" this option for us in the latest MainStage and Logic.
I also checked various audio units, that come with Logic Pro, and none of them had a button on their generic view.


2015-01-19 18:50 GMT+02:00 Christian Rober <email@hidden>:
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

References: 
 >AudioUnit View - write only boolean parameter doesn't appear as a Push Button (From: Nick <email@hidden>)
 >Re: AudioUnit View - write only boolean parameter doesn't appear as a Push Button (From: Christian Rober <email@hidden>)
 >Re: AudioUnit View - write only boolean parameter doesn't appear as a Push Button (From: Nick <email@hidden>)
 >Re: AudioUnit View - write only boolean parameter doesn't appear as a Push Button (From: Nick <email@hidden>)

  • Prev by Date: Aggregate device options
  • Next by Date: Fwd: Audio server plugin: WriteToStorage, where are the data actually stored?
  • Previous by thread: Re: AudioUnit View - write only boolean parameter doesn't appear as a Push Button
  • Next by thread: iOS8: AudioOutputUnitStart() always fails after rejecting a phone call
  • Index(es):
    • Date
    • Thread