Re: AU from scratch
Re: AU from scratch
- Subject: Re: AU from scratch
- From: Marc Poirier <email@hidden>
- Date: Thu, 11 Dec 2003 00:06:28 -0600 (CST)
On Wed, 10 Dec 2003, Scott Ruda wrote:
>
On Dec 10, 2003, at 12:24 PM, William Stewart wrote:
>
>
>> OK, I must be missing something then. How do I respond to a selection
>
>> in a popup menu or a button push? Some of the example code I've seen
>
>> handles it in SetParameter. What is the right way?
>
>
>
> If you need to respond to this when the SetParameter call is made,
>
> then yes, you'd need to overwrite this method.
>
>
>
> However, we will typically not respond directly to SetParameter calls,
>
> but rather when asked to Render get the current values of the
>
> parameters and use those values in the render call.
>
>
>
> Parameters are not designed or intended to be used to signify to the
>
> AU major state changes (these are down with Property calls)
>
>
I have a setting in a MusicDevice AU that is relatively heavyweight to
>
change (rebuilding tables and such) that I don't think should be
>
handled in the Render call. The recalculated table values will
>
eventually be picked up by the Render call, but I think it would be
>
better to rebuild the tables in a way that doesn't hold off current
>
rendering.
Since parameter setting can (and often does) occur in the audio render
thread, it's really not any different whether you handle the change during
Render() or during SetParameter(). Basically, it sounds like you
shouldn't handle it from either. But if it affects the rendering, and if
it can be changed dynamically (however that may be, custom property or
parameter), then you will need to find some way to synchronize things if
the work is delegated to a non-rendering thread.
The easiest solution would be to defer reacting to changes until your AU
is Uninitialized and then Initialized again. But this is probably not
desirable.
If you want any more ideas, it would be useful to know more specifically
what is heavyweight about this change and what effect it has on your
instrument.
Marc
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.