Re: Resource contexts and AUCarbonView
Re: Resource contexts and AUCarbonView
- Subject: Re: Resource contexts and AUCarbonView
- From: Urs Heckmann <email@hidden>
- Date: Wed, 13 Nov 2002 15:47:25 +0100
Hi Angus,
nice to see you here :-)
first of all, you have to give your component a name. In PB, this is in
Targets->Info.plist Entries->Basic Information->Identifier where you
put something like this: com.MyCorp.test.myPluggy
In your code, you can for instance load pngs like this:
static CGImageRef GetTestImage()
{
CFBundleRef bundleRef =
CFBundleGetBundleWithIdentifier(CFSTR("com.MyCorp.test.myPluggy"));
CGDataProviderRef provider;
CGImageRef image = NULL;
if ( bundleRef )
{
CFStringRef fileName = ::CFStringCreateWithCString( NULL, "test.png",
kCFStringEncodingASCII );
if ( fileName != NULL )
{
CFURLRef url = ::CFBundleCopyResourceURL( bundleRef, fileName, NULL,
NULL );
provider = CGDataProviderCreateWithURL( url );
image = CGImageCreateWithPNGDataProvider( provider, NULL, false,
kCGRenderingIntentDefault );
CGDataProviderRelease( provider );
CFRelease( url );
CFRelease( fileName );
}
}
return image;
}
Hope this helps,
;) Urs
urs heckmann
email@hidden
www.u-he.com
Am Mittwoch, 13.11.02, um 15:16 Uhr (Europe/Berlin) schrieb Angus F.
Hewlett:
Hi,
Apologies for the flood of questions... I'm porting some existing
CFM-based code (VST plugins) to AU. Under VST, the host sets the plug's
resource context (with UseResFile()) before calling in to the plug.
However, I can't seem to get this functionality working in
AUCarbonView.
What approach are others taking to this? Seems component bundles handle
these things a bit differently than in the past, but I've not quite
got my
head around it yet.
Regards,
Angus.
=======================================================
Angus F. Hewlett, Technical Director
FXpansion Audio UK Ltd - http://www.fxpansion.com
=======================================================
_______________________________________________
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.
_______________________________________________
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.