hscdio- Haskell bindings to the libcdio disc-reading library.
Copyright(c) 2018-2021 Sam May
Portabilitynon-portable (requires libcdio)
Safe HaskellNone




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.






data DiscMode #

Different types of disc. Modes are combined from several sources, along with some libcdio-specific additions:

  • MMC-5 (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:

discModeString :: DiscMode -> String #

Describe a type a disc according to its official name, as opposed to the machine representation returned by the Show instance.

isCdRom :: DiscMode -> Bool #

Return true if a DiscMode refers to some sort of CD.

isDvd :: DiscMode -> Bool #

Return true if a DiscMode refers to some sort of DVD.


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.

numTracks :: Cdio -> IO (Maybe Track) #

Get the number of tracks on a CD.

Returns Nothing if the Cdio object has already been closed, or if the disc table of contents can't be read.

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.

hasCdText :: Cdio -> Bool #

Whether the various functions in Foreign.Libcdio.CdText will have any effect, or simply return mempty.

cdTextRaw :: Cdio -> IO (Maybe ByteString) #

Get the raw CD-Text binary data contained on a disc.

cdMcn :: Cdio -> IO (Maybe String) #

Get the media catalog number from a disc. This may also be retrieved by getField UpcEan Nothing, though that references a different source and thus may not have the same return value.

mcnLength :: Word #

Number of ASCII bytes in a media catalog number.