Re: Multichannel configs etc.
Re: Multichannel configs etc.
- Subject: Re: Multichannel configs etc.
- From: "Michael Kleps [reFX]" <email@hidden>
- Date: Tue, 16 Nov 2004 13:00:42 +0100
OK. Now only THREE questions arise:
1) How do I detected how many buses have been created/are supported by
the host? Is there a function I can call in Render (or elsewhere) to
detect it? Please name it.
You can always know the bus count - its the number of elements on a
given
scope (input/output)
So I have to call "GetElements()"? Where is the safest spot to call it?
Can I call it in Render() safely?
2) I understand that Render() is called for each bus seperatly. How do
I detect for which bus the current Render() call is? Which function
should I call to find out?
RenderBus in the AU base classes tells you - the caller of Render
tells the
AU which bus its rendering for - and this is propogated down to the
AU's
internal rendering code...
Now I am even more confused. I've implemented the ::Render() call. Is
this function called ONCE for all buses or once for each bus. If the
later, how do I get the bus-number this call is for? It's not passed as
a call parameter (parameters passed are flags, timestamp, frames). Can
I read some BaseClass member directly or is there a function I missed?
3) Since I have a VST-style instrument beneath the AU functions (it's
a
small wrapper), I can't support real rendering of seperate output
buses, hence I plan to render all outputs into internal buffers when
the timestamp changes and copy the buffer into the AUs output buffer
when Render() is called with an identical timestamp. Is this a
sensible
approach and how do I find out the timestamp (sample-position would be
nice) for the current Render() call?
This brings up an interesting suggestion... You are basically doing
ALL of
the work that you need to do in order to support the dynamic output
logic.
Instead of publishing a static configuration of buses, why don't you
publish
your AU's outputs as dynamic?
For instance, you can do up to 16 channels. So your
SupportedNumChannels is
published as { 0, -16 } (BTW, that's ALL you need to publish!)
Then the host will go and configure some number of combinations of
buses and
channels (your AU doesn't really care!!!) as long as that total channel
count is <= 16
I would love to do that, but when I publish { 0, -8 } I get a complaint
from the validation tool that my channel configuration is different
than the default { 0, 2 } and nobody can answer me how to override that
default. Is the BaseClass calling some function to validate the
configuration and I simply forgot to implement it or perhaps I return
the wrong value?
We've an example of this style of AU Synth if anyone wants to look at
the
code for this - send me an email and I'll post it off to you.
Please send all relevant examples to me :)
Cheers,
Mike
_______________________________________________
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