pub struct EngineProject { /* private fields */ }Expand description
An immutable project snapshot and its reusable evaluation index.
Implementations§
Source§impl EngineProject
impl EngineProject
Sourcepub fn new(project: Project) -> Result<Self, EvalError>
pub fn new(project: Project) -> Result<Self, EvalError>
Validates a project and builds its active interval index.
§Errors
Returns an evaluation error when the project is structurally invalid.
Sourcepub const fn generation(&self) -> u64
pub const fn generation(&self) -> u64
Which snapshot this is: unique among the snapshots this process has
made, and shared by a snapshot’s clones, which hold the same project.
An crate::Exporter renders only the snapshot it was made for.
Sourcepub const fn draws_text(&self) -> bool
pub const fn draws_text(&self) -> bool
Whether any frame may draw text (Project::draws_text), so a host
must prepare it (crate::TextTextures::prepare_at).
Sourcepub fn evaluate(&self, time: MediaTime) -> Result<FrameDesc<'_>, EvalError>
pub fn evaluate(&self, time: MediaTime) -> Result<FrameDesc<'_>, EvalError>
Evaluates a deterministic frame description.
§Errors
Returns an error if the immutable index and project disagree.
Sourcepub fn frame_needs(&self, time: MediaTime) -> Result<Vec<FrameNeed>, EvalError>
pub fn frame_needs(&self, time: MediaTime) -> Result<Vec<FrameNeed>, EvalError>
Returns the host frames needed at a timeline timestamp.
§Errors
Returns an error if the immutable index and project disagree.
Sourcepub fn evaluate_audio(
&self,
range: TimeRange,
) -> Result<AudioSpanDesc<'_>, EvalError>
pub fn evaluate_audio( &self, range: TimeRange, ) -> Result<AudioSpanDesc<'_>, EvalError>
Evaluates every audio clip overlapping a half-open timeline span.
§Errors
Returns an error if the immutable index and project disagree.
Sourcepub fn evaluate_audio_in<'s>(
&self,
range: TimeRange,
scratch: &'s mut AudioSpanScratch,
) -> Result<AudioSpan<'_, 's>, EvalError>
pub fn evaluate_audio_in<'s>( &self, range: TimeRange, scratch: &'s mut AudioSpanScratch, ) -> Result<AudioSpan<'_, 's>, EvalError>
Evaluates the same clips as Self::evaluate_audio into reusable
memory, allocating nothing once scratch has grown to the span.
§Errors
Returns an error if the immutable index and project disagree.
Sourcepub fn timeline_range(&self) -> Option<TimeRange>
pub fn timeline_range(&self) -> Option<TimeRange>
Returns the smallest interval holding everything the timeline shows,
caption cues included (alpha2_model::Timeline::extent).
Sourcepub fn effects(&self) -> Vec<(&str, u32)>
pub fn effects(&self) -> Vec<(&str, u32)>
Every effect the project can draw, by id and version, each once in order: those of the compositions its clips show or draw as their source, and its transitions’. A composition that cannot draw its output is reported when a frame shows it.
Sourcepub fn check_effects(&self, renderer: &Renderer) -> Result<(), EngineError>
pub fn check_effects(&self, renderer: &Renderer) -> Result<(), EngineError>
Checks that renderer can draw every effect the project uses
(Self::effects).
§Errors
Returns crate::EngineError::UnregisteredEffect naming the first one
it cannot.