| Copyright | (c) 2018-2021 Sam May |
|---|---|
| License | GPL-3.0-or-later |
| Maintainer | [email protected] |
| Stability | stable |
| Portability | non-portable (requires libcdio) |
| Safe Haskell | None |
| Language | Haskell2010 |
Foreign.Libcdio.Track
Description
What many people would think of as the most important division on a CD isn't quite as an integral a part of the physical data layout: they are described in a table of contents before the first track of any recording session, and may have lower-resolution "echoes" in the subchannels alongside the data, but it would be hard to otherwise recover the track boundaries from the data itself. This module, then, provides the functions to retrieve that metadata from the table of contents and from the subchannels.
track.h
Defines
CDIO_CDROM_CDI_TRACK(removed; only has utility in library code)CDIO_CDROM_DATA_TRACK(removed; only has utility in library code)CDIO_INVALID_TRACK(removed; handled viaNothing)CDIO_CDROM_LBA(removed; only has utility in library code)CDIO_CDROM_LEADOUT_TRACK->DiscLeadoutCDIO_CDROM_MSF(removed; only has utility in library code)CDIO_CDROM_XA_TRACK(removed; only has utility in library code)CDIO_CD_MAX_TRACKS->maxTrackCDIO_CD_MIN_TRACK_NO->minTrack
Types
track_flag_t->MaybeBool(CDIO_TRACK_FLAG_ERROR is never used in library code)track_flags_t(removed; never used in the public interface)track_format_t->TrackFormatTRACK_FORMAT_PSX->FormatPlaystationTRACK_FORMAT_ERROR(removed; handled viaNothing)
trackmode_t(removed; never used in the public API)
Symbols
cdio_get_first_track_num->firstTrackNumcdio_get_last_track_num->lastTrackNumcdio_get_track->trackAtcdio_get_track_channels->numChannelscdio_get_track_copy_permit->copyPermitcdio_get_track_format->trackFormatcdio_get_track_green->isGreencdio_get_track_isrc->trackIsrccdio_get_track_last_lsn->trackLastLsncdio_get_track_lba->trackLbacdio_get_track_lsn->trackLsncdio_get_track_msf->trackMsfcdio_get_track_preemphasis->hasPreemphasiscdio_get_track_pregap_lba->pregapLbacdio_get_track_pregap_lsn->pregapLsncdio_get_track_sec_count->sectorCounttrack_format2str->trackFormatString
Sound.Libcdio.Track
firstTrackNum->firstDiscTrackisrcLength(removed; unnecessary low-level detail)lastTrackNum->lastDiscTracknumChannels->quadAudiopregapLba(removed; onlyLsnis used inSound)pregapLsn->pregapsectorCount->totalLengthtrackFormat->formattrackIsrc->Sound.Libcdio.Read.Data.isrctrackLastLsn->offsetEndtrackLba(removed; onlyLsnis used inSound)trackLsn->offsettrackMsf(removed; onlyLsnis used inSound)
Synopsis
- data Track
- data TrackNum
- minTrack :: Track
- maxTrack :: Track
- data TrackFormat
- trackFormatString :: TrackFormat -> String
- firstTrackNum :: Cdio -> IO (Maybe Track)
- lastTrackNum :: Cdio -> IO (Maybe Track)
- trackAt :: Cdio -> Lsn -> IO (Maybe Track)
- trackLba :: Cdio -> Track -> IO (Maybe Lba)
- trackLsn :: Cdio -> Track -> IO (Maybe Lsn)
- trackMsf :: Cdio -> Track -> IO (Maybe Msf)
- trackLastLsn :: Cdio -> Track -> IO (Maybe Lsn)
- pregapLba :: Cdio -> Track -> IO (Maybe Lba)
- pregapLsn :: Cdio -> Track -> IO (Maybe Lsn)
- sectorCount :: Cdio -> Track -> IO (Maybe Word)
- trackFormat :: Cdio -> Track -> IO (Maybe TrackFormat)
- isGreen :: Cdio -> Track -> IO (Maybe Bool)
- hasPreemphasis :: Cdio -> Track -> IO (Maybe Bool)
- copyPermit :: Cdio -> Track -> IO (Maybe Bool)
- numChannels :: Cdio -> Track -> IO (Maybe Word)
- trackIsrc :: Cdio -> Track -> IO (Maybe String)
- isrcLength :: Word
Types
An index into the segmentation within a write session on a disc.
Constructors
| DiscPregap | The (usually buffer) data located before the first track on a disc. |
| Track TrackNum | The common understanding of a CD track: a segment of the data on the disc containing (usually) a single song. |
| DiscLeadout | Any (usually buffer) data located after the end of the last track on a disc. |
Instances
| Bounded Track Source # | |
| Enum Track Source # | Note that |
Defined in Foreign.Libcdio.Types.Internal | |
| Eq Track Source # | |
| Num Track Source # | |
| Ord Track Source # | |
| Read Track Source # | |
| Show Track Source # | |
| Ix Track Source # | |
| PrintfArg Track Source # | |
Defined in Foreign.Libcdio.Types.Internal | |
| Storable Track Source # | Note that |
Opaque newtype representing the numeric index of a Track, while
enforcing the invariants inherant to the specification. Of very limited
utility outside that context.
data TrackFormat Source #
The structure in which data is stored on a segment of a disc. The exact representation of these values is discussed in Foreign.Libcdio.Sector.
Constructors
| FormatAudio | |
| FormatCdI | |
| FormatXa | |
| FormatData | |
| FormatPlaystation |
Instances
Location
firstTrackNum :: Cdio -> IO (Maybe Track) Source #
The number of the first track on the disc. This will almost always be 1, but that is not strictly guaranteed; the (perhaps theoretical) example is of a multi-disc set, where later discs pick the numbering back up where the previous one left off.
Returns Nothing if the Cdio object has already been closed, or if the
disc table of contents can't be read.
trackAt :: Cdio -> Lsn -> IO (Maybe Track) Source #
The track which contains the given address.
Returns Nothing if the Cdio object has already been closed, or if the
address is beyond the written data on the disc. Note that DiscLeadout is
treated as if it were a single sector long:
>>>Just endTrack <- lastTrackNum cdio>>>Just endAddr <- trackLastLsn cdio endTrack>>>trackAt cdio $ endAddr + 1Just DiscLeadout>>>trackAt cdio $ endAddr + 2Nothing
pregapLba :: Cdio -> Track -> IO (Maybe Lba) Source #
The address of the start of any pregap before the given track.
pregapLsn :: Cdio -> Track -> IO (Maybe Lsn) Source #
The address of the start of any pregap before the given track.
sectorCount :: Cdio -> Track -> IO (Maybe Word) Source #
The number of sectors "assigned" to the specified track, including any in the pregap between it and the following one.
Data
trackFormat :: Cdio -> Track -> IO (Maybe TrackFormat) Source #
The raw data structure of a track.
isGreen :: Cdio -> Track -> IO (Maybe Bool) Source #
Whether the track data was stored using the Green Book (CD-i) standard.
hasPreemphasis :: Cdio -> Track -> IO (Maybe Bool) Source #
Whether preemphasis has been applied to the track for noise reduction.
numChannels :: Cdio -> Track -> IO (Maybe Word) Source #
The number of channels in the given track; either 2 or 4 per the standard.
isrcLength :: Word Source #
Number of ASCII characters in an International Standard Recording Code.