• 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
Error in AUListenerAddParameter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error in AUListenerAddParameter


  • Subject: Error in AUListenerAddParameter
  • From: Howard Moon <email@hidden>
  • Date: Tue, 22 Feb 2011 13:57:31 -0800

Hi all,

I've removed my Kernel object from a simple AU generated from the AU effect template.  In doing so, I've moved a listener for my parameters to the main AudioUnit class (derived from AUEffectBase).  Unfortunately, now I'm getting errors on the calls to AUListenerAddParameter.  The error is -50 (error in user parameter list).

Is it ok to make these calls from the constructor for the AudioUnit?

The AUListenerCreate returns 0 (noErr), but the calls to AUListenerAddParameter fail.  Here's the relevant code (from the constructor of MyAU):

OSStatus stat = AUListenerCreate( ParameterListenerDispatcher,
this, 
NULL, // same as CFRunLoopGetCurrent(),
NULL, // same as kCFRunLoopDefaultMode,
0.100, // 100 ms
&parameterListener );
int i;
for (i = 0; i < parameterCount; ++i)
{
AudioUnitParameter auParam;
auParam.mAudioUnit = component;
auParam.mParameterID = i;
auParam.mScope = kAudioUnitScope_Global;
auParam.mElement = 0; // TODO: is this ALWAYS correct?
stat = AUListenerAddParameter( parameterListener, NULL, &auParam );
}

This code comes immediately after the loop calling SetParameter for each of my effect parameters.  Here's the callback:

void ParameterListenerDispatcher( void *inRefCon,
void *inObject,
const AudioUnitParameter *inParameter,
Float32 inValue )
{
// inObject ignored

MyAU* listener = (MyAU*)inRefCon;
listener->OnParamChangeNotification( inParameter, inValue );
}

This all worked fine when it was in the constructor for the Kernel object.  Any thoughts as to why this is failing?

Thanks,
Howard



 _______________________________________________
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

  • Follow-Ups:
    • Re: Error in AUListenerAddParameter
      • From: Howard Moon <email@hidden>
    • Re: Error in AUListenerAddParameter
      • From: Howard Moon <email@hidden>
  • Prev by Date: RE: Using existing VST/RTAS DSP code in AudioUnit
  • Next by Date: Re: AU->UI communication
  • Previous by thread: Re: AU->UI communication
  • Next by thread: Re: Error in AUListenerAddParameter
  • Index(es):
    • Date
    • Thread