Re: AUValidation
Re: AUValidation
- Subject: Re: AUValidation
- From: William Stewart <email@hidden>
- Date: Thu, 8 Jan 2004 17:29:28 -0800
Trying to be helpful here.
In the SampleAU in the CA SDK, the parameter values are:
(1) Default values are established in the constructor - this creates an
entry in the parameter vectors (maps) in the AUElement objects that are
created for your AU - as well as setting the default value of course.
(2) The GetParameter calls can thus retrieve the parameter value
without requiring any additional code (ie. I don't have to initialize
your AU to either Get or Set a parameter value, and the parameter value
will of course be unaffected by whether the AU is initialized or not)
(3) In the render call, all you have to do is get the parameter's value
to know what to do with it. (We also added an option to store
parameters as indexes rather than keys for efficiency) - take a look
through AUElement.cpp
(4) We also of course are able to provide information about parameters
without the AU being initialized...
Now, this is not workable for some parameters/AU's (For example, read
only parameters for levels say may be dependent on the exact format of
the audio being processed, which you don't know about until you are
initialized). The Matrix Mixer as one other example can't deal with
volume parameters until it is initialized because the initialization is
the place where the size of the matrix is decided (it also won't retain
parameter values across initialization) - but it signals this by
REFUSING to accept a SetParameter call if it is NOT initialized.
Hope I aren't confusing the issue, but the parameter mechanism that is
provided in our base classes is both flexible and powerful and suitable
for the vast majority of situations. Given that if that is used, the
fact that all of the save/restore code *just works* is in itself I
think a good reason to use this...
Bill
On 30/12/2003, at 10:43 AM, stiwi kirch wrote:
Begin forwarded message:
From: stiwi kirch <email@hidden>
Date: 30. Dezember 2003 19:09:44 MEZ
To: Marc Poirier <email@hidden>
Subject: Re: AUValidation
On 30.12.2003, at 19:15, Marc Poirier wrote:
Well, no host can possibly call Filter::reset(). It is more a string
of
calls that leads to that, from your own code. What the crash log was
showing was that the host was setting the ClassInfo property, which
leads
to a call (via the AUBase SDK) to RestoreState(), and from there you
were
making calls to SetParameter(), and in there you made a call to
Filter::reset(). So the mistake was assuming that calls to
SetParameter()
or RestoreState() would not occur unless the AU was Initialized.
Initialization is only intended to prepare resources needed for DSP
rendering, not for preparing the AU for general property and
parameter
setting and getting. The AU should be prepared for that stuff
whether
Initialized or not.
That's exactly what i meant, but you are right. Thats the correct
analysis.
Well... don't change parameter values during Initialize(). ;)
Without
knowing what exactly you are doing in your Initialize()
implementation,
it's hard to say much more than that.
At some point after my VCO, VCF, VCA,LFO, etc. inits, which are done
in Initialize(), i need to set up my default parameter values
for (int i = 0; i < kNumberOfParameters; i++)
SetParameter(i, kAudioUnitScope_Global, 0,
sParameterInfo[i].defaultValue, 0);
Right now this is done as last step in Initialize() and has to be
changed. I know that now.
stiwi
_______________________________________________
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.
--
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
________________________________________________________________________
__
_______________________________________________
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.