getParallelAtTime method

SmilParallel? getParallelAtTime(
  1. Duration currentTime
)

Returns the SmilParallel corresponding to currentTime.

Returns null if the section has no audio version.

Implementation

SmilParallel? getParallelAtTime(Duration currentTime) {
  if (!hasAudio) return null;
  assert(currentTime <= audioDuration!);

  final parallel = smilParallels.firstWhere(
    (par) => currentTime >= par.clipBegin && currentTime <= par.clipEnd,
  );

  return parallel;
}