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§
Trait Implementations§
impl<T: Timeline + Send> Eq for LegacyTimeline<T>
Source§impl<T: Timeline + Send + 'static> TimelineComponent for LegacyTimeline<T>
impl<T: Timeline + Send + 'static> TimelineComponent for LegacyTimeline<T>
Source§fn duration(&self) -> Option<f32>
fn duration(&self) -> Option<f32>
None for a timeless component (a
visual / 字幕) whose length is given by the window it is placed into. Read moreSource§fn frame(
&self,
clock: Clock<'_>,
canvas: Vec2,
target: Resolution,
ctx: &mut dyn RenderContext,
) -> Option<RasterImage>
fn frame( &self, clock: Clock<'_>, canvas: Vec2, target: Resolution, ctx: &mut dyn RenderContext, ) -> Option<RasterImage>
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
fn arrangement(&self, offset: f32) -> Arrangement
Source§fn samples(&self, clock: Clock<'_>, window: f32) -> Option<AudioBuffer>
fn samples(&self, clock: Clock<'_>, window: f32) -> Option<AudioBuffer>
[clock, clock + window). None ⇒ silent.Source§fn mix_into(&self, mix: &mut AudioMix, start_secs: f32, speed: f32)
fn mix_into(&self, mix: &mut AudioMix, start_secs: f32, speed: f32)
.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 moreSource§fn cues(&self, offset: f32) -> Vec<Cue>
fn cues(&self, offset: f32) -> Vec<Cue>
offset (this
component’s resolved start). Collected once at export.Source§fn structural_any(&self) -> &(dyn Any + 'static)
fn structural_any(&self) -> &(dyn Any + 'static)
&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> 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
Source§impl<T> DynEq for T
impl<T> DynEq for T
fn as_any(&self) -> &(dyn Any + 'static)
fn dyn_eq(&self, other: &(dyn Any + 'static)) -> bool
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Timed for Twhere
T: TimelineComponent + Send + 'static,
impl<T> Timed for Twhere
T: TimelineComponent + Send + 'static,
Source§fn at(self, placement: impl Into<Placement>) -> Placed
fn at(self, placement: impl Into<Placement>) -> Placed
.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
fn fill(self) -> Placed
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§impl<T> Triggers for Twhere
T: TimelineComponent,
impl<T> Triggers for Twhere
T: TimelineComponent,
Source§fn trigger_at_start(self, e: Event) -> Triggered<Self>
fn trigger_at_start(self, e: Event) -> Triggered<Self>
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.