pub struct MtcTimecode {
pub hours: u8,
pub minutes: u8,
pub seconds: u8,
pub frames: u8,
pub frame_rate: MtcFrameRate,
}Expand description
MIDI Timecode value.
Fields§
§hours: u8Hours (0-23)
minutes: u8Minutes (0-59)
seconds: u8Seconds (0-59)
frames: u8Frames (0 to frames_per_sec - 1)
frame_rate: MtcFrameRateFrame rate
Implementations§
Source§impl MtcTimecode
impl MtcTimecode
Sourcepub fn new(
hours: u8,
minutes: u8,
seconds: u8,
frames: u8,
frame_rate: MtcFrameRate,
) -> Self
pub fn new( hours: u8, minutes: u8, seconds: u8, frames: u8, frame_rate: MtcFrameRate, ) -> Self
Create a new MTC timecode value.
Sourcepub fn to_frame_count(&self) -> u64
pub fn to_frame_count(&self) -> u64
Convert to total frame count since 00:00:00:00.
Sourcepub fn from_frame_count(frame_count: u64, rate: MtcFrameRate) -> Self
pub fn from_frame_count(frame_count: u64, rate: MtcFrameRate) -> Self
Create an MTC timecode from a frame count.
Trait Implementations§
Source§impl Clone for MtcTimecode
impl Clone for MtcTimecode
Source§fn clone(&self) -> MtcTimecode
fn clone(&self) -> MtcTimecode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MtcTimecode
impl Debug for MtcTimecode
Source§impl PartialEq for MtcTimecode
impl PartialEq for MtcTimecode
impl Copy for MtcTimecode
impl Eq for MtcTimecode
impl StructuralPartialEq for MtcTimecode
Auto Trait Implementations§
impl Freeze for MtcTimecode
impl RefUnwindSafe for MtcTimecode
impl Send for MtcTimecode
impl Sync for MtcTimecode
impl Unpin for MtcTimecode
impl UnsafeUnpin for MtcTimecode
impl UnwindSafe for MtcTimecode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more