Skip to main content

TrackCommand

Enum TrackCommand 

Source
pub enum TrackCommand {
Show 19 variants SetAnimation { track: u32, animation: String, }, Crossfade { track: u32, animation: String, duration_ms: f32, }, FadeTrack { track: u32, target: f32, duration_ms: f32, }, CancelFade { track: u32, }, Clear { track: u32, }, SetAlpha { track: u32, alpha: f32, }, SetBlend { track: u32, blend: TrackBlend, }, SetSync { track: u32, sync: TrackSync, }, SetFrame { track: u32, frame: f32, }, SetSpeed { track: u32, speed: f32, }, SetFrameRate { track: u32, fps: i32, }, SetFrameSkipEnabled { track: u32, enabled: bool, }, SetPlaybackDirection { track: u32, direction: PlaybackDirection, style: PlaybackStyle, }, SetLoopCount { track: u32, count: i32, }, SetOutgoingEventThreshold { track: u32, threshold: f32, }, AddSource { track: u32, animation: String, weight: f32, }, SetSourceWeight { source: u32, weight: f32, }, SetSourceFrame { source: u32, frame: f32, }, SetSourceEventThreshold { source: u32, threshold: f32, },
}
Expand description

What an SsTrackCommand does. Each variant is the ssplayer_wgpu::SSPlayer call of the same name.

A track’s playback settings (SetSpeed to SetPlaybackDirection) are the track’s: they reach every animation on it, and every one laid on it later. Track 0’s come from SsPlayback, as its loop count does, so these commands are refused on track 0.

Variants§

§

SetAnimation

Lay animation on track, replacing what it played. Not on track 0, which SsPlayer::animation sets.

Fields

§track: u32
§animation: String
§

Crossfade

Fade track over to animation in duration_ms. Not on track 0: change SsPlayer::animation with SsPlayer::transition_ms set.

Fields

§track: u32
§animation: String
§duration_ms: f32
§

FadeTrack

Drive track’s alpha to target in duration_ms.

Fields

§track: u32
§target: f32
§duration_ms: f32
§

CancelFade

Stop the fade on track where it stands.

Fields

§track: u32
§

Clear

Silence track. Track 0 is refused.

Fields

§track: u32
§

SetAlpha

track’s strength.

Fields

§track: u32
§alpha: f32
§

SetBlend

How track layers onto what is below.

Fields

§track: u32
§

SetSync

Where the animations laid on track from now on start. Send it before the animation it is for.

Fields

§track: u32
§

SetFrame

Seek track — how a continuous-control axis is driven.

Fields

§track: u32
§frame: f32
§

SetSpeed

track’s own speed; 0 parks it.

Fields

§track: u32
§speed: f32
§

SetFrameRate

The frame rate track plays at instead of the authored one; 0 clears it.

Fields

§track: u32
§fps: i32
§

SetFrameSkipEnabled

Whether track drops frames to keep to the wall clock.

Fields

§track: u32
§enabled: bool
§

SetPlaybackDirection

Which way track plays, and what it does at the far end.

Fields

§track: u32
§

SetLoopCount

How many times track’s animation plays before it holds its last frame; -1 (or 0) loops forever. It belongs to the animation: send it after the one it is for, since each is laid looping forever. Not on track 0, whose count is SsPlayback::loop_count.

Fields

§track: u32
§count: i32
§

SetOutgoingEventThreshold

How far into a crossfade on track the outgoing animation keeps firing events: while its share of the track, 1 - progress, is at least this. f32::INFINITY (the default) silences it from the start of the fade.

Fields

§track: u32
§threshold: f32
§

AddSource

Lay animation on track beside what it carries, mixed by weight. Its handle comes back in SsTrackState::sources.

Fields

§track: u32
§animation: String
§weight: f32
§

SetSourceWeight

A source’s share within its track.

Fields

§source: u32
§weight: f32
§

SetSourceFrame

Seek one source.

Fields

§source: u32
§frame: f32
§

SetSourceEventThreshold

The weight at or above which a source fires its events; only track 0’s main source fires by default.

Fields

§source: u32
§threshold: f32

Trait Implementations§

Source§

impl Clone for TrackCommand

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TrackCommand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for TrackCommand

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TrackCommand

Auto Trait Implementations§

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
§

impl<T, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

§

fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U

Return the T [ShaderType] for self. When used in [AsBindGroup] derives, it is safe to assume that all images in self exist.
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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> ConditionalSend for T
where T: Send,

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

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

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

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

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

§

const WITNESS: W = W::MAKE

A constant of the type witness
§

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

§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> IntoResult<T> for T

§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
§

impl<A> Is for A
where A: Any,

§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> Settings for T
where T: 'static + Send + Sync,

§

impl<T> Template for T
where T: Clone + Unpin,

§

type Output = T

The type of value produced by this [Template].
§

fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>

Uses this template and the given entity context to produce a [Template::Output].
§

fn clone_template(&self) -> T

Clones this template. See Clone.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
§

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

§

fn clone_type_data(&self) -> Box<dyn TypeData>

Creates a type-erased clone of self.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

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

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more