Re: Component from ComponentInstance?
Re: Component from ComponentInstance?
- Subject: Re: Component from ComponentInstance?
- From: kelly jacklin <email@hidden>
- Date: Wed, 26 May 2004 05:53:07 -0700
On May 26, 2004, at 2:29 AM, m wrote:
On May 25, 2004, at 9:48 PM, Greg Chapman wrote:
I guess it is bizarre that I can pass a ComponentInstance to
ComponentManager routines that take a Component. Unfortunately, I
really need a way to get from a ComponentInstance to the Component of
which it is an instance.
I have an array of available AudioUnits (i.e. Components) that I build
at launch time. The user can choose which AudioUnit is instantiated by
choosing from this array.
Since I'd like not to re-instantiate an already instantiated unit, I
need to know the already instantiated unit's Component so I can
compare it to the one chosen by the user.
Actually, I would suggest that your array of available AUs contain the
Component and the ComponentDescription. Perhaps you should even make
it a map (or hashtable) with the key being the ComponentDescription and
the value being the Component. In this way, you can call
GetComponentInfo on your AU instance (passing NULL for all the handle
parameters, since you don't need that info), and you can trivially look
up the Component from your table based on the resulting
ComponentDescription for the AU. Of course, you could do the same with
the array, and a linear (or assisted, like a skip list) search, if the
speed of lookup is not an issue.
BTW, good to see you on this list as well, murat...
kelly
_______________________________________________
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.