AUEventListenerCreate / AUEventListenerAddEventType
AUEventListenerCreate / AUEventListenerAddEventType
- Subject: AUEventListenerCreate / AUEventListenerAddEventType
- From: Ethan Funk <email@hidden>
- Date: Thu, 25 Sep 2008 17:39:39 -0700
I'm having a bit of trouble with AUEventListener.
Here is what I am trying to do:
create a pthread and run a runloop in it which will receive notifications of parameter changes on a particular audio unit running with in my program. I am interested only in parameters with display flags - level meters and such. My pthread will then pass the new value along to a client through a custom notification mechanism.
I create the run loop in my thread:
auNotifyLoop = CFRunLoopGetCurrent(); CFRetain(auNotifyLoop); while(run) // Run loop for capturing AudioUnit parameter changes CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1.0, false); CFRelease(auNotifyLoop); pthread_exit(0);
Elsewhere in the code I create a a listener: ... err = AUEventListenerCreate(auEventListenerProc, NULL, auNotifyLoop, kCFRunLoopDefaultMode, 0.100, 0.100, &listener); ... were auEventListenerProc is my callback procedure. There is no error here.
Then I Add events to listen for by iterating through the audio unit's parameters:
... err = AudioUnitGetProperty(instance, kAudioUnitProperty_ParameterInfo, kAudioUnitScope_Global, parameterArray[index], ¶mInfo, &size); if(paramInfo.flags & kAudioUnitParameterFlag_DisplayMask){ propertyEvent.mEventType = kAudioUnitEvent_ParameterValueChange; propertyEvent.mArgument.mParameter.mAudioUnit = instance; // the AudioUnit instance propertyEvent.mArgument.mParameter.mParameterID = parameterArray[index]; // parameter ID propertyEvent.mArgument.mParameter.mScope = kAudioUnitScope_Global; propertyEvent.mArgument.mParameter.mElement = 0; OSStatus err = AUEventListenerAddEventType(listener, NULL, &propertyEvent); ...
Again, no errors, but my call back never gets called when the parameters change. What am I missing?
Also, I was wondering if I can call AUListenerDispose on my listener when I am done without calling AUEventListenerRemoveEventType for each event I added?
Ethan...
|
_______________________________________________
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