Re: Indexed Audio Unit Parameter
Re: Indexed Audio Unit Parameter
- Subject: Re: Indexed Audio Unit Parameter
- From: Chad Wagner <email@hidden>
- Date: Sun, 13 Apr 2008 14:26:59 -0400
Thanks Chris for your response, it pointed me in the right direction
which was to errors in my own AU. We have some abstraction that
allows us to use the same code for AU and other plugin formats, and I
hadn't realized some of the forgotten code under the hood was
assuming things about indexed parameters. Apologies for posting a
problem that was purely my own (but your response did help me to
solve it!)
On Apr 13, 2008, at 12:04 PM, Chris Johnson wrote:
On Apr 13, 2008, at 2:42 AM, Chad Wagner wrote:
I'm having a problem with audio unit parameters whose "unit" is
set to kAudioUnitParameterUnit_Indexed. Everything works when the
indexed values start at 0 and I provide an array of value
strings. But one of my indexed parameters has no value strings,
which causes a bus error in auval, and another indexed parameter
starts at 1 rather than 0, but auval seems to be looking for an
extra value string as if they started at 0 (i.e. my range is 1 to
3, I provide an array with 3 strings, but auval is looking for a
4th). In all cases, changing the unit to generic makes the
problem go away, as does leaving it as indexed but starting at 0
and providing an array of value strings...
e.g. one of the parameters is a MIDI channel, which should be an
integer from 1 to 16. I don't want it to start at 0, and it seems
absurd to have to specify an array of strings "1" to "16". Is
there a better way?
I have a similar Indexed parameter in Classic Channel and I've
just looked up what it was doing- turns out my range is 1 to 3 and
I'm supplying static const int variables for the values, and static
CFStringRef for the names in the popup... and in
GetParameterValueStrings, it's making the array of value strings
you mention. Then in GetParameterInfo I am supplying the const
variables to mark what number means what selection, and my minValue
is the const equal to one (as is kDefaultValue_ParamOne)...
This is puzzling me- I'm trying to figure out if I took the string
labels out, would it break. It certainly appears that apart from
the labels, I'm setting the range as 1 to 3 with default value as
one and auval does not complain... perhaps it's odd, but if
supplying an array of strings "1" to "16" makes the parameter
handling more bulletproof, why not? It's useful to know that if you
try to use indexed parameters (with no associated string array)
that aren't from zero, there's a problem- thanks.
Chris Johnson
airwindows
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40chadawagner.com
This email sent to email@hidden
_______________________________________________
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