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,
}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.
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 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
Returns ProjectLoadError for malformed, unsupported, or structurally invalid
documents.
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.