• 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
AUEventListenerCreate / AUEventListenerAddEventType
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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], &paramInfo, &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

  • Prev by Date: re: Audiounit with Cocoa View steals 'space bar' events from Logic
  • Next by Date: Re: AUEventListenerCreate / AUEventListenerAddEventType
  • Previous by thread: re: Playing Audio Backwards
  • Next by thread: Re: AUEventListenerCreate / AUEventListenerAddEventType
  • Index(es):
    • Date
    • Thread