Struct time_calc::measure::Measure
[−]
[src]
pub struct Measure(pub NumDiv, pub Division, pub DivType);
Time representation in the form of a Musical Measure.
i.e. Measure(1, Bar, Whole) is one bar of musical time. Measure(3, Beat, Whole) is three beats of musical time. Measure(1, Minim, TwoThirds) is two thirds of a minim.
Methods
impl Measure
[src]
fn num(&self) -> NumDiv
[src]
Return the number of divisions.
fn div(&self) -> Division
[src]
Return the division measure.
fn div_type(&self) -> DivType
[src]
Return the division type.
fn beats(&self, ts: TimeSig) -> f64
[src]
Convert to the equivalent duration in Beats.
fn bars(&self, ts: TimeSig) -> f64
[src]
Convert to the equivalent duration in Bars.
fn ms(&self, bpm: Bpm, ts: TimeSig) -> Ms
[src]
Convert to the unit value of Ms
.
fn to_ms(&self, bpm: Bpm, ts: TimeSig) -> Ms
[src]
Convert to Ms
.
fn samples(&self, bpm: Bpm, ts: TimeSig, sample_hz: SampleHz) -> Samples
[src]
Convert to the unit value of Samples
.
fn to_samples(&self, bpm: Bpm, ts: TimeSig, sample_hz: SampleHz) -> Samples
[src]
Convert to Samples
.
fn ticks(&self, ts: TimeSig, ppqn: Ppqn) -> Ticks
[src]
Convert to the unit value of Ticks
.
fn to_ticks(&self, ts: TimeSig, ppqn: Ppqn) -> Ticks
[src]
Convert to Ticks
.
Trait Implementations
impl Debug for Measure
[src]
impl Copy for Measure
[src]
impl Clone for Measure
[src]
fn clone(&self) -> Measure
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Measure
[src]
fn eq(&self, __arg_0: &Measure) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Measure) -> bool
[src]
This method tests for !=
.
impl Eq for Measure
[src]
impl Hash for Measure
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more