pub enum TransportSpeed {
Static {
multiplier: f64,
start_at: Option<InstantMusical>,
},
Automate {
keyframes: Arc<Vec<SpeedMultiplierKeyframe>>,
start_at: Option<InstantMusical>,
},
}Expand description
A multiplier for the speed of the transport.
A value of 1.0 means no change in speed, a value less than 1.0 means
a decrease in speed, and a value greater than 1.0 means an increase in
speed.
Variants§
Static
Set the mulitplier to a single static value.
Fields
start_at: Option<InstantMusical>If this is Some, then the change will happen when the transport
reaches the given playhead.
If this is None, then the change will happen as soon as the
processor receives the event.
Automate
Automate the speed multiplier values.
Fields
keyframes: Arc<Vec<SpeedMultiplierKeyframe>>The keyframes of animation.
Note, the keyframes must be sorted by the event instant or else it will not work correctly.
start_at: Option<InstantMusical>If this is Some, then the change will happen when the transport
reaches the given playhead.
If this is None, then the change will happen as soon as the
processor receives the event.
Implementations§
Source§impl TransportSpeed
impl TransportSpeed
Sourcepub const fn static_multiplier(
multiplier: f64,
change_at: Option<InstantMusical>,
) -> Self
pub const fn static_multiplier( multiplier: f64, change_at: Option<InstantMusical>, ) -> Self
Create a TransportSpeed with a single static value.
speed_multiplier- A multiplier for the playback speed. A value of1.0means no change in speed, a value less than1.0means a decrease in speed, and a value greater than1.0means an increase in speed.change_at: If this isSome, then the change will happen when the transport reaches the given playhead. If this isNone, then the change will happen as soon as the processor receives the event.
pub fn start_at(&self) -> Option<InstantMusical>
Trait Implementations§
Source§impl Clone for TransportSpeed
impl Clone for TransportSpeed
Source§fn clone(&self) -> TransportSpeed
fn clone(&self) -> TransportSpeed
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransportSpeed
impl Debug for TransportSpeed
Source§impl Default for TransportSpeed
impl Default for TransportSpeed
Source§impl PartialEq for TransportSpeed
impl PartialEq for TransportSpeed
impl StructuralPartialEq for TransportSpeed
Auto Trait Implementations§
impl Freeze for TransportSpeed
impl RefUnwindSafe for TransportSpeed
impl Send for TransportSpeed
impl Sync for TransportSpeed
impl Unpin for TransportSpeed
impl UnwindSafe for TransportSpeed
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().