AUEventListenerNotify and property changes in Leopard
AUEventListenerNotify and property changes in Leopard
- Subject: AUEventListenerNotify and property changes in Leopard
- From: Eric Gorouben <email@hidden>
- Date: Tue, 29 Jan 2008 14:32:44 +0100
Hi Bill,
Thanks for the reply.
No, it doesn't solve my problem. My question was about implementing a
virtual keyboard in my AU. In that case, I want the event to be
initiated in the view, not the AU (a dirty workaround at the moment
is to get a pointer to the AU instance with a property, and call it
from the view. But I can't keep such a hack!! ).
Here is the initial post, and Cynthia's advice:
De : Cynthia Maxwell <email@hidden>
Date : 14 janvier 2008 22:00:57 HNEC
À : Eric Gorouben <email@hidden>
Cc : CoreAudio API <email@hidden>
Objet : Rép : Virtual keyboard in an AUMonotimbralInstrumentBase:
how to?
Hi,
All you are looking to do is send a notification to your AU from
your view to call AUMonotimbralInstrumentBase ::RealTimeStartNote,
which then tells your note to Render.
You can do that via a property changed notification and pass along
a stuct with the key and velocity info.
Cynthia
On Jan 11, 2008, at 6:37 AM, Eric Gorouben wrote:
Hi there,
Sorry if my question seems obvious, but I can't find the answer.
I have a AUMonotimbralInstrumentBase AU, and I want to implement
a little virtual keyboard (just for rendering, no midi sent to
the host).
Is there a simple way to do this?
Thanks
E. Gorouben
Thanks
Eric
Le 29 janv. 08 à 04:00, William Stewart a écrit :
On Jan 26, 2008, at 1:45 AM, Eric Gorouben wrote:
Hi, there
1) I've seen in a previous thread that property changes should not
be notified through AUEventListenerNotify. I need to issu a
property changed notification from my AUCarbonViewBase to my AU.
No you don't.
If the property is changing, then your AU should be initiating the
property change, not your AU.
This works fine in Tiger:
void CGui::myNotify(){
AudioUnitEvent myEvent;
myEvent.mEventType = kAudioUnitEvent_PropertyChange;
myEvent.mArgument.mProperty.mAudioUnit = GetEditAudioUnit ();
myEvent.mArgument.mProperty.mPropertyID =
kAudioUnitProperty_MyProperty;
myEvent.mArgument.mProperty.mScope = kAudioUnitScope_Global;
myEvent.mArgument.mProperty.mElement = 0;
OSStatus err=AUEventListenerNotify(NULL,NULL,&myEvent);
fprintf(stderr,"myNotify err=%d\n",err);
}
But result, of course, is -50 in Leopard
Bill Stewart:
We normally don't expect the ListenerNotify to be called from
property changes, so that could be why you are seeing a
discrepancy here
and
You shouldn't need to make this call from within an AU - all you
need to do there is call the AUBase::PropertyChanged method
(which in turn will turn around and call of the registered
property change listeners iwth the AU).
But, from my AUCarbonViewBase, I can't call PropertyChanged.
What is the way to send a property changed notification from the
view to the AU?
In your AU, you call the PropertyChanged method
I try to follow Cynthia Maxwell's advice:
All you are looking to do is send a notification to your AU from
your view to call
AUMonotimbralInstrumentBase ::RealTimeStartNote, which then tells
your note to Render.
You can do that via a property changed notification and pass
along a stuct with the key and velocity info.
hmm... so if I understand it, you want to notify your view that a
note just started?
So, in the RealTimeStartNote implementation in your AU, you make
the AUBase::PropertyChanged call. Your view will then receive a
notification that the property it is interested in has changed, and
it can go and get the new value(s)
Does that make sense?
Bill
_______________________________________________
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