pub struct Project {
pub clips: Vec<Clip>,
pub overlays: Vec<Overlay>,
pub markers: Vec<Marker>,
/* private fields */
}Expand description
A film’s edits.
Fields§
§clips: Vec<Clip>The main track, in order.
overlays: Vec<Overlay>What goes over it.
markers: Vec<Marker>The chapters added in the editor.
Implementations§
Source§impl Project
impl Project
Sourcepub fn duration_ms(&self) -> u64
pub fn duration_ms(&self) -> u64
How long it all lasts.
Sourcepub fn clip_start_ms(&self, clip: usize) -> u64
pub fn clip_start_ms(&self, clip: usize) -> u64
When a clip starts on the timeline.
Sourcepub fn clip_at(&self, ms: u64) -> Option<usize>
pub fn clip_at(&self, ms: u64) -> Option<usize>
The clip on the timeline at ms. The very end belongs to the last clip.
Sourcepub fn film_to_timeline(&self, film_ms: u64) -> Option<u64>
pub fn film_to_timeline(&self, film_ms: u64) -> Option<u64>
Where a moment of the film ended up on the timeline; None if it was cut.
Sourcepub fn split(&mut self, ms: u64) -> bool
pub fn split(&mut self, ms: u64) -> bool
Cuts the clip under ms in two there. Overlays stay where they are.
Returns false when ms is too near a clip’s edge to leave two pieces.
Sourcepub fn delete_clip(&mut self, index: usize)
pub fn delete_clip(&mut self, index: usize)
Takes a clip out and closes the gap: overlays after it come along, those over it get shorter, and those only over it go.
Sourcepub fn set_speed(&mut self, index: usize, speed: f32)
pub fn set_speed(&mut self, index: usize, speed: f32)
Changes how fast a clip plays, which moves what comes after it.
Sourcepub fn trim_start(&mut self, index: usize, ms: i64)
pub fn trim_start(&mut self, index: usize, ms: i64)
Moves the start of a film clip by ms of the timeline. What comes after follows.
Sourcepub fn trim_end(&mut self, index: usize, ms: i64)
pub fn trim_end(&mut self, index: usize, ms: i64)
Moves the end of a film clip by ms of the timeline. What comes after follows.
Sourcepub fn insert_title(
&mut self,
ms: u64,
title: &str,
subtitle: &str,
duration_ms: u64,
) -> usize
pub fn insert_title( &mut self, ms: u64, title: &str, subtitle: &str, duration_ms: u64, ) -> usize
Puts a card in at ms, cutting the clip there if needed. What is after it moves on.
Sourcepub fn insert_card(
&mut self,
ms: u64,
title: &str,
subtitle: &str,
duration_ms: u64,
look: CardLook,
) -> usize
pub fn insert_card( &mut self, ms: u64, title: &str, subtitle: &str, duration_ms: u64, look: CardLook, ) -> usize
A Self::insert_title of a look: an opening at 0, a farewell at the end.
Sourcepub fn add_overlay(
&mut self,
kind: OverlayKind,
start_ms: u64,
duration_ms: u64,
) -> u64
pub fn add_overlay( &mut self, kind: OverlayKind, start_ms: u64, duration_ms: u64, ) -> u64
Adds an overlay on the first track free for its time, and says which it is.
Sourcepub fn overlay_mut(&mut self, id: u64) -> Option<&mut Overlay>
pub fn overlay_mut(&mut self, id: u64) -> Option<&mut Overlay>
An overlay by its identity.
Sourcepub fn remove_overlay(&mut self, id: u64)
pub fn remove_overlay(&mut self, id: u64)
Takes an overlay out.
Sourcepub fn track_count(&self) -> usize
pub fn track_count(&self) -> usize
How many tracks of overlays there are.