I built a plug-in which is designed to control a remote wave field synthesis (wfs) system. Each instance of the plugin controls a source at the wfs system and the audio on the track played back by the host (usually Logic) is routed out to the wfs system. The plugin has a custom Carbon view which incorporates an xy panel for controlling source position. The problem I have is that when writing automation data for 2 parameters simultaneously the mouse up notifications to the host for the second parameter do not take effect. This is the case for Logic but I have not tried it with other hosts. I found a workaround which is to send a begin parameter change gesture notification before sending the end parameter change notification like so,
const CAAUParameter param(GetComponentInstance(), parameterIndex, kAudioUnitScope_Global, 0);
AudioUnitEvent auEvent;
auEvent.mArgument.mParameter = param;
if (mousedown) {
auEvent.mEventType = kAudioUnitEvent_BeginParameterChangeGesture;
AUEventListenerNotify(m_ParameterListenerOnAU, this, &auEvent);
} else {
auEvent.mEventType = kAudioUnitEvent_BeginParameterChangeGesture;
AUEventListenerNotify(m_ParameterListenerOnAU, this, &auEvent);
auEvent.mEventType = kAudioUnitEvent_EndParameterChangeGesture;
AUEventListenerNotify(m_ParameterListenerOnAU, this, &auEvent);
}
Is there a more correct way of performing this as I would like the code to stay effective in future releases of the SDK.