sync method
void
sync({})
Implementation
void sync({
required int frame,
required int fps,
required bool playing,
bool seek = false,
bool restart = false,
}) {
if (_disposed) return;
final inRange = frame >= audioItem.startFrame && frame < audioItem.endFrame;
final position = Duration(
milliseconds:
audioItem.startTime +
((frame - audioItem.startFrame) * 1000 / fps).round(),
);
final changed =
inRange != _inRange || playing != _playing || seek || restart;
_inRange = inRange;
_playing = playing;
_position = position;
_seek |= seek;
_restart |= restart;
if (changed) _schedule();
}