#[repr(transparent)]pub struct ClockSamples(pub i64);Expand description
An absolute clock time in units of samples (in a single channel of audio).
Tuple Fields§
§0: i64Implementations§
Source§impl ClockSamples
impl ClockSamples
pub const fn new(samples: i64) -> Self
pub fn from_secs_f64(seconds: f64, sample_rate: u32) -> Self
Sourcepub fn whole_seconds_and_fract(&self, sample_rate: u32) -> (i64, u32)
pub fn whole_seconds_and_fract(&self, sample_rate: u32) -> (i64, u32)
(whole seconds, samples after whole seconds)
pub fn fract_second_samples(&self, sample_rate: u32) -> u32
pub fn as_secs_f64(&self, sample_rate: u32, sample_rate_recip: f64) -> f64
Trait Implementations§
Source§impl Add for ClockSamples
impl Add for ClockSamples
Source§impl AddAssign for ClockSamples
impl AddAssign for ClockSamples
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl Clone for ClockSamples
impl Clone for ClockSamples
Source§fn clone(&self) -> ClockSamples
fn clone(&self) -> ClockSamples
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClockSamples
impl Debug for ClockSamples
Source§impl Default for ClockSamples
impl Default for ClockSamples
Source§fn default() -> ClockSamples
fn default() -> ClockSamples
Returns the “default value” for a type. Read more
Source§impl From<i64> for ClockSamples
impl From<i64> for ClockSamples
Source§impl Hash for ClockSamples
impl Hash for ClockSamples
Source§impl Into<i64> for ClockSamples
impl Into<i64> for ClockSamples
Source§impl Ord for ClockSamples
impl Ord for ClockSamples
Source§fn cmp(&self, other: &ClockSamples) -> Ordering
fn cmp(&self, other: &ClockSamples) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ClockSamples
impl PartialEq for ClockSamples
Source§impl PartialOrd for ClockSamples
impl PartialOrd for ClockSamples
Source§impl Sub for ClockSamples
impl Sub for ClockSamples
Source§impl SubAssign for ClockSamples
impl SubAssign for ClockSamples
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for ClockSamples
impl Eq for ClockSamples
impl StructuralPartialEq for ClockSamples
Auto Trait Implementations§
impl Freeze for ClockSamples
impl RefUnwindSafe for ClockSamples
impl Send for ClockSamples
impl Sync for ClockSamples
impl Unpin for ClockSamples
impl UnwindSafe for ClockSamples
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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>
Converts
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>
Converts
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)
Converts
&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)
Converts
&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<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
Compare self to
key and return true if they are equal.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().