pub enum EventDelay {
DelayUntilSeconds(ClockSeconds),
DelayUntilSamples(ClockSamples),
DelayUntilMusical(MusicalTime),
}Expand description
When a particular audio event should occur.
Variants§
DelayUntilSeconds(ClockSeconds)
The event should happen when the clock reaches the given time in seconds.
Note, this clock is not perfectly accurate, but it does correctly account for any output underflows that may occur.
The value is an absolute time, NOT a delta time. Use the context’s
clock_now method to get the current time of the clock.
DelayUntilSamples(ClockSamples)
The event should happen when the clock reaches the given time in samples (of a single channel of audio).
This is more accurate than DelayUntilSeconds, but it does not
account for any output underflows that may occur. This clock is
ideal for syncing events to a custom musical transport.
The value is an absolute time, NOT a delta time. Use the context’s
clock_samples to get the current time of the clock.
DelayUntilMusical(MusicalTime)
The event should happen when the musical clock reaches the given musical time.
Like DelayUntilSamples, this is very accurate, but note it also
does not account for any output underflows that may occur.
Implementations§
Source§impl EventDelay
impl EventDelay
pub fn elapsed_or_get(&self, proc_info: &ProcInfo<'_>) -> Option<Self>
pub fn elapsed_on_frame( &self, proc_info: &ProcInfo<'_>, sample_rate: u32, ) -> Option<usize>
Trait Implementations§
Source§impl Clone for EventDelay
impl Clone for EventDelay
Source§fn clone(&self) -> EventDelay
fn clone(&self) -> EventDelay
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EventDelay
impl Debug for EventDelay
Source§impl PartialEq for EventDelay
impl PartialEq for EventDelay
impl Copy for EventDelay
impl StructuralPartialEq for EventDelay
Auto Trait Implementations§
impl Freeze for EventDelay
impl RefUnwindSafe for EventDelay
impl Send for EventDelay
impl Sync for EventDelay
impl Unpin for EventDelay
impl UnwindSafe for EventDelay
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.