Defining multiple custom AU views
Defining multiple custom AU views
- Subject: Defining multiple custom AU views
- From: Ken Schutte <email@hidden>
- Date: Thu, 15 Apr 2010 17:32:51 -0500
Hi,
I'm trying to create multiple views for an Audio Unit. I'm getting
tripped up by the definition of AudioUnitCocoaViewInfo:
typedef struct AudioUnitCocoaViewInfo {
CFURLRef mCocoaAUViewBundleLocation;
CFStringRef mCocoaAUViewClass[1];
} AudioUnitCocoaViewInfo;
Isn't that saying mCocoaAUViewClass is an array of CFStringRef with
length fixed at 1? I see hosts accessing mCocoaAUViewClass[i] (for i
> 0).
I've seen that to get the number of views, hosts should use:
UInt32 numberOfClasses = (dataSize - sizeof(CFURLRef)) / sizeof(CFStringRef);
So, in my GetPropertyInfo, I set OutDataSize to:
sizeof(CFURLRef) + num_views * sizeof(CFStringRef)
In my GetProperty(), for one view, I'm doing something like:
AudioUnitCocoaViewInfo cocoaInfo;
cocoaInfo.mCocoaAUViewBundleLocation = bundleURL;
cocoaInfo.mCocoaAUViewClass[0] =
CFStringCreateWithCString(NULL,
"my_view_factory", kCFStringEncodingUTF8);
*((AudioUnitCocoaViewInfo*) outData) = cocoaInfo;
Maybe I don't understand CFStringRef and how to allocate and
initialize them... Can someone give me a hint here?
Thanks,
Ken
_______________________________________________
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