Struct cue::track::Track
[−]
[src]
pub struct Track { /* fields omitted */ }
The Track struct represents a single track within a CD.
A track can be one of several types, represented by the
TrackMode
struct, and a CD can mix and match tracks of
different types in arbitrary orders.
The CUE sheet format represents its time codes
in a MM:SS:FR
format, which is based on the MIN
, SEC
and FRAC
fields defined by the CD standard. FRAC
is a fraction
representing 1/75th of a second, which is the size of a single
CD sector.
The timecodes returned by this struct have been parsed into
sequential sector counts.
Aside from the track itself, this struct also represents the regions immediately before and after the track. These regions of a disc, known as the pregap and postgap, are not contained within any track but do have their own timecodes. They are usually silent but occasionally contain sound as a form of easter egg.
The order content looks like this:
- Pregap (if present)
- Track
- Postgap (if present)
- Next track's pregap (if present) ...
Aside from the pregap and postgap, a track can consist of up to 99 indices, where the start of the track is index 01. Indices higher than 1 are very rarely used, and this struct currently doesn't support representing them.
Methods
impl Track
[src]
pub fn from(pointer: *mut TrackPointer) -> Track
[src]
pub fn get_filename(&self) -> String
[src]
Returns the filename of the file containing this track. The track might be stored standalone in its own file, or as part of a large file containing the contents of the entire disc.
pub fn get_start(&self) -> i64
[src]
Returns the start address of this track in sectors.
pub fn get_length(&self) -> i64
[src]
Returns the length of this track in sectors.
pub fn get_mode(&self) -> TrackMode
[src]
Returns the mode of this track as a TrackMode
variant.
pub fn get_sub_mode(&self) -> TrackSubMode
[src]
Returns a TrackSubMode
variant indicating whether the format
of subchannel data provided for this track.
The BIN/CUE format does not normally provide subchannel data, but when it does it provides data for subchannels R through W in either a "raw" or a "cooked" format.
pub fn flag_is_set(&self, flag: TrackFlag) -> bool
[src]
Queries whether a given TrackFlag is set for the track. These indicate special properties such as whether a track contains data, is copy-protected, contains quadraphonic audio, and so on.
pub fn get_zero_pre(&self) -> i64
[src]
Returns the length of the track's pregap, in sectors. The pregap is a region contained before the track proper. It almost always consists of two seconds of silence, though it can be any length and contain any data; this is occasionally used for secret tracks.
pub fn get_zero_post(&self) -> i64
[src]
Returns the length of the track's postgap, in sectors. Like the pregap, the postgap is a region that comes after the end of a track and before the next one; if present, it almost always consists of silence.
pub fn get_isrc(&self) -> Option<String>
[src]
Returns the International Standard Recording Code (ISRC) for this track, if defined. While some CDs use ISRCs, they are not common and many CUE sheets leave them out even if the CD had them.
pub fn get_index(&self, index: isize) -> isize
[src]
Returns the track number.
pub fn get_cdtext(&self) -> CDText
[src]
Returns a CDText object containing any CD-TEXT data for this track, if present.
pub fn get_rem(&self) -> REM
[src]
Returns a REM object containing any comments for this track, if present.