Re: Getting popups in the generic view. (Newbie problem)
Re: Getting popups in the generic view. (Newbie problem)
- Subject: Re: Getting popups in the generic view. (Newbie problem)
- From: Artemiy Pavlov <email@hidden>
- Date: Tue, 5 Sep 2006 16:46:44 +0300
Hello!
Here's what you need to do in whole.
1. First in <MyCoolPlugin.h> you define, say, 3 strings to be used
for the drop-down selector:
static CFStringRef kParameterString1 = CFSTR( "Type 1" );
static CFStringRef kParameterString2 = CFSTR( "Type 2" );
static CFStringRef kParameterString3 = CFSTR( "Type 3" );
static const int kParameterStringCount = 3;
2. Then in <MyCoolPlugin.cpp> you create an array of these strings:
ComponentResult MyCoolPlugin::GetParameterValueStrings
(AudioUnitScope inScope,
AudioUnitParameterID inParameterID,
CFArrayRef * outStrings)
{
if ( (inScope == kAudioUnitScope_Global) && (inParameterID ==
kParameter) ) {
if (outStrings == NULL) return noErr;
CFStringRef strings[] = { kParameterString1, kParameterString2,
kParameterString3 };
*outStrings = CFArrayCreate( NULL, (const void **)strings,
kParameterStringCount, NULL);
return noErr;
}
}
3. And later on in <MyCoolPlugin.cpp> for GetParameterInfo you add
this line to the kParameter part:
outParameterInfo.unit = kAudioUnitParameterUnit_Indexed;
That should do it.
Artemiy.
_______________________________________________
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