Problem with AudioUnitAdd/RemovePropertyListener
Problem with AudioUnitAdd/RemovePropertyListener
- Subject: Problem with AudioUnitAdd/RemovePropertyListener
- From: Ian Kemmish <email@hidden>
- Date: Sat, 16 Dec 2006 15:14:07 +0000
There appears to be a problem with the way these routines are specified.
ComponentResult AudioUnitAddPropertyListener(
AudioUnit ci,
AudioUnitPropertyID inID,
AudioUnitPropertyListenerProc inProc,
void * inProcRefCon
);
ComponentResult AudioUnitRemovePropertyListener(
AudioUnit ci,
AudioUnitPropertyID inID,
AudioUnitPropertyListenerProc inProc
);
The key to the problem is that the combination of inID and inProc is
not always sufficient to uniquely identify a particular listener.
Take the simple case of a polite AU and a polite host which allow the
user to open multiple windows viewing the same AU, and close any of
those windows at any time. In this case, inProcRefCon will typically
be a pointer to an instance of some NSView subclass, and of course
inProc will be the same for each instance.
The problem is that when the user closes one of the windows,
AudioUnitRemovePropertyListener() has no way of communicating to the
AU which window is being closed, and therefore which listener to remove.
The documentation correctly describes the behaviour of the sample
listener code:
"This function will remove *ALL* of the property listeners that match
the specified property ID and the inProc address." (my emphasis)
But the trouble with this is that it will also remove the listener(s)
for the window(s) that is(are) left open by the user. These windows
will promptly become deaf to property value changes. I don't believe
this is acceptable behaviour.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
Ian Kemmish 18 Durham Close, Biggleswade, Beds
SG18 8HZ
email@hidden Tel: +44 1767 601361 Mob: +44 7952
854387
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
_______________________________________________
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