AUParameterValueFromLinear?
AUParameterValueFromLinear?
- Subject: AUParameterValueFromLinear?
- From: Jeremy Sagan <email@hidden>
- Date: Sat, 22 Nov 2003 16:27:33 -0500
AUParameterValueFromLinear seems to be converting a parameter whose
type is kAudioUnitParameterUnit_Indexed to an exponential scale. Is
this a bug?
The following code does not work correctly without the else clause
(although it should not be needed):
if (GetAudioUnitParamInfo(AU, &data, parm) == noErr)
{
if (kAudioUnitParameterUnit_Indexed != data.AUPI.unit)
value = MyParameterValueFromLinear(value, &data.AUP); //this calls
to AUParameterValueFromLinear
else
{// do linear mapping manually since AUParameterValueFromLinear
doesn't work right
value = (value) * (data.AUPI.maxValue - data.AUPI.minValue) +
data.AUPI.minValue;
value = floor(value + 0.5);
}
}
return (value);
Jeremy
_______________________________________________
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.