pub struct LtcFrame {
pub hours: u8,
pub minutes: u8,
pub seconds: u8,
pub frames: u8,
pub drop_frame_flag: bool,
pub color_frame_flag: bool,
pub flag_bit_27: bool,
pub flag_bit_43: bool,
pub flag_bit_58: bool,
pub flag_bit_59: bool,
pub user_bits: [u8; 8],
}Expand description
A parsed (or to-be-serialized) 80-bit LTC codeword (§9.2): the BCD time
address, drop/color frame flags, the four rate-dependent flag bits
(polarity correction / BGF0 / BGF1 / BGF2 — see FrameRate), the eight
4-bit binary groups (“user bits”, §8.1), and the fixed synchronization
word (always SYNC_WORD on serialize; validated on parse).
This models only the logical codeword content — not the §9.3 biphase-mark
modulation that carries it as an analog/digital audio signal (see
docs/st12-1.md’s “Scope” section).
Fields§
§hours: u8Hours, 00-23 (§9.2.1, Table 2 bits 48-51/56-57).
minutes: u8Minutes, 00-59 (Table 2 bits 32-35/40-42).
seconds: u8Seconds, 00-59 (Table 2 bits 16-19/24-26).
frames: u8Frames, 00-29 (Table 2 bits 0-3/8-9); the caller applies the
tighter per-FrameRate bound if it needs one (see MAX_FRAMES).
drop_frame_flag: boolDrop frame flag, bit 10 (§8.3.1): set when NTSC drop-frame compensation (§5.2.2) is in effect. Fixed bit position across all frame rates; reserved-zero where not applicable (§9.2.2 note).
color_frame_flag: boolColor frame flag, bit 11 (§8.3.2). Fixed bit position across all frame rates; reserved-zero where not applicable (§9.2.2 note).
flag_bit_27: boolThe wire bit at position 27 (Table 3): 30-frame/24-frame’s polarity
correction bit, or 25-frame’s BGF0 — see LtcFrame::polarity_correction
/ LtcFrame::binary_group_flags to resolve its meaning for a given
FrameRate.
flag_bit_43: boolThe wire bit at position 43 (Table 3): 30-frame/24-frame’s BGF0, or 25-frame’s BGF2.
flag_bit_58: boolThe wire bit at position 58 (Table 3): BGF1 in all three frame rates.
flag_bit_59: boolThe wire bit at position 59 (Table 3): 30-frame/24-frame’s BGF2, or 25-frame’s polarity correction bit.
user_bits: [u8; 8]The eight 4-bit binary groups (“user bits”), each 0x0-0xF, in
first..eighth order (Table 4 bits 4-7/12-15/20-23/28-31/36-39/44-47/
52-55/60-63). Their collective meaning is given by
LtcFrame::binary_group_flags.usage().
Implementations§
Source§impl LtcFrame
impl LtcFrame
Sourcepub fn polarity_correction(&self, rate: FrameRate) -> bool
pub fn polarity_correction(&self, rate: FrameRate) -> bool
Resolve the §9.2.3 biphase-mark polarity-correction bit for rate
(Table 3: bit 27 for 30-frame/24-frame, bit 59 for 25-frame).
Sourcepub fn binary_group_flags(&self, rate: FrameRate) -> BinaryGroupFlags
pub fn binary_group_flags(&self, rate: FrameRate) -> BinaryGroupFlags
Resolve the §8.3.3 binary group flags (BGF2/BGF1/BGF0) for rate
(Table 3’s per-rate bit-position mapping).
Trait Implementations§
impl Copy for LtcFrame
Source§impl<'de> Deserialize<'de> for LtcFrame
Available on crate feature serde only.
impl<'de> Deserialize<'de> for LtcFrame
serde only.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>,
impl Eq for LtcFrame
Source§impl Serialize for LtcFrame
impl Serialize for LtcFrame
Source§type Error = Error
type Error = Error
Parse impl, but need not be).Source§fn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
serialize_into will write.