Error AUEventListenerAddEventType
Error AUEventListenerAddEventType
- Subject: Error AUEventListenerAddEventType
- From: Darrell Gibson <email@hidden>
- Date: Sun, 6 Dec 2009 12:30:35 +0000
- Acceptlanguage: en-US, en-GB
- Thread-topic: Error AUEventListenerAddEventType
(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