Re: Property Listener for parameter values?
Re: Property Listener for parameter values?
- Subject: Re: Property Listener for parameter values?
- From: Bill Stewart <email@hidden>
- Date: Wed, 20 Nov 2002 10:59:04 -0800
On Wednesday, November 20, 2002, at 10:05 AM, Marc Poirier wrote:
>
If an Audio Unit changes one of its parameters internally (like in
>
response to a MIDI event, for example), what is the best way for it to
>
post some sort of notification of that change to any listeners (host
>
app,
>
GUI, etc.)?
>
>
There doesn't appear to be a kAudioUnitProperty_ParameterValue or
>
anything
>
like that, so PropertyChanged() would appear to not be an option.
>
>
I've looked into AUParameterSet, but I'm not sure if that is something
>
that an Audio Unit should be using internally. But if it is okay,
>
would
>
something like this be legit:
>
>
AudioUnitParameter param;
>
>
param.mAudioUnit = this;
>
param.mParameterID = theChangedParameterID;
>
param.mScope = kAudioUnitScope_Global;
>
param.mElement = 0;
>
>
OSStatus result = AUParameterSet(NULL, NULL, ¶m,
>
theChangedParameterValue, 0);
This would be fine - that way anyone who cares about the change in the
parameter value will hear about it. This would both set the value of
the parameter and notify any listeners...
Alternatively, as you're the one actually changing the parameter and
its internal to your unit an alternative would be to use:
AUParameterListenerNotify
This will just do a notification to tell listeners that the parameter
has been changed - then all you need to do is ensure that before you
make this call the value of the parameter that is returned by
AudioUnitGetParameter will be correct.
Bill
>
>
>
Thanks for any advice,
>
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.
>
>
--
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
________________________________________________________________________
__
_______________________________________________
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.