pub enum SmfDivision {
Metrical {
ticks_per_quarter: NonZeroU16,
},
Smpte {
frames_per_second: SmpteRate,
ticks_per_frame: NonZeroU8,
},
}Expand description
The lossless time-division field from an SMF header.
Variants§
Metrical
Metrical timing in ticks per quarter note.
Fields
ticks_per_quarter: NonZeroU16Non-zero ticks per quarter note.
Smpte
Timecode timing in subdivisions of an SMPTE frame.
Implementations§
Source§impl SmfDivision
impl SmfDivision
Sourcepub const fn metrical(ticks_per_quarter: u16) -> Option<Self>
pub const fn metrical(ticks_per_quarter: u16) -> Option<Self>
Constructs a metrical division, returning None for zero or a value
with the SMPTE high bit set.
Sourcepub const fn smpte(
frames_per_second: SmpteRate,
ticks_per_frame: u8,
) -> Option<Self>
pub const fn smpte( frames_per_second: SmpteRate, ticks_per_frame: u8, ) -> Option<Self>
Constructs an SMPTE division, returning None for zero ticks per frame.
Sourcepub const fn ticks_per_quarter(self) -> Option<NonZeroU16>
pub const fn ticks_per_quarter(self) -> Option<NonZeroU16>
Returns metrical ticks per quarter note, or None for SMPTE timing.
Sourcepub const fn ticks_per_second_ratio(self) -> Option<(u32, u32)>
pub const fn ticks_per_second_ratio(self) -> Option<(u32, u32)>
Returns the exact number of SMF ticks per second as a ratio, or None
for metrical timing whose tempo is carried by events.
Sourcepub const fn event_time_base(self) -> u32
pub const fn event_time_base(self) -> u32
Returns the resolution used in each event’s TickTime.
For metrical files this is ticks per quarter note. For SMPTE files it
is nominal ticks per second (30 fps for the -29 drop-frame code);
ticks_per_second_ratio retains the
exact 30_000 / 1_001 rate for duration calculations.
Trait Implementations§
Source§impl Clone for SmfDivision
impl Clone for SmfDivision
Source§fn clone(&self) -> SmfDivision
fn clone(&self) -> SmfDivision
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more