Re: Parameters & Listeners & Host & Cocoa
Re: Parameters & Listeners & Host & Cocoa
- Subject: Re: Parameters & Listeners & Host & Cocoa
- From: William Stewart <email@hidden>
- Date: Wed, 3 Dec 2003 12:37:19 -0800
Yes, we'd realised that this was a shortcoming in the parameter control
mechanism, so we've added the begin and end gesture events to the new
AUEventListener that is available in both Jaguar (with QuicKTime 6.4 or
later as we updated Core Audio with that release as well), or Panther.
We will essentially deprecate the AU View Carbon methods here for
"mouse up" and "mouse down" - instead we expect both AU's and Hosts to
use the AUEventListener for these notifications.
The Cocoa View API we also published consequently does *not* have this
mouse down/up method - as this is supplanted by the new AU event types.
This also simplifies the hosting side of this, as a host can get these
notifications (or send them) and not have to do different things for
either carbon or cocoa UI's. This also removes the need for an AU to
get access to the "this" pointer of the Carbon View in order to do
these.
There maybe some lag time as host apps pick up this new API, but the
only way to get this adopted is for people to move over to it and
"push" the host apps into properly supporting this feature. A bit of
short term pain, for a longer term gain :)
Bill
On 01/12/2003, at 11:20 PM, Mark's Studio wrote:
On 2/12-2003, at 2:03, William Stewart wrote:
In the AU we don't expect that an AU would need to notify parameter
value changes (basically because it only should ever change parameter
values itself when):
(1) An API is called to change a parameter value
(2) The case above is called on a "meta" parameter - ie. a parameter
that can change the value of other parameters
(You can further specialise the definition of (2) to say "that can
change the value of any other published parameter" - ie. if you are
only changing internal parameter values, then strictly its not a meta
parameter).
So, if we start from there, what exactly is the scenario of the
problem you are describing?
If the AU is generating parameter changes based on analyzing the audio
and wants to write that as automation.
In logic i can get it to work by getting the listener from the
carbonview but it only works when the AU window in logic is in editor
mode,
is there a better way of doing it?
- (void) startAutomation:(id)sender;{
(*AUCarbonViewEventListener)(listenerUserData,
listenerComponentInstance, ¶meters[[sender
tag]],kAudioUnitCarbonViewEvent_MouseDownInControl, NULL);
}
- (void) updateAutomation:(id)sender;{
AUParameterListenerNotify(NULL,NULL,¶meters[[sender tag]]);
}
- (void) stopAutomation:(id)sender;{
(*AUCarbonViewEventListener)(listenerUserData,
listenerComponentInstance, ¶meters[[sender
tag]],kAudioUnitCarbonViewEvent_MouseUpInControl, NULL);
}
Bill
On 25/11/2003, at 12:53 PM, Mark's Studio wrote:
I'm very confused about the whole parameter thing
in my AuBase/MusicDevice class i have, and that works,
ComponentResult SampleEffectUnit::GetParameter(AudioUnitParameterID
inID,AudioUnitScope inScope,AudioUnitElement inElement,Float32
&outValue)
{
if (inScope==kAudioUnitScope_Global && inElement==0){
[[cocoaController synthOutlet] getParameter:inID value:&outValue];
return noErr;
}
return AUBase::GetParameter(inID, inScope, inElement, outValue);
}
ComponentResult SampleEffectUnit::SetParameter(AudioUnitParameterID
iID, AudioUnitScope iScope, AudioUnitElement iElem, Float32 rValue,
UInt32 iSchedule)
{
if (iScope==kAudioUnitScope_Global && iElem==0){
[[cocoaController synthOutlet] setParameter:iID value:rValue];
}
return AUBase::SetParameter(iID, iScope, iElem, rValue, iSchedule);
}
but how do i get the parameter changes in the Cocoa UI to the host? i
have tried
- (void)startListner{
AUListenerCreate(CocoaParameterListener, self,
CFRunLoopGetCurrent(),
kCFRunLoopDefaultMode, 0.100, &mParameterListener);
int i;
for(i=0;i<38;i++){
parameters[i].mAudioUnit = itsAU;
parameters[i].mParameterID = i;
parameters[i].mScope = kAudioUnitScope_Global;
parameters[i].mElement = 0;
AUParameterSet( mParameterListener, self, ¶meters[i], 0, 0);
AUListenerAddParameter (mParameterListener, NULL, ¶meters[i]);
}
}
and when i change a parameter i have tried both of these.
AudioUnitSetParameter(itsAU,34,kAudioUnitScope_Global,0,crossfade,0);
AUParameterSet( mParameterListener, self, ¶meters[34],
crossfade,
0);
but none of them seems to do anything to the host.
i just get lots of calls to the setParameter()
Thanks
Peter Mark
Mark's Recording Studio A/S
Lundeskovsvej 3
2900 Hellerup
Denmark
Tel: +45 35366078 Fax: +45 35366038
www.marks-studio.dk
email@hidden
_______________________________________________
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.
-- mailto:email@hidden
tel: +1 408 974 4056
______________________________________________________________________
_
___
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
______________________________________________________________________
_
___
Peter Mark
Mark's Recording Studio A/S
Lundeskovsvej 3
2900 Hellerup
Denmark
Tel: +45 35366078 Fax: +45 35366038
www.marks-studio.dk
email@hidden
_______________________________________________
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.
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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.