pub struct SmpteTime { /* private fields */ }
Expand description
A timestamp encoding an SMPTE time of the day.
Enforces several guarantees:
hour
is inside [0,23]minute
is inside [0,59]second
is inside [0,59]frame
is inside [0,fps[subframe
is inside [0,99]
Implementations§
source§impl SmpteTime
impl SmpteTime
sourcepub fn new(
hour: u8,
minute: u8,
second: u8,
frame: u8,
subframe: u8,
fps: Fps
) -> Option<SmpteTime>
pub fn new(
hour: u8,
minute: u8,
second: u8,
frame: u8,
subframe: u8,
fps: Fps
) -> Option<SmpteTime>
Create a new SMPTE timestamp with the given information.
sourcepub fn frame(&self) -> u8
pub fn frame(&self) -> u8
Get the frame component of this timestamp.
The meaning of this value depends on the value of fps
.
sourcepub fn subframe(&self) -> u8
pub fn subframe(&self) -> u8
Get the subframe component of this timestamp (hundredths of a frame).
sourcepub fn second_f32(&self) -> f32
pub fn second_f32(&self) -> f32
Convert the second + frame + subframe components of this timestamp into a single floating-point number of seconds. Note that this does not include the hour and minute components.