• 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
Re: Problem with AudioUnitAdd/RemovePropertyListener
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with AudioUnitAdd/RemovePropertyListener


  • Subject: Re: Problem with AudioUnitAdd/RemovePropertyListener
  • From: Brett George <email@hidden>
  • Date: Sat, 16 Dec 2006 10:17:12 -0800

The view would be a bad place to have these property listeners. You
should have another class which always runs regardless of which windows
are open, and that class should update the contents of the windows based
on AU property changes.

Brett.

Ian Kemmish wrote:

>
> 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
>
 _______________________________________________
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

  • Follow-Ups:
    • Re: Problem with AudioUnitAdd/RemovePropertyListener
      • From: William Stewart <email@hidden>
References: 
 >Problem with AudioUnitAdd/RemovePropertyListener (From: Ian Kemmish <email@hidden>)

  • Prev by Date: Problem with AudioUnitAdd/RemovePropertyListener
  • Next by Date: Re: A Rosetta wrapper AU
  • Previous by thread: Problem with AudioUnitAdd/RemovePropertyListener
  • Next by thread: Re: Problem with AudioUnitAdd/RemovePropertyListener
  • Index(es):
    • Date
    • Thread