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. It sorts the clips’ intervals once:
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.
The document’s schema_version is read first: a document of another
version reports ModelError::UnsupportedSchemaVersion rather than
whatever shape difference the versions have.
§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 the media nodes its compositions draw read.
A clip’s compositions are the one it names and, for a composition
source, the source’s when the one it names draws the clip
(crate::CompositionReads::draws_clip). From a composition’s output
the walk follows the inputs drawing a node reads
(crate::CompositionReads::needed_inputs, as the renderer plans
them), into the composition a group node draws and the one a
composition source a media node reads shows. So an unconnected node, a
composition nothing shows, the inputs a bypassed node passes over, and
the group ports a group’s composition never reads read nothing. An
unconnected input the output needs fails those frames; what the
connected inputs read is still used.
Sourcepub fn hdr_sources(&self) -> Vec<&SourceId>
pub fn hdr_sources(&self) -> Vec<&SourceId>
Returns the HDR sources, which the project tone-maps or refuses as its
ColorPipeline says: those whose color is PQ or HLG, or declared
HDR, as the renderer decides (alpha2_media::ColorMetadata::is_hdr).
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 generator in a source or a composition. A host whose project draws none needs no fonts and prepares no text.