• 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: Detecting preset parameter changes in Audio Units
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting preset parameter changes in Audio Units


  • Subject: Re: Detecting preset parameter changes in Audio Units
  • From: William Stewart <email@hidden>
  • Date: Fri, 30 Mar 2007 12:29:59 -0700

Just for the record - Frank and I went through this off line; there was some misunderstand about the question being asked.

The host sets a preset on your AU using the ClassInfo property - in AUBase.cpp that vectors down to RestoreState, which is a virtual C++ method. Our normal pattern of usage when we need to overide this is:

RestoreState (..)
OSStatus result = AUBase:: RestoreState(...)
if (result) return result;

// if you get here, the preset should be basically ok
restore your custom settings

We use the same mechanism to add custom settings to the preset - overide SaveState

Bill

On 30/03/2007, at 4:34 AM, Frank Schoep wrote:

On Mar 30, 2007, at 2:18 AM, William Stewart wrote:
The hots is at fault - after setting a preset it is responsible for issuing parameter change notifications. The code in AUHosting (/Developer/Examples/CoreAudio) shows you how to do this.

Maybe I'm interpreting this wrong, but does this mean that both AU Lab and Garageband and possibly other hosts are at fault and not my Audio Unit? How can I work around this problem given that such high profile hosts (with generic views) don't follow conventions?


To clarify: I need to detect user-initiated preset changes in the host application from within my Audio Unit to be able to reset my Audio Unit's parameter names.

I tried to override SetProperty in my Audio Unit, but I can't intercept any kAudioUnitProperty_PresentPreset changes from the host that way, I only get one call to SetProperty (inID == 21) when first initializing the Audio Unit.

I looked into the API a bit more and it seems that AUBase::AddPropertyListener() might be the next best thing to try, but I can't figure out which parameters to supply as "inProc" and "inProcRefCon" and associated structures make my head spin.

Are there any examples of working code showing AudioUnitPropertyListenerProc and the like? I'm sure that callback functions are standard practice in (Obj-) C, but coming from a Java background I'm feeling lost here.

Thanks for reading.

Sincerely,

Frank


(This one sent to the list.)

_______________________________________________
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

--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________ __
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________ __


_______________________________________________
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: 
 >Detecting preset parameter changes in Audio Units (From: Frank Schoep <email@hidden>)
 >Re: Detecting preset parameter changes in Audio Units (From: William Stewart <email@hidden>)
 >Re: Detecting preset parameter changes in Audio Units (From: Frank Schoep <email@hidden>)

  • Prev by Date: Re: TLC suggestions for large matrix mixers?
  • Next by Date: Re: 192000 Hz won't render
  • Previous by thread: Re: Detecting preset parameter changes in Audio Units
  • Next by thread: TLC suggestions for large matrix mixers?
  • Index(es):
    • Date
    • Thread