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
impl LTCFrame
Sourcepub fn format_time(&self) -> String
pub fn format_time(&self) -> String
Format the time of the frame as a string.
Sourcepub fn estimate_framerate(&self, sample_rate: f32) -> FramerateEstimate
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§
impl Eq for LTCFrame
impl StructuralPartialEq for LTCFrame
Auto Trait Implementations§
impl Freeze for LTCFrame
impl RefUnwindSafe for LTCFrame
impl Send for LTCFrame
impl Sync for LTCFrame
impl Unpin for LTCFrame
impl UnwindSafe for LTCFrame
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