RE: Audio Units:Updating Parameters in GUI automatically
RE: Audio Units:Updating Parameters in GUI automatically
- Subject: RE: Audio Units:Updating Parameters in GUI automatically
- From: "Metzar, Nicholas W" <email@hidden>
- Date: Fri, 20 Apr 2007 01:13:03 -0400
- Thread-topic: Audio Units:Updating Parameters in GUI automatically
Mark, William,
Thank you for your quick replies. I appreciate the help.
>From what I gather, It sounds as if this would be the workable plan:
Instead of calling SetParameter, I would be calling AUParameterSet.
AUParameterSet will allow me to update a parameter *and* the view.
***However***, from what I've read, I must first set the parameter to listen for updates.
Some have posted using AUParameterSet successfully with the following:
AUParameterSet(Null,Null, ¶m, new_value, 0)
So would this be a correct way to set up the parameter for listening (assuming the parameter in question adjusted a low pass filter)?:
AudioUnitParameter param;
param.mAudioUnit = this;
param.mParameterID = kParam_Low_Pass;
param.mScope = kAudioUnitScope_Global;
param.mElement = 0;
AUListenerAddParameter(NULL, NULL, ¶m);
So the obvious questions are:
1) Is the second block of code appropriate?
2) Is the AUParameterSet function valid assuming the second block of code is established beforehand?
3) Where would it be appropriate to place this second block of code(in GetParameterInfo?)? Setting param.mAudioUnit = this, and the many NULLs for inListener, inObject, etc is a little unsettling.
Thank you again for any help or information you can pass along. I'm trying get my plug-ins to the next level, and this seemingly trivial problem has really gotten my stuck.
-Nick
-----Original Message-----
Instead of calling SetParameter, you should call AUParameterSet
(<AudioToolbox/AudioUnitUtilities.>) - its nearly as simple :)
On 18/04/2007, at 9:58 PM, Metzar, Nicholas W wrote:
> (This is might be somewhat of a newbie question, but probably a
> little deeper than that...)
>
> Here is a question/situation that I think should be easy to
> answer. Or rather...I hope is easy to answer.
>
> Heres the situation... say I'm making an AU plugin with a simple
> generic view.
> This plugin has several parameters...doesn't matter what they are/
> do/represent: gain, delay, whatever.
>
> I want the the plugin to change the value of the parameter
> automatically based on any sort of condition, ***AND*** update the
> GUI to reflect this change. For example:
>
> if (a != b)
> {
> mAudioUnit->SetParameter(kParam1, new_value);
> }
>
> This piece of code would (does) work great in the kernel process
> (just once a buffer, not every sample...I really don't need that).
> I can hear the change happening as expected by updating kParam1 to
> its new_value whenever a!=b. However, the slider bar does not move
> in the GUI. I really really want to see that happen. Its feedback
> to the user that shows them what is happening. How do I make that
> happen? Why doesn't SetParameter do it?
>
> Ideally, the answer to this question is nearly as simple as the
> example code I posted, although I'm aware my expectations may be high.
>
> Thanks for any and all help!
> -Nick
> _______________________________________________
> 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