Parameters & Listeners & Host & Cocoa
Parameters & Listeners & Host & Cocoa
- Subject: Parameters & Listeners & Host & Cocoa
- From: "Mark's Studio" <email@hidden>
- Date: Tue, 25 Nov 2003 21:53:10 +0100
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.