Re: AudioUnitSetProperty() returns -10879
Re: AudioUnitSetProperty() returns -10879
- Subject: Re: AudioUnitSetProperty() returns -10879
- From: William Stewart <email@hidden>
- Date: Wed, 31 Jan 2007 12:23:45 -0800
Just to correct this...
Firstly - if you are changing any information about a parameter
(range, type, etc), from *within* your AU, then all you need to do is
call the PropertyChanged method (defined in AUBase.h) with either the
ParameterList or ParameterInfo property ID (the list is probably the
best). The generic views we provide will listen to these properties
changing, and refresh their views.
The AUEventListener API is an API for use by clients (hosts) of an AU
- it is normally not necessary for the AU implementation itself to
use this API
In terms of host apps - Stefan's comments are correct in that
(1) Most host apps do not listen for changes here (unfortunately)
(2) If there are changes here, there is always the possibility that
automation data can now be wrong...
For the point you are asking about below - the mapping of a generic
parameter value (0 to 1) to a display value. The AU spec provides a
capability to provide a string for a given parameter value (and our
generic views will use this mechanism). If the string representation
of a given parameter value has changed, then you can issue a
PropertyChanged notification for ParameterInfo on that parameter -
and the views Apple provides will update their displays
appropriately. You should be able to test all of this by using AULab
(/Developer/Applications/Audio) - using either the carbon or generic
(cocoa) views it provides. You can have multiple views open - so you
could have your custom view and a generic view open at the same time,
and you should see the generic view change as you change.
Some host app displays of your updated parameter values will not
change though, as they don't react to these property changes as
discussed above. But I think this is probably not a big deal as
mostly your users will be using your custom view in any case.
Hope that helps.
Bill
On 30/01/2007, at 9:04 AM, Stephen Blinkhorn wrote:
Hi Stefan, many thanks for your reply.
Originally I was just going to use generic parameters and map their
range from 0..1 to whatever is appropriate at run-time but I wanted
automation editors to display the actual value not just 0..1
(because it can be more useful for programming sequences that
way). I'll be making a custom GUI so I'm sure I can just display
the mapped value in there too. Does a user really need to know
that a filter cutoff is set at say 100Hz if it is doing what they
want anyway? I may find out the hard way..
Thanks,
Stephen.
On 30 Jan 2007, at 15:05, Stefan Gretscher wrote:
Hi Stephen,
if possible I'd advise against modifying the parameter
characteristics at runtime.
Currently most host apps don't support this properly, and it may
cause trouble if
the user has recorded automation for the parameter.
If you still decide to go down this route, then use the
AudioUnitEvent API
(see http://developer.apple.com/technotes/tn2002/tn2104.html) and
trigger
a property change notification for
kAudioUnitProperty_ParameterInfo so that
any hosts and views can update accordingly.
Best,
Stefan
Am 29.01.2007 um 19:00 schrieb Stephen Blinkhorn:
On 27 Jan 2007, at 15:37, Stephen Blinkhorn wrote:
Hello all,
I am trying to update a parameter's min,max,default and unit
values in response to some parameter change. I'm having
problems calling AudioUnitSetProperty() from inside a parameter
listener. It always returns invalid property error:
AudioUnitSetProperty(thisAU, kAudioUnitProperty_ParameterInfo,
kAudioUnitScope_Global, kGlobalSynthType1, ¶mInfo, size);
..this call returns -10879.
Right, I see. You can't use kAudioUnitProperty_ParameterInfo
with AudioUnitSetProperty() it is intended only for use with
AudioUnitGetProperty(). So if I want to redefine a parameter's
min,max & unit values in response to a parameter change elsewhere
what is the best approach? Destroy the original and create a new
parameter?
TIA for any help,
Stephen.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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