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
Return the number of divisions.
fn div(&self) -> Division
Return the division measure.
fn div_type(&self) -> DivType
Return the division type.
fn beats(&self, ts: TimeSig) -> f64
Convert to the equivalent duration in Beats.
fn bars(&self, ts: TimeSig) -> f64
Convert to the equivalent duration in Bars.
fn ms(&self, bpm: Bpm, ts: TimeSig) -> Ms
Convert to the unit value of Ms
.
fn to_ms(&self, bpm: Bpm, ts: TimeSig) -> Ms
Convert to Ms
.
fn samples(&self, bpm: Bpm, ts: TimeSig, sample_hz: SampleHz) -> Samples
Convert to the unit value of Samples
.
fn to_samples(&self, bpm: Bpm, ts: TimeSig, sample_hz: SampleHz) -> Samples
Convert to Samples
.
fn ticks(&self, ts: TimeSig, ppqn: Ppqn) -> Ticks
Convert to the unit value of Ticks
.
fn to_ticks(&self, ts: TimeSig, ppqn: Ppqn) -> Ticks
Convert to Ticks
.
Trait Implementations
impl Eq for Measure
[src]
impl PartialEq for Measure
[src]
fn eq(&self, __arg_0: &Measure) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Measure) -> bool
This method tests for !=
.
impl Decodable for Measure
[src]
impl Encodable for Measure
[src]
impl Clone for Measure
[src]
fn clone(&self) -> Measure
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more