// get name from component
Handle unitNameHandle = NewHandle(256);
nameErr = GetComponentInfo((Component)unit, 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);
}
(except that it doesn't… GetComponentInfo() returns -3000, badComponentId… maybe my code to look up the unit from the node is busted…)
Thanks for the reply.
On Aug 27, 2010, at 10:53 AM, Doug Wyatt wrote:
On Aug 27, 2010, at 7:03 , Chris Adamson wrote:
Anyways, I don't see an equivalent to AudioComponentInstanceGetComponent()… is there a Component Manager function to get the component associated with a component instance? If not, is there some other technique for getting the name of an given audio unit?
I remember being surprised to learn that with the Component Manager you can pass an instance to a function that expects a component.
hth
Doug