Re: How to communicate between the view and the edit components?
Re: How to communicate between the view and the edit components?
- Subject: Re: How to communicate between the view and the edit components?
- From: Marc Poirier <email@hidden>
- Date: Wed, 4 Jun 2003 10:19:24 -0500 (CDT)
On Wed, 4 Jun 2003, Shai Shasag wrote:
>
I need to communicate between the AUBase derived component and the
>
AUCarbonViewBase component.
>
>
I though of adding component selectors, however I did not find a way
>
to do that. In the past the macro FIVEWORDSINLINE was used to create
>
new component calls, however I could not get it to work as it
>
preprocessed to nothing. Although it is used in AUComponent.h to
>
define the AU functions.
>
>
I could send message from the view component to the edit component by
>
using Get/SetProperty. However the other drection is not possible as
>
the view component does not have Get/SetProperty mechanism.
Well, and more importantly, the audio component has no awareness of the
existance of the GUI component in the AU model. So you need to realize
that first before you can consider a solution. Basically, you want think
of the GUI as a property and/or parameter listener, just like any other
potential listener (like the host app, etc.). The audio component will
maintain a list of listeners for various properties, but doesn't know and
doesn't care about anything about those listeners aside from which
properties that want to know about. If you have special needs, then you
can define custom properties for your AU and then the GUI can install
property listeners on those properties. Then your audio component uses
PropertyChanged notification to inform the listeners of the changes to
those properties, and your GUI will thereby get notified.
However, one thing to be aware of: PropertyChanged is a blocking call.
So if you need to do notificationsn of property changes during the audio
thread, you don't want to use PropertyChanged. A way around this is to
have private parameters (not reported in GetParameterList) that the GUI
installs parameter listeners for, and then send parameter change
notifications instead during the audio thread. AUParameterListenerNotify
is not blocking, unless a parameter listener has been installed with a 0
ms run loop thingy (which your GUI shouldn't do, probably, unless it can
insure quick return). So then you can use parameter notifications just as
a way of telling the GUI listener that it's one of the private properties
has changed, so it's time to go GetProperty it.
Marc
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.