Re: AU from scratch
Re: AU from scratch
- Subject: Re: AU from scratch
- From: Scott Ruda <email@hidden>
- Date: Thu, 11 Dec 2003 00:17:51 -0800
On Dec 10, 2003, at 10:00 PM, Marc Poirier
<email@hidden> wrote:
On Wed, 10 Dec 2003, Scott Ruda wrote:
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.
I'm only using the Parameter mechanism because that is apparently the
only way to put custom UI widgets in the GenericAUView. I will
eventually probably implement a true custom view, but I was trying to
get the core rendering code working before I went for the fancy UI
work.
The pseudo-param will only be changed by the widget edit in the
GenericAUView and never in e.g. my Render method. So when I get a
SetParameter call for that parm, I will know that it can only happen
because of a UI edit. I know about the sync issues and have those
covered.
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.
I guess it would be similar to doing a preset change or loading a new
sound bank (but it's neither of those, and those may be implemented
also, so I can't use the built-in GenericUI support for those).
External resources and such have to be loaded and prepped before they
are ready to be used by the render thread. I think I can get all that
to be synced and such without disrupting current sounds, assuming I can
get notification of the UI selection at some point.
Thanks,
Scott
_______________________________________________
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.