syncBuffer method
Syncs events to the backend. This should be called after making changes to track events to ensure that the changes are synced immediately.
Implementation
void syncBuffer(
[int? absoluteStartFrame, int maxEventsToSync = BUFFER_SIZE]) {
final position = NativeBridge.getPosition();
if (absoluteStartFrame == null) {
absoluteStartFrame = position;
} else {
absoluteStartFrame = max(absoluteStartFrame, position);
}
NativeBridge.clearEvents(id, absoluteStartFrame);
if (sequence.isPlaying) {
final relativeStartFrame = absoluteStartFrame - sequence.engineStartFrame;
_scheduleEvents(relativeStartFrame, maxEventsToSync);
} else {
lastFrameSynced = 0;
}
}