Copyright | (c) 2018-2021 Sam May |
---|---|
License | GPL-3.0-or-later |
Maintainer | ag@eitilt.life |
Stability | stable |
Portability | non-portable (requires libcdio) |
Safe Haskell | None |
Language | Haskell2010 |
Foreign.Libcdio.Disc
Description
This module provides informational and metadata functions primarily related to the layout of data on a physical disc. While both Foreign.Libcdio.Read and Foreign.Libcdio.CdText provide more exciting access to the actual data, this still provides a critical intermediate step between those and the physical hardware of Foreign.Libcdio.Device.
disc.h
Types
discmode_t
->DiscMode
CDIO_DISC_MODE_CD_DA
->AudioCdMode
CDIO_DISC_MODE_CD_DATA
->DataCdMode
CDIO_DISC_MODE_CD_XA
->XaCdMode
CDIO_DISC_MODE_CD_MIXED
->MixedCdMode
CDIO_DISC_MODE_DVD_ROM
->DvdRomMode
CDIO_DISC_MODE_DVD_RAM
->DvdRamMode
CDIO_DISC_MODE_DVD_R
->DvdRecordableMode
CDIO_DISC_MODE_DVD_RW
->DvdReWritableMode
CDIO_DISC_MODE_HD_DVD_ROM
->HighDefinitionDvdRomMode
CDIO_DISC_MODE_HD_DVD_RAM
->HighDefinitionDvdRamMode
CDIO_DISC_MODE_HD_DVD_R
->HighDefinitionDvdRecordableMode
CDIO_DISC_MODE_DVD_PR
->DvdPlusRecordableMode
CDIO_DISC_MODE_DVD_PRW
->DvdPlusReWritableMode
CDIO_DISC_MODE_DVD_PR_DL
->DoubleLayerDvdPlusRecordableMode
CDIO_DISC_MODE_DVD_PRW_DL
->DoubleLayerDvdPlusReWritableMode
CDIO_DISC_MODE_DVD_OTHER
->OtherDvdMode
CDIO_DISC_MODE_NO_INFO
->NoModeInfo
CDIO_DISC_MODE_CD_I
->CdIMode
CDIO_DISC_MODE_ERROR
(removed; handled viaNothing
)
Symbols
cdio_get_cdtext
(removed; merged intoCdio
objects due to pointer lifespan issues)cdio_get_cdtext_raw
->cdTextRaw
cdio_get_disc_last_lsn
->lastLsn
cdio_get_discmode
->discMode
cdio_get_joliet_level
->discJolietLevel
cdio_get_mcn
->cdMcn
cdio_get_num_tracks
->numTracks
cdio_is_discmode_cdrom
->isCdRom
cdio_is_discmode_dvd
->isDvd
discmode2str
->discModeString
Sound.Libcdio.Read.Data
cdio_get_cdtext
->Sound.Libcdio.Read.CdText.
cdText
cdMcn
->catalogue
cdTextRaw
->Sound.Libcdio.Read.CdText.
cdTextRaw
lastLsn
->lastAddress
mcnLength
(removed; unnecessary low-level detail)numTracks
->Sound.Libcdio.Track.
tracks
Synopsis
- data DiscMode
- = AudioCdMode
- | DataCdMode
- | XaCdMode
- | MixedCdMode
- | DvdRomMode
- | DvdRamMode
- | DvdRecordableMode
- | DvdReWritableMode
- | HighDefinitionDvdRomMode
- | HighDefinitionDvdRamMode
- | HighDefinitionDvdRecordableMode
- | DvdPlusRecordableMode
- | DvdPlusReWritableMode
- | DoubleLayerDvdPlusReWritableMode
- | DoubleLayerDvdPlusRecordableMode
- | OtherDvdMode
- | NoModeInfo
- | CdIMode
- discModeString :: DiscMode -> String
- isCdRom :: DiscMode -> Bool
- isDvd :: DiscMode -> Bool
- discMode :: Cdio -> IO (Maybe DiscMode)
- numTracks :: Cdio -> IO (Maybe Track)
- lastLsn :: Cdio -> IO (Maybe Lsn)
- discJolietLevel :: Cdio -> IO (Maybe Word)
- hasCdText :: Cdio -> Bool
- cdTextRaw :: Cdio -> IO (Maybe ByteString)
- cdMcn :: Cdio -> IO (Maybe String)
- mcnLength :: Word
Types
Different types of disc. Modes are combined from several sources, along with some libcdio-specific additions:
- MMC-5 6.33.3.13 (Send CUESHEET)
- MMC-5 Table 400 "DVD Book"
- GNU/Linux
/usr/include/linux/cdrom.h
As C2HS and Haddock don't yet interact well enough to document Enum fields, some of the less obvious mappings include:
DataCdMode
: CD-ROM form 1MixedCdMode
: some combination ofAudioCdMode
,DataCdMode
, andXaCdMode
DvdPlusRecordableMode
: DVD+RDvdPlusReWritableMode
: DVD+RW
Constructors
Instances
Bounded DiscMode # | |
Enum DiscMode # | |
Defined in Foreign.Libcdio.Types.Enums | |
Eq DiscMode # | |
Ord DiscMode # | |
Defined in Foreign.Libcdio.Types.Enums | |
Read DiscMode # | |
Show DiscMode # | |
discModeString :: DiscMode -> String #
Describe a type a disc according to its official name, as opposed to the
machine representation returned by the Show
instance.
Data
discMode :: Cdio -> IO (Maybe DiscMode) #
Determine which type of disc is being accessed. Note that while this
provides a general direction, it shouldn't be relied upon for actual reading
of data; use trackFormat
for more granular info.
lastLsn :: Cdio -> IO (Maybe Lsn) #
Get the size of a disc in blocks, or equivalently the address of the end of the readable data.
discJolietLevel :: Cdio -> IO (Maybe Word) #
The original ISO 9660 (data) filesystem specification was rather restrictive in what files could be named; the Joliet extensions allow such exciting features as lowercase letters, not to mention full Unicode support.
Whether the various functions in Foreign.Libcdio.CdText will have any
effect, or simply return mempty
.