Track

Struct Track 

Source
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

BitsFieldMeaning
64offsetoffset of first index point, in samples
8numbertrack number
12×8isrctrack ISRC
1non_audiowhether track is non-audio
1pre_emphasiswhether track has pre-emphasis
6+13×8paddingall 0 bits
8point countnumber index points
index point₀, index point₁, …

Fields§

§offset: O

Offset 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: N

Track number

Disc TypeRangeLead-Out Track
CD-DA1 ≤ track number ≤ 99170
Non-CD-DA1 ≤ track number < 255255
§isrc: ISRC

Track’s ISRC

§non_audio: bool

Whether track is non-audio

§pre_emphasis: bool

Whether track has pre-emphasis

§index_points: P

Track’s index points

Disc TypeLead-Out TrackIndex Points
CD-DANonot more than 100
CD-DAYes0
Non-CD-DANonot more than 255
Non-CD-DAYes0

Implementations§

Source§

impl Track<CDDAOffset, LeadOut, ()>

Source

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

Source§

impl Track<u64, LeadOut, ()>

Source

pub fn new( last: Option<&TrackNonCDDA>, offset: u64, ) -> Result<Self, CuesheetError>

Creates new lead-out track with the given offset

Trait Implementations§

Source§

impl<const MAX: usize, O: Adjacent, N: Adjacent> Adjacent for Track<O, N, IndexVec<MAX, O>>

Source§

fn valid_first(&self) -> bool

Whether the item is valid as the first in a sequence
Source§

fn is_next(&self, previous: &Self) -> bool

Whether the item is immediately following the previous
Source§

impl<O: Clone, N: Clone, P: Clone> Clone for Track<O, N, P>

Source§

fn clone(&self) -> Track<O, N, P>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<O: Debug, N: Debug, P: Debug> Debug for Track<O, N, P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<O: PartialEq, N: PartialEq, P: PartialEq> PartialEq for Track<O, N, P>

Source§

fn eq(&self, other: &Track<O, N, P>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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>>

Source§

type Error = CuesheetError

The type returned in the event of a conversion error.
Source§

fn try_from( track: Track<Option<O>, NonZero<u8>, Contiguous<INDEX_MAX, Index<O>>>, ) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<O: Eq, N: Eq, P: Eq> Eq for Track<O, N, P>

Source§

impl<O, N, P> StructuralPartialEq for Track<O, N, P>

Auto Trait Implementations§

§

impl<O, N, P> Freeze for Track<O, N, P>
where O: Freeze, N: Freeze, P: Freeze,

§

impl<O, N, P> RefUnwindSafe for Track<O, N, P>

§

impl<O, N, P> Send for Track<O, N, P>
where O: Send, N: Send, P: Send,

§

impl<O, N, P> Sync for Track<O, N, P>
where O: Sync, N: Sync, P: Sync,

§

impl<O, N, P> Unpin for Track<O, N, P>
where O: Unpin, N: Unpin, P: Unpin,

§

impl<O, N, P> UnwindSafe for Track<O, N, P>
where O: UnwindSafe, N: UnwindSafe, P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.