• 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: Getting name of an Audio Unit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting name of an Audio Unit


  • Subject: Re: Getting name of an Audio Unit
  • From: Chris Adamson <email@hidden>
  • Date: Fri, 27 Aug 2010 13:16:22 -0400

On second thought, never mind. Since I have an AUGraph, I can get the ComponentDescription from the AUNode, make a new Component from that, and I'm off and running.

ComponentDescription *nodeDesc = malloc (sizeof (ComponentDescription));
nameErr = AUGraphNodeInfo(graph, *node, nodeDesc, NULL);
Component comp = FindNextComponent(NULL, nodeDesc);
// get name from component
Handle unitNameHandle = NewHandle(256);
nameErr = GetComponentInfo(comp, NULL, unitNameHandle, NULL, NULL);
NSString *unitName = @"Unknown";
if (nameErr == noErr) {
unitName = (NSString*) CFStringCreateWithPascalString (kCFAllocatorDefault,
(unsigned char *) *unitNameHandle,
kCFStringEncodingUTF8);
NSLog (@"got name %@", unitName);
} else {
NSLog (@"error getting unit name %d", nameErr);
}


This approach works… don't know if repeatedly finding the component is unduly expensive, though.

--Chris

On Aug 27, 2010, at 12:48 PM, Chris Adamson wrote:

(except that it doesn't… GetComponentInfo() returns -3000, badComponentId… maybe my code to look up the unit from the node is busted…)

 _______________________________________________
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

  • Follow-Ups:
    • Re: Getting name of an Audio Unit
      • From: William Stewart <email@hidden>
    • GUI update
      • From: Patrick Muringer <email@hidden>
References: 
 >Getting name of an Audio Unit (From: Chris Adamson <email@hidden>)
 >Re: Getting name of an Audio Unit (From: Doug Wyatt <email@hidden>)
 >Re: Getting name of an Audio Unit (From: Chris Adamson <email@hidden>)

  • Prev by Date: Re: Getting name of an Audio Unit
  • Next by Date: iphone ExtAudioFileWriteAsync ending at a defined lenght
  • Previous by thread: Re: Getting name of an Audio Unit
  • Next by thread: GUI update
  • Index(es):
    • Date
    • Thread