Getting popups in the generic view. (Newbie problem)
Getting popups in the generic view. (Newbie problem)
- Subject: Getting popups in the generic view. (Newbie problem)
- From: Mikael Sundström <email@hidden>
- Date: Tue, 5 Sep 2006 14:54:47 +0200
Hi to all,
I'm a newbie when it comes to AU's, so I naturally began by working
through Apples's 'TremoloUnit' example. Unfortunately, this example
seems to be something of a work in progress.
The problem is the 'Waveform' parameter, which brings up a slider in
the generic view, rather than the popup it should. This seems to be
because whatever code needed for getting a popup was left out. The
tutorial had me adding the following:
//menu item names for the waveform parameter
static CFStringRef kMenuItem_TremoloParam_Sine = CFSTR ("Sine");
static CFStringRef kMenuItem_TremoloParam_Square = CFSTR ("Square");
but these CFStrings aren't actually referenced anywhere.
In an effort to fix this, I ended up doing this:
//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~
// Tremolo::GetParameterValueStrings
//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~
ComponentResult Tremolo::GetParameterValueStrings
(
AudioUnitScope inScope,
AudioUnitParameterID inParameterID,
CFArrayRef * outStrings
)
{
if (inScope == kAudioUnitScope_Global && inParameterID ==
kTremoloParam_Waveform)
{
CFStringRef arr[] = { kMenuItem_TremoloParam_Sine,
kMenuItem_TremoloParam_Square };
*outStrings = CFArrayCreate(NULL, (const void**) arr, 2,
&kCFTypeArrayCallBacks);
return noErr;
}
return kAudioUnitErr_InvalidProperty;
}
That should do the trick, shouldn't it? But it only makes AU Lab
crash and quit when I select the Tremolo plugin. The auval tool also
crashes with a Bus error, right when it examines this parameter. (I
also tried specifying 'NULL' for the CFArrayCreate callbacks, with
the same result.)
After staring in vain at the same code for six hours, I'm quite
tempted to just leave it as it is and move on to greater things, but
there's probably an important lesson to be learned here, so I would
really appreciate it if someone could help out!
Mikael
_______________________________________________
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