pub struct Project {
pub schema_version: u32,
pub id: ProjectId,
pub name: String,
pub settings: ProjectSettings,
pub sources: Vec<MediaSource>,
pub effect_resources: Vec<EffectResource>,
pub compositions: Vec<Composition>,
pub timeline: Timeline,
pub audio: MasterAudio,
pub data: Vec<DataSet>,
}Expand description
A complete serializable project document.
Fields§
§schema_version: u32Version used to serialize this document.
id: ProjectIdStable identity of this project.
name: StringHuman-readable project name. It has no semantic meaning.
settings: ProjectSettingsOutput-wide timeline settings.
sources: Vec<MediaSource>Media resources referenced by clips.
effect_resources: Vec<EffectResource>Non-media resources referenced by effect invocations.
compositions: Vec<Composition>Composition graphs that clips show.
timeline: TimelineOrdered visual and audio tracks.
audio: MasterAudioMaster bus applied to the summed track audio.
data: Vec<DataSet>Values derived from media that properties and caption tracks can follow.
At most crate::MAX_DATA_SETS.
Implementations§
Source§impl Project
impl Project
Sourcepub fn audio_effect_load(&self) -> AudioEffectLoad
pub fn audio_effect_load(&self) -> AudioEffectLoad
Measures the most audio effect state this project holds at once, which validation bounds
by crate::MAX_AUDIO_EFFECTS and crate::MAX_AUDIO_DELAY_MS. O(n log n) in the clips
with effects.
Source§impl Project
impl Project
Sourcepub fn stale_data(
&self,
is_stale: impl FnMut(&SourceId, &MediaFingerprint) -> bool,
) -> Vec<LintIssue>
pub fn stale_data( &self, is_stale: impl FnMut(&SourceId, &MediaFingerprint) -> bool, ) -> Vec<LintIssue>
LintIssue::StaleData for each source-anchored data set with a made_from that
is_stale judges different from its source’s current fingerprint, in data order.
Hosts pass their fingerprint comparison; the model holds no current fingerprints.
Source§impl Project
impl Project
Sourcepub fn from_json(json: &str) -> Result<Self, ProjectLoadError>
pub fn from_json(json: &str) -> Result<Self, ProjectLoadError>
Parses and validates a serialized project document.
schema_version is read first, so a document of another version reports
ModelError::UnsupportedSchemaVersion rather than a shape error.
§Errors
ProjectLoadError for a malformed, unsupported, or structurally invalid document.
Sourcepub fn to_json(&self) -> Result<String, ProjectWriteError>
pub fn to_json(&self) -> Result<String, ProjectWriteError>
The document as compact JSON, refused once it passes MAX_PROJECT_JSON_BYTES, so a
writer never hands out text Project::from_json would refuse. Writing stops at the cap.
§Errors
ProjectWriteError::TooLarge past the cap.
§Panics
Never; serde_json writes UTF-8.
Sourcepub fn used_sources(&self) -> Vec<&MediaSource>
pub fn used_sources(&self) -> Vec<&MediaSource>
The sources a render of this project can read, in source order: each clip’s own, and those read by media nodes its compositions draw.
From a composition’s output the walk follows the inputs each node reads
(crate::CompositionReads::needed_inputs, as the renderer plans them), into group and
composition-source compositions. A composition source counts only where the clip’s own
composition draws the clip (crate::CompositionReads::draws_clip). Unconnected nodes,
unshown compositions, inputs a bypassed node skips and unread group ports read nothing.
Sourcepub fn hdr_sources(&self) -> Vec<&SourceId>
pub fn hdr_sources(&self) -> Vec<&SourceId>
Returns the HDR sources (PQ, HLG or declared HDR, per
alpha2_media::ColorMetadata::is_hdr), which the project tone-maps or refuses as its
ColorPipeline says.
Sourcepub fn draws_text(&self) -> bool
pub fn draws_text(&self) -> bool
Whether anything in the project may draw text: a caption track, or a text or layout generator in a source or composition. A project that draws none needs no fonts. Layouts count even without text because the text host resolves them.
Sourcepub fn extent(&self) -> Option<TimeRange>
pub fn extent(&self) -> Option<TimeRange>
The smallest interval holding every clip, caption cue and timeline-anchored word a caption
track shows. None for a project that shows nothing.
Sourcepub fn default_export_range(&self) -> Option<TimeRange>
pub fn default_export_range(&self) -> Option<TimeRange>
The range a whole-project export covers when none is asked for: from time 0, the origin
keyframes, markers and caption times count from, to the end of the Self::extent.
None for a project that shows nothing or nothing after time 0.
Source§impl Project
impl Project
Sourcepub fn for_each_timeline_value_mut(
&mut self,
visit: &mut dyn FnMut(TimelineOwner<'_>, &'static str, &mut dyn TimelineValue),
)
pub fn for_each_timeline_value_mut( &mut self, visit: &mut dyn FnMut(TimelineOwner<'_>, &'static str, &mut dyn TimelineValue), )
Calls visit with every value keyed in timeline time and its owner: the clip values and
transition parameters of each track in order, then Self::for_each_bus_value_mut.
Sourcepub fn for_each_bus_value_mut(
&mut self,
visit: &mut dyn FnMut(TimelineOwner<'_>, &'static str, &mut Animated<f32>),
)
pub fn for_each_bus_value_mut( &mut self, visit: &mut dyn FnMut(TimelineOwner<'_>, &'static str, &mut Animated<f32>), )
Calls visit with each bus value keyed in timeline time: the gain and pan of each track
in order, then the master gain.
Sourcepub fn for_each_clip_reference_mut(
&mut self,
visit: &mut dyn FnMut(TimelineOwner<'_>, ClipReference, &mut ClipId),
)
pub fn for_each_clip_reference_mut( &mut self, visit: &mut dyn FnMut(TimelineOwner<'_>, ClipReference, &mut ClipId), )
Calls visit with every reference from one part of the timeline to a clip: mattes,
transition clips and via: { clip } bindings, in the order of
Self::for_each_timeline_value_mut.