• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Initialization of parameters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Initialization of parameters


  • Subject: Re: Initialization of parameters
  • From: William Stewart <email@hidden>
  • Date: Tue, 22 Apr 2008 18:20:52 -0700

I'd replied privately, but in order to keep this in the list archives :)


On Apr 22, 2008, at 3:29 PM, Howard Moon wrote:

Ok, thanks... I'll keep those SetParameter calls in, then. (And I have verified that, at least in Logic, I need them.) But I have three follow-up questions in that case:

1) I've traced the code for SetParameter, and it appears to me that your point (1) below is only valid when *not* using indexed parameters, in which case a new parameter is added to the AUElement::mParameters map the first time SetParameter is called. I'm using indexed parameters at the moment, so I think that only point (2) applies. Correct?

No - you still have to initialise the values to something - or at least shadow this so that in the GetParameter call you don't return uninitialised (garbage) values


2) What is the purpose of setting AudioUnitParameterInfo::defaultValue for each parameter (in GetParameterInfo), if it doesn't actually set the default value?

it just tells the client what a "default" value could be - we've wanted to add a UI into AULab that would go and set default values on an audio unit (but haven't done that yet). It is important that this be a sensible default


3) Is this information documented anywhere? (And by this I mean both the requirement of calling SetParameter, and the purpose of the defaultValue member.)

It should be in the developing an audio unit guide.

Bill

Thanks again,
	-Howard

On Apr 22, 2008, at 2:50 PM, William Stewart wrote:

The calls in the constructor are required:
(1) Creates a space in the element for that parameter
(2) Sets the default value of the parameter

If you don't do this, then you don't have the parameter

On Apr 22, 2008, at 8:47 AM, Howard Moon wrote:

In the AU examples I've seen, the constructor of the AU calls SetParameter with default values for the parameters. Is that needed? I would expect, since the GetParameterInfo function override sets the default value, that the host (or some part of the AU base class hierarchy) would use that default information to call SetParameter for us. Am I mistaken? Or are the calls to SetParameter in the constructor redundant?


_______________________________________________ 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

_______________________________________________ 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
References: 
 >Initialization of parameters (From: Howard Moon <email@hidden>)
 >Re: Initialization of parameters (From: William Stewart <email@hidden>)
 >Re: Initialization of parameters (From: Howard Moon <email@hidden>)

  • Prev by Date: Re: AUVarispeed usage question
  • Next by Date: Re: Decoding compressed to LPCM (Jens Alfke)
  • Previous by thread: Re: Initialization of parameters
  • Next by thread: Re: Decoding compressed to LPCM (Jens Alfke)
  • Index(es):
    • Date
    • Thread