#[non_exhaustive]#[repr(C)]pub struct EventRecord {
pub kind: u32,
pub reason: u32,
pub media_27mhz: u64,
pub a: u64,
pub b: u64,
pub track: u32,
pub track_valid: u32,
}Expand description
Plain-data, #[repr(C)] form of an Event for a C ABI.
| kind | reason | media_27mhz | a | b |
|---|---|---|---|---|
| 1 StartPlaying | 0 | start position | lead, µs | 0 |
| 2 Pause | Reason::code | hold position | depth, µs | resume target, µs |
| 3 Resume | 0 | restart position | lead, µs | 0 |
| 4 TargetChanged | 0 | 0 | old target, µs | new target, µs |
| 5 OverMax | 0 | 0 | need, µs | max, µs |
| 6 Rebaselined | 0 | 0 | 0 | 0 |
| 7 EventsDropped | 0 | 0 | count | 0 |
a/b are whole microseconds: the #[repr(C)] record is an
integer-only ABI, so a Duration crosses it by its microsecond value.
track_valid is 1 only for a Pause that names the starving track in
track (two or more tracks known); otherwise both are 0. Layout (ABI
version 2): 40 bytes, kind@0 reason@4 media_27mhz@8 a@16 b@24 track@32 track_valid@36.
There is no separate “Starved” event: a starvation is a Pause whose
reason is 2/3 and whose a is the lead at that instant.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: u32Event kind code (see kind).
reason: u32Pause reason code, else 0.
media_27mhz: u64Media position (PTS domain, 27 MHz), else 0.
a: u64First value in whole microseconds (table above).
b: u64Second value in whole microseconds (table above).
track: u32The starving track when track_valid == 1, else 0.
track_valid: u321 when track is meaningful, else 0.