Enum libosu::TimeLocation[][src]

pub enum TimeLocation {
    Absolute(AbsoluteTime),
    Relative(RelativeTime),
}

A struct representing a precise location in time.

This enum represents a timestamp by either an absolute timestamp (milliseconds), or a tuple (t, m, f) where t is the TimingPoint that it's relative to, m is the measure number from within this timing section, and f is a fraction (actually implemented with num_rational::Ratio) that represents how far into the measure this note appears.

When possible, prefer to stack measures. The value of f should not ever reach 1; instead, opt to use measure numbers for whole amounts of measures. For example, 1 measure + 5 / 4 should be represented as 2 measures + 1 / 4 instead.

Variants

Absolute timing in terms of number of milliseconds since the beginning of the audio file. Note that because this is an i32, the time is allowed to be negative.

Relative timing based on an existing TimingPoint. The lifetime of this TimeLocation thus depends on the lifetime of the map.

Methods

impl TimeLocation
[src]

Converts any TimeLocation into an absolute one.

Converts any TimeLocation into an absolute time in milliseconds from the beginning of the audio file.

Converts any TimeLocation into a relative one.

Converts any TimeLocation into a relative time tuple given a TimingPoint.

Trait Implementations

impl Clone for TimeLocation
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for TimeLocation
[src]

Formats the value using the given formatter. Read more

impl Eq for TimeLocation
[src]

impl PartialEq for TimeLocation
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Ord for TimeLocation
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl PartialOrd for TimeLocation
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Into<TimeLocation> for i32
[src]

Performs the conversion.

impl<'a> Into<TimeLocation> for &'a TimeLocation
[src]

Performs the conversion.

Auto Trait Implementations