pub struct TransportState {
pub transport: Option<MusicalTransport>,
pub playing: Notify<bool>,
pub playhead: Notify<InstantMusical>,
pub speed: TransportSpeed,
pub stop_at: Option<InstantMusical>,
pub loop_range: Option<Range<InstantMusical>>,
}Expand description
The state of the musical transport in a Firewheel context.
Fields§
§transport: Option<MusicalTransport>The current musical transport.
playing: Notify<bool>Whether or not the musical transport is playing (true) or is paused (false).
playhead: Notify<InstantMusical>The playhead of the musical transport.
speed: TransportSpeedA 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.
stop_at: Option<InstantMusical>If this is Some, then the transport will automatically stop when the playhead
reaches the given musical time.
This has no effect if TransportState::loop_range is Some.
loop_range: Option<Range<InstantMusical>>If this is Some, then the transport will continously loop the given region.
Implementations§
Source§impl TransportState
impl TransportState
Sourcepub fn set_static_transport(&mut self, beats_per_minute: Option<f64>)
pub fn set_static_transport(&mut self, beats_per_minute: Option<f64>)
Set the transport to a single static tempo (StaticTransport).
If beats_per_minute is None, then this will set the transport to None.
Sourcepub fn beats_per_minute(&self) -> Option<f64>
pub fn beats_per_minute(&self) -> Option<f64>
Get the beats per minute of the current static transport.
Returns None if transport is None or if transport is not
MusicalTransport::Static.
Sourcepub fn set_speed_multiplier(
&mut self,
speed_multiplier: f64,
change_at: Option<InstantMusical>,
)
pub fn set_speed_multiplier( &mut self, speed_multiplier: f64, change_at: Option<InstantMusical>, )
Set a multiplier for the speed of the transport to 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.
Trait Implementations§
Source§impl Clone for TransportState
impl Clone for TransportState
Source§fn clone(&self) -> TransportState
fn clone(&self) -> TransportState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Component for TransportState
impl Component for TransportState
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
Source§type Mutability = Mutable
type Mutability = Mutable
Component<Mutability = Mutable>,
while immutable components will instead have Component<Mutability = Immutable>. Read moreSource§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Source§fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_replace() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_replace() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
EntityMapper. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component, this is populated by annotating fields containing entities with #[entities] Read moreSource§impl Debug for TransportState
impl Debug for TransportState
Source§impl Default for TransportState
impl Default for TransportState
Source§impl PartialEq for TransportState
impl PartialEq for TransportState
impl StructuralPartialEq for TransportState
Auto Trait Implementations§
impl Freeze for TransportState
impl RefUnwindSafe for TransportState
impl Send for TransportState
impl Sync for TransportState
impl Unpin for TransportState
impl UnwindSafe for TransportState
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<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ids: &mut impl FnMut(ComponentId), )
Source§fn get_component_ids(
components: &Components,
ids: &mut impl FnMut(Option<ComponentId>),
)
fn get_component_ids( components: &Components, ids: &mut impl FnMut(Option<ComponentId>), )
Source§impl<C> BundleFromComponents for Cwhere
C: Component,
impl<C> BundleFromComponents for Cwhere
C: Component,
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<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
Source§unsafe fn get_components(
ptr: MovingPtr<'_, C>,
func: &mut impl FnMut(StorageType, OwningPtr<'_>),
) -> <C as DynamicBundle>::Effect
unsafe fn get_components( ptr: MovingPtr<'_, C>, func: &mut impl FnMut(StorageType, OwningPtr<'_>), ) -> <C as DynamicBundle>::Effect
Source§unsafe fn apply_effect(
_ptr: MovingPtr<'_, MaybeUninit<C>>,
_entity: &mut EntityWorldMut<'_>,
)
unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit<C>>, _entity: &mut EntityWorldMut<'_>, )
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().