kAudioUnitParameterUnit_Indexed value range
kAudioUnitParameterUnit_Indexed value range
- Subject: kAudioUnitParameterUnit_Indexed value range
- From: Marc Poirier <email@hidden>
- Date: Tue, 29 Oct 2002 19:53:26 +0100 (CET)
Hi. I have some questions about the kAudioUnitParameterUnit_Indexed
parameter unit and how it is expected that a parameter of that unit type
will behave. Well, my main question is: Are the values of the parameter
expected to correspond to actual array indices? In other words, should
the value range always be from zero to some positive number?
My understanding is that using the Indexed unit type indicates a couple of
things: (1) that the parameter values should be treated like integer
values, not decimal values, and (2) that ValueStrings may exist for the
parameter's value displays (and if not, then the values are displayed as
integers). All that it says for a description in AudioUnitProperties.h
is: "takes an integer value (good for menu selections)." From this, I
would think that any value range, including negative values, would be
okay.
I have an Indexed parameter whose range is -5 to 0. Logic doesn't seem to
dig this. The generic Logic plugin interface shows parameter value
integers for -5 to -1 and then shows the first ValueString for 0 (the
ValueString that actually corresponds to -5). So I am guessing that Logic
is assuming that the values of this parameter are exactly the indices of
the ValueStrings array, and is therefore not attempting to index with the
negative values (which is a good save, certainly better than crashing).
But I would think that what should happen is that the host should derive
the index as something like currentValue-parameterMinValue.
Am I right about this or should I just be using 0 to n_positive value
ranges?
In other news, the Apple GenericAUView has its own problems with my
ValueStrings... A number of the strings are negative numbers (like "-3"
"-2" etc.). The Apple GenericAUView can't display these, it just displays
blank menu items. If I insert a space or something at the beginning of
one of those strings (like " -3"), then it works fine. Logic, on the
other hand, has no problems with the strings that start with hyphens (but
has the other indexing problem). Oh yeah, the GenericAUView does, on the
other hand, show all of my negative value indexed strings, as I would
hope.
Thanks for any help,
Marc
_______________________________________________
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.