Problem with GetParameterValueStrings
Problem with GetParameterValueStrings
- Subject: Problem with GetParameterValueStrings
- From: John Mullins <email@hidden>
- Date: Sat, 17 Jan 2004 22:51:24 -0600
Hey,
I'm running XCode in Panther 10.3.2.
Every time I try to register strings in GetParameterValueStrings the
program crashes.
UInt32 rw_flag = kAudioUnitParameterFlag_IsReadable |
kAudioUnitParameterFlag_IsWritable;
const AudioUnitParameterInfo CSynth::s_asParInfo[]= {
// Name CFStr Unit Min Max
Default Flags
{ "Attack", 0, CFSTR("Attack"), kGeneric, 0.1f, 100.0f,
10.0f, rw_flag},
{ "Decay", 0, CFSTR("Decay"), kGeneric, 0.0f, 100.0f,
70.0f, rw_flag},
{ "Sustain", 0, CFSTR("Sustain"), kGeneric, 0.0f, 100.0f,
100.0f, rw_flag},
{ "Release", 0, CFSTR("Release"), kGeneric, 0.0f, 100.0f,
1.0f, rw_flag},
{ "Octave", 0, CFSTR("Octave"), kGeneric, -4.0f, 4.0f,
0.0f, rw_flag},
{ "Cent", 0, CFSTR("Cent"), kGeneric, 0.0f, 100.0f,
0.0f, rw_flag},
{ "Wave", 0, CFSTR("Wave"), kIndexed, 0, 4,
0, rw_flag},
{ "Phase", 0, CFSTR("Phase"), kGeneric, -1.0f, 1.0f,
0.0f, rw_flag},
{ "Poly", 0, CFSTR("Poly"), kIndexed, 1, 3, 1,
rw_flag | kAudioUnitParameterFlag_HasCFNameString },
{ "Voices", 0, CFSTR("Voices"), kIndexed, 1, 4, 1,
rw_flag | kAudioUnitParameterFlag_HasCFNameString },
{ "Param", 0, CFSTR("Param"), kGeneric, 0.0f, 100.0f,
0.0f, rw_flag}
};
const UInt32
CSynth::s_nbPar=sizeof(CSynth::s_asParInfo)/
sizeof(AudioUnitParameterInfo);
if (iScope==kAudioUnitScope_Global)
{
if( iID == kParam_Voices)
{
static const void* ppVal[]={
CFSTR("4"),
CFSTR("8"),
CFSTR("16"),
CFSTR("24")};
crashes here *tArrayRef=CFArrayCreate(NULL, ppVal, 4, NULL);
return noErr;
}
else if(iID == kParam_Poly)
{
static const void* ppVal[]={
CFSTR("poly"),
CFSTR("retrig"),
CFSTR("legato")};
crashes here *tArrayRef=CFArrayCreate(NULL, ppVal, 3, NULL);
return noErr;
}
}
return AUBase::GetParameterValueStrings(iScope, iID, tArrayRef);
Everything seems to be put in just right and I've tried a lot of
different combinations with the flags.
When the program crashes in the report it says...
0 com.crap.demo.synth 0x048ad324
CSynth::GetParameterValueStrings(unsigned long, unsigned long,
__CFArray const**) + 0xb0 (Parameters.cpp:174)
1 com.crap.demo.synth 0x048aee30
AUBase::DispatchGetPropertyInfo(unsigned long, unsigned long, unsigned
long, unsigned long&, unsigned char&) + 0x414 (AUBase.cpp:332)
I can't figure this out for the life of me.
Thanks,
John Mullins
_______________________________________________
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.