Skip to main content

LegacyTimeline

Struct LegacyTimeline 

Source
pub struct LegacyTimeline<T: Timeline + Send> { /* private fields */ }
Expand description

Adapts an old closure-based Timeline to the new TimelineComponent model so the existing demo scene (which still builds a Timeline) can be served by the migrated collection without rewriting it.

A Timeline is opaque (a closure with a fixed duration), so this presents it as a single timed leaf: its frame plays the timeline at the global clock, its length is the timeline’s duration, and its arrangement is one Video-kind node spanning [0, duration].

TimelineComponent requires PartialEq + Hash (via the DynEq/DynHash super-traits). A Timeline closure is neither, and timeline nodes are never memoized through ctx.render (.sketch/02 §11) — this identity is only the builder-marker key — so the wrapper compares all instances equal and hashes to a constant. There is exactly one per collection, so that is sound.

Implementations§

Source§

impl<T: Timeline + Send> LegacyTimeline<T>

Source

pub fn new(timeline: T) -> Self

Wraps timeline so it can be placed in the new timeline world.

Trait Implementations§

Source§

impl<T: Timeline + Send> Eq for LegacyTimeline<T>

Source§

impl<T: Timeline + Send> Hash for LegacyTimeline<T>

Source§

fn hash<H: Hasher>(&self, _state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: Timeline + Send> PartialEq for LegacyTimeline<T>

Source§

fn eq(&self, _other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Timeline + Send + 'static> TimelineComponent for LegacyTimeline<T>

Source§

fn duration(&self) -> Option<f32>

Intrinsic length in seconds, or None for a timeless component (a visual / 字幕) whose length is given by the window it is placed into. Read more
Source§

fn frame( &self, clock: Clock<'_>, canvas: Vec2, target: Resolution, ctx: &mut dyn RenderContext, ) -> Option<RasterImage>

Visual channel for this frame. clock carries both time axes (see Clock); canvas is the composition’s fixed LOGICAL layout space (resolution-independent), which the pixel target scales. None ⇒ contributes nothing visually.
Source§

fn arrangement(&self, offset: f32) -> Arrangement

What the live UI draws: kind + label, plus the node’s RESOLVED absolute interval and any Event trigger times. Read more
Source§

fn measure(&self) -> Option<f32>

Bottom-up intrinsic duration for the resolve pass’s measure phase (.sketch/02 §5). Defaults to duration; containers override to fold over their children. Read more
Source§

fn resolve(&self, abs_start: f32, out: &mut ResolveCtx) -> f32

Top-down place hook (.sketch/02 §6). Walks self and, for a container, recurses over its OWN children via &self recursion — assigning each an absolute start and recording Event trigger times into out — returning this node’s resolved length. Read more
Source§

fn samples(&self, clock: Clock<'_>, window: f32) -> Option<AudioBuffer>

Audio channel for [clock, clock + window). None ⇒ silent.
Source§

fn mix_into(&self, mix: &mut AudioMix, start_secs: f32, speed: f32)

Eager mix-down hook (step 8, B4 v1 — .sketch/01 ZONE C / .sketch/02 §15). Contributes this node’s audio into mix (a fixed rate / channel layout buffer for [0, duration]), placing it at the absolute start_secs and accounting for the accumulated placement speed. Read more
Source§

fn cues(&self, offset: f32) -> Vec<Cue>

Subtitle channel: cues made absolute by adding offset (this component’s resolved start). Collected once at export.
Source§

fn structural_any(&self) -> &(dyn Any + 'static)

The STRUCTURAL &dyn Any behind this component, peeling any transparent decorator. A container inspecting a child’s concrete type (e.g. downcasting to Placed to detect a .fill()) must go through this, not DynEq::as_any, so a wrapping Sourced (which the generated .child(...) setter adds to capture the call site) does not hide the real child. Defaults to self — only a decorator like Sourced overrides it to forward to its inner component.

Auto Trait Implementations§

§

impl<T> Freeze for LegacyTimeline<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for LegacyTimeline<T>
where T: RefUnwindSafe,

§

impl<T> Send for LegacyTimeline<T>

§

impl<T> Sync for LegacyTimeline<T>
where T: Sync,

§

impl<T> Unpin for LegacyTimeline<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for LegacyTimeline<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for LegacyTimeline<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DynEq for T
where T: PartialEq + Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

fn dyn_eq(&self, other: &(dyn Any + 'static)) -> bool

Source§

fn type_name(&self) -> &'static str

Concrete type name behind this trait object, suitable for diagnostics (e.g. tellur_renderer::shadow::DropShadow). Backed by std::any::type_name specialized to the impl’s Self, so callers can introspect a &dyn Component without a downcast.
Source§

impl<T> DynHash for T
where T: Hash + ?Sized,

Source§

fn dyn_hash(&self, state: &mut dyn Hasher)

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Timed for T
where T: TimelineComponent + Send + 'static,

Source§

fn at(self, placement: impl Into<Placement>) -> Placed

Place on the parent clock. .at(2.0) plays at native speed for the component’s own duration; .at(0.0..3.0) places it into an explicit window (a stretch for a timed component, an interval for a timeless one).
Source§

fn fill(self) -> Placed

Stretch to the CONTAINER’s resolved length — the one declarative length verb. Valid ONLY in an overlay Timeline (inside a Sequence it is a compile/resolve error). Fill children are excluded from the container’s length measure (the load-bearing invariant), so this never forms a cycle.
Source§

fn trim(self, _r: Range<f32>) -> Self

Use only SOURCE seconds a..b (the in/out crop). The way to truncate (a short .at window stretches, it does not cut). Read more
Source§

impl<T> Triggers for T

Source§

fn trigger_at_start(self, e: Event) -> Triggered<Self>

Records the Event at the wrapped node’s resolved START (the abs_start the parent hands this wrapper). See the trait-level VERB ORDERING note: trigger outermost (or trigger a container-positioned child), not x.at(off).trigger_at_start(e) — that records at the wrapper’s start, NOT accounting for the inner placement’s off.
Source§

fn trigger_at_end(self, e: Event) -> Triggered<Self>

Source§

fn trigger_at(self, local: f32, e: Event) -> Triggered<Self>

At a local offset into the clip (an interior beat).
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.