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.Read
Description
After obtaining landmarks through Foreign.Libcdio.Disc (and likely
Foreign.Libcdio.Track), this module provides the functions required to
actually retrive the primary data from the disc. Some knowledge of its
physical layout is required, which may be determined through
trackFormat
.
read.h
Types
cdio_read_mode_t
->ReadMode
CDIO_READ_MODE_M1F1
->Mode1Form1
CDIO_READ_MODE_M1F2
->Mode1Form2
CDIO_READ_MODE_M2F1
->Mode2Form1
CDIO_READ_MODE_M2F2
->Mode2Form2
Symbols
cdio_lseek
->seek
cdio_read
->readBytes
cdio_read_audio_sector
->readAudioSector
cdio_read_audio_sectors
->readAudioSectors
cdio_read_data_sectors
->readDataSectors
cdio_read_mode1_sector
->readDataModeSector
cdio_read_mode1_sectors
->readDataModeSectors
cdio_read_mode2_sector
->readXaModeSector
cdio_read_mode2_sectors
->readXaModeSectors
cdio_read_sector
->readSector
cdio_read_sectors
->readSectors
Sound.Libcdio.Read.Data
Each of the single-sector read*
aliases have been removed for consistency.
ReadMode
(removed; unnecessary low-level detail)readAudioSectors
->readAudio
readBytes
->readRaw
(note that the count is now the number of sectors rather than bytes)readDataModeSectors
->readData
readDataSectors
(removed; unnecessary low-level detail)readXaModeSectors
->readXa
Synopsis
- data ReadMode
- data Whence
- seek :: Cdio -> Int -> Whence -> IO (Either DriverReturnCode Word)
- readBytes :: Cdio -> Word -> IO (Maybe ByteString)
- readSector :: Cdio -> Lsn -> ReadMode -> IO (Either DriverReturnCode ByteString)
- readSectors :: Cdio -> Lsn -> ReadMode -> Word -> IO (Either DriverReturnCode ByteString)
- readAudioSector :: Cdio -> Lsn -> IO (Either DriverReturnCode ByteString)
- readAudioSectors :: Cdio -> Lsn -> Word -> IO (Either DriverReturnCode ByteString)
- readDataSectors :: Cdio -> Lsn -> Word -> Word -> IO (Either DriverReturnCode ByteString)
- readDataModeSector :: Cdio -> Lsn -> Bool -> IO (Either DriverReturnCode ByteString)
- readDataModeSectors :: Cdio -> Lsn -> Bool -> Word -> IO (Either DriverReturnCode ByteString)
- readXaModeSector :: Cdio -> Lsn -> Bool -> IO (Either DriverReturnCode ByteString)
- readXaModeSectors :: Cdio -> Lsn -> Bool -> Word -> IO (Either DriverReturnCode ByteString)
Types
How data is laid out on a disc.
Constructors
AudioMode | |
Mode1Form1 | |
Mode1Form2 | |
Mode2Form1 | |
Mode2Form2 |
Instances
Bounded ReadMode # | |
Enum ReadMode # | |
Defined in Foreign.Libcdio.Types.Enums | |
Eq ReadMode # | |
Ord ReadMode # | |
Defined in Foreign.Libcdio.Types.Enums | |
Read ReadMode # | |
Show ReadMode # | |
Which location an offset passed to seek
should be
based on.
Constructors
SeekStart | |
SeekCurrent | |
SeekEnd |
Functions
Raw
readBytes :: Cdio -> Word -> IO (Maybe ByteString) #
Read a given number of bytes from the disc. With data of a known
structure, use readSectors
or similar instead, which don't include the
headers and footers described in Foreign.Libcdio.Sector.
Sector
readSector :: Cdio -> Lsn -> ReadMode -> IO (Either DriverReturnCode ByteString) #
Read the data contained in a specific sector from the disc.
readSectors :: Cdio -> Lsn -> ReadMode -> Word -> IO (Either DriverReturnCode ByteString) #
Read the data contained in the given number of sectors from the disc, beginning with the specified sector.
readAudioSector :: Cdio -> Lsn -> IO (Either DriverReturnCode ByteString) #
Similar to calling readSector
with AudioMode
, depending on the driver
implementation.
readAudioSectors :: Cdio -> Lsn -> Word -> IO (Either DriverReturnCode ByteString) #
Similar to calling readSectors
with AudioMode
, depending on the driver
implementation.
Arguments
:: Cdio | |
-> Lsn | |
-> Word | Sector size (e.g. |
-> Word | Number of sectors to read. |
-> IO (Either DriverReturnCode ByteString) |
Read the raw data from a given number of sectors on the disc, beginning with the specified sector.
Arguments
:: Cdio | |
-> Lsn | |
-> Bool | If |
-> IO (Either DriverReturnCode ByteString) |
Similar to calling readSector
, depending on the driver implementation.
Arguments
:: Cdio | |
-> Lsn | |
-> Bool | If |
-> Word | |
-> IO (Either DriverReturnCode ByteString) |
Similar to calling readSectors
, depending on the driver implementation.
Arguments
:: Cdio | |
-> Lsn | |
-> Bool | If |
-> IO (Either DriverReturnCode ByteString) |
Similar to calling readSector
, depending on the driver implementation.
Arguments
:: Cdio | |
-> Lsn | |
-> Bool | If |
-> Word | |
-> IO (Either DriverReturnCode ByteString) |
Similar to calling readSectors
, depending on the driver implementation.