pub struct ClipTimes<'a> { /* private fields */ }Expand description
A clip’s time map with its stretches worked out, for asking where it shows source times.
Built once per clip and asked many times: every question walks the stretches and searches only those whose shown times can hold the answer.
Implementations§
Source§impl<'a> ClipTimes<'a>
impl<'a> ClipTimes<'a>
Sourcepub fn new(
timeline: TimeRange,
source: TimeRange,
time_map: &'a TimeMap,
frame_rate: FrameRate,
) -> Option<Self>
pub fn new( timeline: TimeRange, source: TimeRange, time_map: &'a TimeMap, frame_rate: FrameRate, ) -> Option<Self>
The stretches of a clip of the two ranges under time_map, with pictures mirrored by
project frames at frame_rate. None for a time beyond ticks or more stretches than a
valid clip has.
Sourcepub fn stretches(&self) -> &[Stretch]
pub fn stretches(&self) -> &[Stretch]
The stretches in timeline order; together they cover the clip.
Sourcepub fn timeline_ranges(
&self,
range_start: MediaTime,
range_end: MediaTime,
) -> Option<Vec<TimeRange>>
pub fn timeline_ranges( &self, range_start: MediaTime, range_end: MediaTime, ) -> Option<Vec<TimeRange>>
The timeline ranges at which the clip’s picture shows a source time in
[range_start, range_end), in timeline order and disjoint. None for a range beyond
ticks.
Sourcepub fn timeline_times(&self, instant: MediaTime) -> Vec<MediaTime>
pub fn timeline_times(&self, instant: MediaTime) -> Vec<MediaTime>
The timeline times at which the clip’s picture reaches source time instant: per
stretch that passes it, the first tick at which the shown time has reached it in that
stretch’s direction. A still stretch passes nothing.