Parameter Display Updating
Parameter Display Updating
- Subject: Parameter Display Updating
- From: Aristotel Digenis <email@hidden>
- Date: Mon, 28 Jun 2004 12:57:06 +0100
Hello everybody,
I am having a problem with updating parameters to updated values.
Lets say I have two parameters on the default GUI, 1 indexed (drop down
menu) and a slider. The drop down menu has values between 1 and 16 and
they represent different speakers. The slider value is meant to be the
amplitude of the speaker. So the user can select say Speaker 5 from the
drop down parameter and the slider should recall the amplitude last set
for that speaker.
In the SetParameter function I store the value of the drop down
parameter into an integer called speakerInFocus. While still in the case
statement for the drop down parameter, I call
AUBase::SetParameter(amplitude, kAudioUnitScope_Global, 0,
speakerAmplitude[speakerInFocus], 0); to update the amplitude parameter
to the value of that speaker. This did not work(code shown below).
(Also...what is the difference betweeen AudioUnitSetParameter() and
SetParameter()? None right?)
Thank you
- - - - - - - - - - - - - -
//In the constructor
float speakerAmplitude[16];
int speakerInFocus = 0;
for(int i = 0; i < 16; i++)
{
speakerAmplitude[i] = 0.5;
}
SetParameter(speakerNumber, kAudioUnitScope_Global, 0, speakerInFocus, 0);
SetParameter(amplitude, kAudioUnitScope_Global, 0,
speakerAmplitude[speakerInFocus], 0);
//Later in the program
ComponentResult BDecoder::SetParameter(AudioUnitParameterID iID,
AudioUnitScope iScope, AudioUnitElement iElem, Float32 rValue, UInt32
iSchedule)
{
if (iScope==kAudioUnitScope_Global && iElem==0)
{
switch (iID)
{
case speakerNumber:
speakerInFocus = (int) rValue;
AUBase::SetParameter(amplitude, kAudioUnitScope_Global,
0, speakerAmplitude[speakerInFocus], 0);
break;
case amplitude:
speakerAmplitude[speakerInFocus] = rValue;
break;
}
}
return AUBase::SetParameter(iID, iScope, iElem, rValue, iSchedule);
}
_______________________________________________
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.