Re: Error AUEventListenerAddEventType
Re: Error AUEventListenerAddEventType
- Subject: Re: Error AUEventListenerAddEventType
- From: Doug Wyatt <email@hidden>
- Date: Mon, 7 Dec 2009 01:18:35 -0800
AUEventListenerAddEventType will fail with paramErr (-50) if:
- you are adding a duplicate (listener, object, event type) tuple, which seems unlikely since you're just creating the listener.
- paramErr is returned from AudioUnitGetParameter or the fast dispatch version of it, for the specified AU/scope/element/parameter
- paramErr is return from AudioUnitGetProperty for ParameterInfo
That's all I can see/think of right now...
On Dec 6, 2009, at 4:30 , Darrell Gibson wrote:
> (This may be a very obvious question, but I have been staring at this for over 4 hours now and I can't see the problem.)
>
> I have two bit of code that appear to be identical, but one generates an error and the other doesn't. For the life of my I can't see why.
>
> The error occurs when I am setting up an event handler for my AU. Here is the code:
>
> void MyAUPlugin::AddListenerEvents()
> {
> OSStatus err = noErr;
> AudioUnitEvent myParameterEvent;
> AUEventListenerRef mEventListener;
>
> myParameterEvent.mEventType = kAudioUnitEvent_ParameterValueChange;
>
> myParameterEvent.mArgument.mParameter.mAudioUnit = thisAU;
> myParameterEvent.mArgument.mParameter.mParameterID = kParam_Three;
> myParameterEvent.mArgument.mParameter.mScope = kAudioUnitScope_Global;
> myParameterEvent.mArgument.mParameter.mElement = 0;
>
> err = AUEventListenerCreate(MyPropertyListener,
> NULL,
> (CFRunLoopRef)GetCFRunLoopFromEventLoop(GetCurrentEventLoop()),
> kCFRunLoopDefaultMode,
> 0.05,
> 0.05,
> &mEventListener);
> printf ("Event listener creation error value is %i\n",int(err));
>
> err = AUEventListenerAddEventType (mEventListener, NULL, &myParameterEvent);
> printf ("Event listener event type error value is %i\n",int(err));
> }
>
>> From this code I always get a -50 error returned from the AUEventListenerAddEventType. As I say I have another method that works fine and I can't see the problem. I know the -50 error code relates to an error in the parameter list, but I just can't see the issue.
>
> For the sake of my sanity if you can see a problem here, please let me know.
>
> Thanks for your help,
>
> Darrell.
_______________________________________________
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