pub struct Track<O, N, P> {
pub offset: O,
pub number: N,
pub isrc: ISRC,
pub non_audio: bool,
pub pre_emphasis: bool,
pub index_points: P,
}Expand description
An individual CUESHEET track
| Bits | Field | Meaning |
|---|---|---|
| 64 | offset | offset of first index point, in samples |
| 8 | number | track number |
| 12×8 | isrc | track ISRC |
| 1 | non_audio | whether track is non-audio |
| 1 | pre_emphasis | whether track has pre-emphasis |
| 6+13×8 | padding | all 0 bits |
| 8 | point count | number index points |
| index point₀, index point₁, … |
Fields§
§offset: OOffset of first index point
In samples relative to the beginning of the FLAC audio stream.
For CD-DA, the track offset must always be divisible by 588. This is because for audio CDs, tracks must always begin on CD frame boundaries. Since each CD frame is 1/75th of a second, and CDs have 44,100 samples per second, 44100 ÷ 75 = 588.
Non-CD-DA discs have no such restriction.
number: NTrack number
| Disc Type | Range | Lead-Out Track |
|---|---|---|
| CD-DA | 1 ≤ track number ≤ 99 | 170 |
| Non-CD-DA | 1 ≤ track number < 255 | 255 |
isrc: ISRCTrack’s ISRC
non_audio: boolWhether track is non-audio
pre_emphasis: boolWhether track has pre-emphasis
index_points: PTrack’s index points
| Disc Type | Lead-Out Track | Index Points |
|---|---|---|
| CD-DA | No | not more than 100 |
| CD-DA | Yes | 0 |
| Non-CD-DA | No | not more than 255 |
| Non-CD-DA | Yes | 0 |
Implementations§
Source§impl Track<CDDAOffset, LeadOut, ()>
impl Track<CDDAOffset, LeadOut, ()>
Sourcepub fn new(
last: Option<&TrackCDDA>,
offset: CDDAOffset,
) -> Result<Self, CuesheetError>
pub fn new( last: Option<&TrackCDDA>, offset: CDDAOffset, ) -> Result<Self, CuesheetError>
Creates new lead-out track with the given offset
Lead-out offset must be contiguous with existing tracks
Trait Implementations§
Source§impl<const INDEX_MAX: usize, O: Adjacent> TryFrom<Track<Option<O>, NonZero<u8>, Contiguous<INDEX_MAX, Index<O>>>> for Track<O, NonZero<u8>, IndexVec<INDEX_MAX, O>>
impl<const INDEX_MAX: usize, O: Adjacent> TryFrom<Track<Option<O>, NonZero<u8>, Contiguous<INDEX_MAX, Index<O>>>> for Track<O, NonZero<u8>, IndexVec<INDEX_MAX, O>>
impl<O: Eq, N: Eq, P: Eq> Eq for Track<O, N, P>
impl<O, N, P> StructuralPartialEq for Track<O, N, P>
Auto Trait Implementations§
impl<O, N, P> Freeze for Track<O, N, P>
impl<O, N, P> RefUnwindSafe for Track<O, N, P>
impl<O, N, P> Send for Track<O, N, P>
impl<O, N, P> Sync for Track<O, N, P>
impl<O, N, P> Unpin for Track<O, N, P>
impl<O, N, P> UnwindSafe for Track<O, N, P>
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