Struct LTCFrame

Source
pub struct LTCFrame {
Show 19 fields 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,
}
Expand description

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: u8§second: u8§minute: u8§hour: u8§user1: u8§user2: u8§user3: u8§user4: u8§user5: u8§user6: u8§user7: u8§user8: u8§drop_frame: bool§color_frame: bool§flag27: bool§flag43: bool§flag59: bool§synchronised_externally: bool§samples_length: u32

Implementations§

Source§

impl LTCFrame

Source

pub fn format_time(&self) -> String

Format the time of the frame as a string.

Source

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

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§

Source§

impl Debug for LTCFrame

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for LTCFrame

Source§

fn eq(&self, other: &LTCFrame) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for LTCFrame

Source§

impl StructuralPartialEq for LTCFrame

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.