• 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: Button event notification from a Cocoa view to Audio Unit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Button event notification from a Cocoa view to Audio Unit


  • Subject: Re: Button event notification from a Cocoa view to Audio Unit
  • From: Nick <email@hidden>
  • Date: Fri, 16 Jan 2015 05:04:54 +0200

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;

instead of writable, I am getting a weird control, which is not a button (here's its screenshot from Logic: http://rghost.net/60374972/image.png)

So how can I get a normal button on the Controls section of my audio unit's view?

I took the idea here:
http://lists.apple.com/archives/coreaudio-api/2005/May/msg00133.html

But apparently it's not working, or i did something wrong.
Can you give me a hint what am i doing wrong?
Thank you!

2015-01-14 6:38 GMT+02:00 Numosh <email@hidden>:
Hi Nick, as far as I know, you can place a button that refer to start an action sequence that would be process by the AU, such as a midi note, audio file, etc, the AU itself can be listed as an audio processing output, so its listed as an option.

Hope it can help, sorry if its not been a good explanation.

Sent from my iPhone

On Jan 14, 2015, at 09:56, Nick <email@hidden> wrote:

I was also wondering how to make a push button in Controls view on the audio unit (all i could get is a checkbox)

2015-01-14 1:55 GMT+02:00 Nick <email@hidden>:
The question is related to communication between an "AU kernel" and a Cocoa View, that accompanies it.

https://developer.apple.com/library/mac/documentation/MusicAudio/Conceptual/AudioUnitProgrammingGuide/TheAudioUnitView/TheAudioUnitView.html

2015-01-14 0:53 GMT+02:00 Matt Hart <email@hidden>:
AudioUnits don't have views.

> Hi,
> Sorry for a stupid question, but I can't figure out how to let Audio Unit know that a button has been clicked in its view?
> I have an audio unit and a separate bundle which contains a Cocoa view and a view controller.
> What is the right way to notify the audio unit that a button was pressed?
> Thank you!
> _______________________________________________
> 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: 
 >Button event notification from a Cocoa view to Audio Unit (From: Nick <email@hidden>)
 >Re: Button event notification from a Cocoa view to Audio Unit (From: Matt Hart <email@hidden>)
 >Re: Button event notification from a Cocoa view to Audio Unit (From: Nick <email@hidden>)
 >Re: Button event notification from a Cocoa view to Audio Unit (From: Nick <email@hidden>)
 >Re: Button event notification from a Cocoa view to Audio Unit (From: Numosh <email@hidden>)

  • Prev by Date: Re: AudioUnit - notify on hosts beat and bar changes
  • Next by Date: AudioUnit View Resizing by User Dragging
  • Previous by thread: Re: Button event notification from a Cocoa view to Audio Unit
  • Next by thread: AudioUnit - notify on hosts beat and bar changes
  • Index(es):
    • Date
    • Thread