hscdio-0.1.0.0: Haskell bindings to the libcdio disc-reading library.
Copyright(c) 2018-2021 Sam May
LicenseGPL-3.0-or-later
Maintainerag@eitilt.life
Stabilitystable
Portabilitynon-portable (requires libcdio)
Safe HaskellNone
LanguageHaskell2010

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

Symbols

Sound.Libcdio.Read.Data

Each of the single-sector read* aliases have been removed for consistency.

Synopsis

Types

data ReadMode Source #

How data is laid out on a disc.

data Whence Source #

Which location an offset passed to seek should be based on.

Constructors

SeekStart 
SeekCurrent 
SeekEnd 

Instances

Instances details
Bounded Whence Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Enum Whence Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Eq Whence Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Methods

(==) :: Whence -> Whence -> Bool #

(/=) :: Whence -> Whence -> Bool #

Ord Whence Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Read Whence Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Show Whence Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Functions

Raw

seek :: Cdio -> Int -> Whence -> IO (Either DriverReturnCode Word) Source #

Reposition the read pointer in the Cdio session for a future call to readBytes.

readBytes :: Cdio -> Word -> IO (Maybe ByteString) Source #

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) Source #

Read the data contained in a specific sector from the disc.

readSectors :: Cdio -> Lsn -> ReadMode -> Word -> IO (Either DriverReturnCode ByteString) Source #

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) Source #

Similar to calling readSector with AudioMode, depending on the driver implementation.

readAudioSectors :: Cdio -> Lsn -> Word -> IO (Either DriverReturnCode ByteString) Source #

Similar to calling readSectors with AudioMode, depending on the driver implementation.

readDataSectors Source #

Arguments

:: Cdio 
-> Lsn 
-> Word

Sector size (e.g. dataSize or dataSizeRawXa).

-> 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.

readDataModeSector Source #

Arguments

:: Cdio 
-> Lsn 
-> Bool

If True Form 2, otherwise Form 1 (see Foreign.Libcdio.Sector).

-> IO (Either DriverReturnCode ByteString) 

Similar to calling readSector, depending on the driver implementation.

readDataModeSectors Source #

Arguments

:: Cdio 
-> Lsn 
-> Bool

If True Form 2, otherwise Form 1 (see Foreign.Libcdio.Sector).

-> Word 
-> IO (Either DriverReturnCode ByteString) 

Similar to calling readSectors, depending on the driver implementation.

readXaModeSector Source #

Arguments

:: Cdio 
-> Lsn 
-> Bool

If True Form 2, otherwise Form 1 (see Foreign.Libcdio.Sector).

-> IO (Either DriverReturnCode ByteString) 

Similar to calling readSector, depending on the driver implementation.

readXaModeSectors Source #

Arguments

:: Cdio 
-> Lsn 
-> Bool

If True Form 2, otherwise Form 1 (see Foreign.Libcdio.Sector).

-> Word 
-> IO (Either DriverReturnCode ByteString) 

Similar to calling readSectors, depending on the driver implementation.