pub struct Clip {Show 35 fields
pub id: u64,
pub link: u64,
pub kind: ClipKind,
pub container: bool,
pub container_label: String,
pub asset: u64,
pub name: String,
pub start: f64,
pub duration: f64,
pub src_in: f64,
pub audio_stream: usize,
pub sequence: u64,
pub enabled: bool,
pub label: u8,
pub speed: f64,
pub speed_curve: Animated,
pub reverse: bool,
pub freeze: Option<f64>,
pub x: Animated,
pub y: Animated,
pub scale: Animated,
pub rotation: Animated,
pub opacity: Animated,
pub blend: BlendMode,
pub effects: Vec<Effect>,
pub volume: Animated,
pub pan: Animated,
pub fade_in: f64,
pub fade_out: f64,
pub bus: u64,
pub text: Option<TextStyle>,
pub shape: Option<ShapeStyle>,
pub mask: Option<Mask>,
pub graph: Option<NodeGraph>,
pub markers: Vec<Marker>,
}Fields§
§id: u64§link: u64Clips sharing a non-zero link id move/split/delete together (video + its audio).
kind: ClipKind§container: boolTrue when this clip is a container (slot) whose media can be replaced without losing effects/transforms.
container_label: StringUser-facing label for the container slot (e.g. “Main Shot”, “B-Roll 1”). Empty = unnamed.
asset: u64Asset id (0 for Text clips).
name: String§start: f64Timeline start (seconds).
duration: f64§src_in: f64Earliest source time used by the clip (the source window is [src_in, src_in + duration*speed)).
audio_stream: usizeFor Audio clips: which audio stream of the asset (0-based among audio streams).
sequence: u64For Sequence clips: the nested timeline id.
enabled: bool§label: u8Colour label shown on the timeline: 0 = inherit the asset’s label, 1..=8 = LABEL_COLORS index + 1.
speed: f64Playback rate (1 = normal, 2 = twice as fast, 0.5 = half speed). Always > 0.
speed_curve: AnimatedKeyframed speed ramp (curve editor). Only consulted while it has keys — the constant speed
above still owns the source window and the duration.
reverse: boolPlay the source window backwards.
freeze: Option<f64>Freeze frame: show/hold the source frame at this source time for the whole clip (audio is silent).
x: Animated§y: Animated§scale: Animated§rotation: Animated§opacity: Animated§blend: BlendMode§effects: Vec<Effect>Effect stack, applied in order before blending.
volume: AnimatedLinear gain (1 = unity).
pan: Animated-1 = left … 0 = centre … 1 = right.
fade_in: f64Fade in/out lengths in seconds (gain ramps at the clip edges).
fade_out: f64§bus: u64Which bus this audio clip feeds (0 = its track’s bus).
text: Option<TextStyle>Present for Text clips.
shape: Option<ShapeStyle>Present for Shape clips.
mask: Option<Mask>Limits where the whole clip is visible.
graph: Option<NodeGraph>Node graph; when present it replaces effects for rendering.
markers: Vec<Marker>Clip-local markers.
Implementations§
Source§impl Clip
impl Clip
pub fn new( id: u64, kind: ClipKind, name: impl Into<String>, start: f64, duration: f64, ) -> Self
Sourcepub fn is_empty_container(&self) -> bool
pub fn is_empty_container(&self) -> bool
True when this container has no media (asset == 0 for video/image/audio).
pub fn end(&self) -> f64
Sourcepub fn fade_mult(&self, lt: f64) -> f64
pub fn fade_mult(&self, lt: f64) -> f64
Gain/opacity multiplier of the fade in/out ramps at clip-local time lt. Time is clamped
into the clip so virtual transition extensions hold the edge value (mixer rule).
Sourcepub fn rate(&self, l: f64) -> f64
pub fn rate(&self, l: f64) -> f64
Playback rate at clip-local time l (the ramp when keyframed, else the constant).
Sourcepub fn src_time(&self, t: f64) -> f64
pub fn src_time(&self, t: f64) -> f64
Source media time at timeline time t (speed, reverse and freeze applied).
pub fn is_visual(&self) -> bool
Sourcepub fn draws(&self) -> bool
pub fn draws(&self) -> bool
Draws pixels of its own (an Adjustment layer only re-processes what is below it).
pub fn uses_asset(&self) -> bool
Sourcepub fn uses_graph(&self) -> bool
pub fn uses_graph(&self) -> bool
Does the renderer evaluate the node graph instead of the linear effect stack? The node editor is opt-in: a bare Input→Output graph says nothing the stack does not, so it never shadows it — otherwise a clip that once had the node pane pointed at it could never take a plain effect again.
Sourcepub fn is_retimed(&self) -> bool
pub fn is_retimed(&self) -> bool
Speed, reverse or freeze in effect.
Sourcepub fn has_effects(&self) -> bool
pub fn has_effects(&self) -> bool
Anything that needs re-rendering (disqualifies a lossless -c copy export).
Sourcepub fn set_speed(&mut self, speed: f64)
pub fn set_speed(&mut self, speed: f64)
Change the playback rate keeping the source window and the timeline start (duration follows).
pub fn animated(&self) -> [&Animated; 8]
Sourcepub fn all_animated_mut(&mut self) -> Vec<&mut Animated>
pub fn all_animated_mut(&mut self) -> Vec<&mut Animated>
Every keyframeable property including effect parameters.
pub fn all_animated(&self) -> Vec<&Animated>
Sourcepub fn props_mut(&mut self) -> Vec<(&'static str, &mut Animated)>
pub fn props_mut(&mut self) -> Vec<(&'static str, &mut Animated)>
(label, property) pairs for the inspector — visual ones for visual clips, volume/pan for audio.
Sourcepub fn key_times(&self) -> Vec<f64>
pub fn key_times(&self) -> Vec<f64>
Sorted, de-duplicated clip-local keyframe times across all properties (for drawing diamonds).
Sourcepub fn shift_keys(&mut self, dt: f64)
pub fn shift_keys(&mut self, dt: f64)
Shift every keyframe (all properties, effects included) by dt.
Sourcepub fn move_keys(&mut self, t_old: f64, t_new: f64)
pub fn move_keys(&mut self, t_old: f64, t_new: f64)
Move every keyframe sitting at clip-local t_old to t_new (clamped inside the clip).
Sourcepub fn split(&mut self, t: f64, new_id: u64) -> Option<Clip>
pub fn split(&mut self, t: f64, new_id: u64) -> Option<Clip>
Split at timeline time t. self becomes the left part; returns the right part with new_id.
None if t is not strictly inside the clip. Speed/reverse aware.
Sourcepub fn trim_start(&mut self, new_start: f64, headroom: f64)
pub fn trim_start(&mut self, new_start: f64, headroom: f64)
Move the left edge to new_start, keeping the right edge fixed (slip-trim).
headroom = source seconds available before the left edge (Project::head_room), INFINITY = unbounded.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Clip
impl<'de> Deserialize<'de> for Clip
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Clip
impl RefUnwindSafe for Clip
impl Send for Clip
impl Sync for Clip
impl Unpin for Clip
impl UnwindSafe for Clip
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more