Re: Component from ComponentInstance?
Re: Component from ComponentInstance?
- Subject: Re: Component from ComponentInstance?
- From: m <email@hidden>
- Date: Wed, 26 May 2004 12:55:58 -0700
On May 26, 2004, at 5:53 AM, kelly jacklin 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.
I had considered that, in fact my list already contains the Components
and they're descriptions. I'm concerned that perhaps
ComponentDescriptions aren't guaranteed to be unique from Component to
Component. For intstance, the user may have two versions of an AU
installed, and the AU vendor might not have been as scrupulous as one
might like in updating the version flags. Perhaps I'm worrying about
this too much, but NI used to be fairly cavalier about the 'vers'
resource in the past.
BTW, good to see you on this list as well, murat...
Heh, heh, should have expected to run into you here :)
_murat
_______________________________________________
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.