pub struct NestedSequence {
pub id: SequenceId,
pub name: String,
pub frame_rate: Rational,
pub duration: i64,
pub resolution: (u32, u32),
pub track_count: u32,
pub nested_refs: Vec<NestedSequenceRef>,
}Expand description
A sequence (timeline) that can be nested inside other sequences.
Fields§
§id: SequenceIdUnique identifier.
name: StringHuman-readable name.
frame_rate: RationalFrame rate of this sequence, expressed as a Rational (e.g. Rational::new(24, 1)).
duration: i64Total duration in timebase units.
resolution: (u32, u32)Resolution in pixels: (width, height). Defaults to (1920, 1080).
track_count: u32Number of tracks in this sequence.
nested_refs: Vec<NestedSequenceRef>Nested references within this sequence (sub-sub-sequences).
Implementations§
Source§impl NestedSequence
impl NestedSequence
Sourcepub fn new(
id: SequenceId,
name: impl Into<String>,
frame_rate: Rational,
) -> Self
pub fn new( id: SequenceId, name: impl Into<String>, frame_rate: Rational, ) -> Self
Create a new sequence with default 1920×1080 resolution.
Sourcepub fn with_duration(self, duration: i64) -> Self
pub fn with_duration(self, duration: i64) -> Self
Builder: set duration.
Sourcepub fn with_resolution(self, width: u32, height: u32) -> Self
pub fn with_resolution(self, width: u32, height: u32) -> Self
Builder: set resolution.
Sourcepub fn with_track_count(self, count: u32) -> Self
pub fn with_track_count(self, count: u32) -> Self
Builder: set track count.
Sourcepub fn add_ref(&mut self, r: NestedSequenceRef)
pub fn add_ref(&mut self, r: NestedSequenceRef)
Add a nested reference.
Sourcepub fn remove_ref(&mut self, child_id: SequenceId) -> usize
pub fn remove_ref(&mut self, child_id: SequenceId) -> usize
Remove a nested reference by child sequence ID.
Sourcepub fn references(&self, child_id: SequenceId) -> bool
pub fn references(&self, child_id: SequenceId) -> bool
Returns true if this sequence contains a reference to child_id.
Sourcepub fn duration_in_outer_timebase(&self, outer_rate: Rational) -> i64
pub fn duration_in_outer_timebase(&self, outer_rate: Rational) -> i64
Compute the duration of this sequence in an outer (parent) timebase.
Uses integer rounding (nearest-frame) to convert from this sequence’s
own frame_rate into outer_rate. All three ConformMethod variants
produce the same duration accounting; FrameBlend and OpticalFlow
differ only in render quality, not timeline length.
§Returns
The number of outer_rate units required to represent this sequence’s
full duration. Returns 0 if either rate has a zero component.
§Example
use oximedia_core::Rational;
use oximedia_edit::nested_sequence::{NestedSequence, SequenceId};
// 24 inner frames at 24 fps = 1 second = 60 frames at 60 fps
let seq = NestedSequence::new(SequenceId(1), "Clip", Rational::new(24, 1))
.with_duration(24);
let outer = seq.duration_in_outer_timebase(Rational::new(60, 1));
assert_eq!(outer, 60);Trait Implementations§
Source§impl Clone for NestedSequence
impl Clone for NestedSequence
Source§fn clone(&self) -> NestedSequence
fn clone(&self) -> NestedSequence
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for NestedSequence
impl RefUnwindSafe for NestedSequence
impl Send for NestedSequence
impl Sync for NestedSequence
impl Unpin for NestedSequence
impl UnsafeUnpin for NestedSequence
impl UnwindSafe for NestedSequence
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more