RE: Error AUEventListenerAddEventType
RE: Error AUEventListenerAddEventType
- Subject: RE: Error AUEventListenerAddEventType
- From: Darrell Gibson <email@hidden>
- Date: Mon, 7 Dec 2009 15:53:26 +0000
- Acceptlanguage: en-US, en-GB
- Thread-topic: Error AUEventListenerAddEventType
Doug,
Thanks for your response. As far as I can see I'm not violating any of these criteria.
The really odd thing is, in frustration I copied the createListener code from the TN2104 Technical Note to replace mine. After a few mods it worked, yet I can't see any difference between the two bits of code.
Thanks anyway for your response.
Darrell.
________________________________________
From: Doug Wyatt [email@hidden]
Sent: 07 December 2009 09:18
To: Darrell Gibson
Cc: email@hidden
Subject: Re: Error AUEventListenerAddEventType
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.
BU - the UK's Number One New University
The Guardian University Guide 2009 & 2010
This email is intended only for the person to whom it is addressed and may contain confidential information. If you have received this email in error, please notify the sender and delete this email, which must not be copied, distributed or disclosed to any other person.
Any views or opinions presented are solely those of the author and do not necessarily represent those of Bournemouth University or its subsidiary companies. Nor can any contract be formed on behalf of the University or its subsidiary companies via email.
_______________________________________________
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