pub struct Timecode {
pub hours: u8,
pub minutes: u8,
pub seconds: u8,
pub frames: u8,
pub frame_rate: FrameRateInfo,
pub user_bits: u32,
}Expand description
SMPTE timecode structure
Fields§
§hours: u8Hours (0-23)
minutes: u8Minutes (0-59)
seconds: u8Seconds (0-59)
frames: u8Frames (0 to frame_rate - 1)
frame_rate: FrameRateInfoFrame rate
user_bits: u32User bits (32 bits)
Implementations§
Source§impl Timecode
impl Timecode
Sourcepub fn new(
hours: u8,
minutes: u8,
seconds: u8,
frames: u8,
frame_rate: FrameRate,
) -> Result<Self, TimecodeError>
pub fn new( hours: u8, minutes: u8, seconds: u8, frames: u8, frame_rate: FrameRate, ) -> Result<Self, TimecodeError>
Create a new timecode
Sourcepub fn with_user_bits(self, user_bits: u32) -> Self
pub fn with_user_bits(self, user_bits: u32) -> Self
Create timecode with user bits
Sourcepub fn from_frames(
frames: u64,
frame_rate: FrameRate,
) -> Result<Self, TimecodeError>
pub fn from_frames( frames: u64, frame_rate: FrameRate, ) -> Result<Self, TimecodeError>
Create from total frames since midnight
Sourcepub fn increment(&mut self) -> Result<(), TimecodeError>
pub fn increment(&mut self) -> Result<(), TimecodeError>
Increment by one frame
Sourcepub fn decrement(&mut self) -> Result<(), TimecodeError>
pub fn decrement(&mut self) -> Result<(), TimecodeError>
Decrement by one frame
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Timecode
impl<'de> Deserialize<'de> for Timecode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Timecode
impl Eq for Timecode
impl StructuralPartialEq for Timecode
Auto Trait Implementations§
impl Freeze for Timecode
impl RefUnwindSafe for Timecode
impl Send for Timecode
impl Sync for Timecode
impl Unpin for Timecode
impl UnsafeUnpin for Timecode
impl UnwindSafe for Timecode
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