• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Component from ComponentInstance?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Component from ComponentInstance?
      • From: kelly jacklin <email@hidden>
References: 
 >Re: Component from ComponentInstance? (From: Greg Chapman <email@hidden>)
 >Re: Component from ComponentInstance? (From: m <email@hidden>)
 >Re: Component from ComponentInstance? (From: kelly jacklin <email@hidden>)

  • Prev by Date: Re: PowerPC optional instructions
  • Next by Date: Re: Compiler errors in sample code
  • Previous by thread: Re: Component from ComponentInstance?
  • Next by thread: Re: Component from ComponentInstance?
  • Index(es):
    • Date
    • Thread