Struct symphonia_core::units::TimeBase[][src]

pub struct TimeBase {
    pub numer: u32,
    pub denom: u32,
}

A TimeBase is the conversion factor between a TimeStamp and real-world seconds.

Fields

numer: u32

The numerator.

denom: u32

The denominator.

Implementations

impl TimeBase[src]

pub fn new(numer: u32, denom: u32) -> Self[src]

Creates a new TimeBase. Panics if either the numerator or denominator is 0.

pub fn calc_time(&self, ts: TimeStamp) -> Time[src]

Accurately calculates a Time using the TimeBase and the provided TimeStamp. On overflow, the seconds field of Time wraps.

pub fn calc_timestamp(&self, time: Time) -> TimeStamp[src]

Accurately calculates a TimeStamp from the given Time using the TimeBase as the conversion factor. On overflow, the TimeStamp wraps.

Trait Implementations

impl Clone for TimeBase[src]

impl Copy for TimeBase[src]

impl Debug for TimeBase[src]

impl Default for TimeBase[src]

impl PartialEq<TimeBase> for TimeBase[src]

impl StructuralPartialEq for TimeBase[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<F, T> IntoSample<T> for F where
    T: FromSample<F>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.