[][src]Struct ltc::LTCFrame

pub struct LTCFrame {
    pub frame: u8,
    pub second: u8,
    pub minute: u8,
    pub hour: u8,
    pub user1: u8,
    pub user2: u8,
    pub user3: u8,
    pub user4: u8,
    pub user5: u8,
    pub user6: u8,
    pub user7: u8,
    pub user8: u8,
    pub drop_frame: bool,
    pub color_frame: bool,
    pub flag27: bool,
    pub flag43: bool,
    pub flag59: bool,
    pub synchronised_externally: bool,
    pub samples_length: u32,
}

Represents a single LTC frame obtained from an LTCDecoder.

This struct represents the encoded data almost 1:1, that is, no extra processing is done. The one exception is that the hour, minute, second and frame are all decode for ease of use.

Examples

let frame: LTCFrame = ...;
 
println!("Frame time: {}", frame.format_time());

Fields

frame: u8second: u8minute: u8hour: u8user1: u8user2: u8user3: u8user4: u8user5: u8user6: u8user7: u8user8: u8drop_frame: boolcolor_frame: boolflag27: boolflag43: boolflag59: boolsynchronised_externally: boolsamples_length: u32

Methods

impl LTCFrame[src]

pub fn format_time(&self) -> String[src]

Format the time of the frame as a string.

pub fn estimate_framerate(&self, sample_rate: f32) -> FramerateEstimate[src]

Estimate the framerate of the frame.

By taking in a sample rate, this function uses the recorded length of the frame in samples in order to make an estimation as to the framerate that this frame was part of. Does not currently take into account drop rate timecode.

Arguments

  • sample_rate - The rate (in samples per second) that samples were fed to the decoder that produced this frame. Used to make an estimation of the framerate.

Trait Implementations

impl Debug for LTCFrame[src]

impl Eq for LTCFrame[src]

impl PartialEq<LTCFrame> for LTCFrame[src]

impl StructuralEq for LTCFrame[src]

impl StructuralPartialEq for LTCFrame[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.