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

Sound.Libcdio.Types

Description

 

Disc

data Cdio a #

A computation within the environment of the data (music or file) stored on a CD. The options for affecting that environment from within are limited by design, as this library is intended for reading discs rather than authoring them.

Instances

Instances details
Monad Cdio # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

Methods

(>>=) :: Cdio a -> (a -> Cdio b) -> Cdio b #

(>>) :: Cdio a -> Cdio b -> Cdio b #

return :: a -> Cdio a #

Functor Cdio # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

Methods

fmap :: (a -> b) -> Cdio a -> Cdio b #

(<$) :: a -> Cdio b -> Cdio a #

MonadFail Cdio #

Wraps the text in a FreeformCdioError, for recovery with catchError.

Instance details

Defined in Sound.Libcdio.Types.Cdio

Methods

fail :: String -> Cdio a #

Applicative Cdio # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

Methods

pure :: a -> Cdio a #

(<*>) :: Cdio (a -> b) -> Cdio a -> Cdio b #

liftA2 :: (a -> b -> c) -> Cdio a -> Cdio b -> Cdio c #

(*>) :: Cdio a -> Cdio b -> Cdio b #

(<*) :: Cdio a -> Cdio b -> Cdio a #

Alternative Cdio #

empty fails with CdioEmpty.

Instance details

Defined in Sound.Libcdio.Types.Cdio

Methods

empty :: Cdio a #

(<|>) :: Cdio a -> Cdio a -> Cdio a #

some :: Cdio a -> Cdio [a] #

many :: Cdio a -> Cdio [a] #

LibcdioLogger Cdio # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

MonadError CdioError Cdio # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

Methods

throwError :: CdioError -> Cdio a #

catchError :: Cdio a -> (CdioError -> Cdio a) -> Cdio a #

data CdioError #

Associates a well-typed error with human-readable context information.

Instances

Instances details
Eq CdioError # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

Read CdioError # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

Show CdioError # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

MonadError CdioError Cdio # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

Methods

throwError :: CdioError -> Cdio a #

catchError :: Cdio a -> (CdioError -> Cdio a) -> Cdio a #

data CdioErrorType #

Potential situations which may cause a computation to fail.

data Whence #

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

Instances

Instances details
Bounded Whence # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Enum Whence # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Eq Whence # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Methods

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

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

Ord Whence # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Read Whence # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Show Whence # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

data Lsn #

The type-safe representation of a Logical Sector Number, counting sectors from the start of track 1; this notably excludes the blank session lead-in. See also Lba.

Instances

Instances details
Bounded Lsn # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

minBound :: Lsn #

maxBound :: Lsn #

Enum Lsn # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

succ :: Lsn -> Lsn #

pred :: Lsn -> Lsn #

toEnum :: Int -> Lsn #

fromEnum :: Lsn -> Int #

enumFrom :: Lsn -> [Lsn] #

enumFromThen :: Lsn -> Lsn -> [Lsn] #

enumFromTo :: Lsn -> Lsn -> [Lsn] #

enumFromThenTo :: Lsn -> Lsn -> Lsn -> [Lsn] #

Eq Lsn # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

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

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

Integral Lsn # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

quot :: Lsn -> Lsn -> Lsn #

rem :: Lsn -> Lsn -> Lsn #

div :: Lsn -> Lsn -> Lsn #

mod :: Lsn -> Lsn -> Lsn #

quotRem :: Lsn -> Lsn -> (Lsn, Lsn) #

divMod :: Lsn -> Lsn -> (Lsn, Lsn) #

toInteger :: Lsn -> Integer #

Num Lsn # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

(+) :: Lsn -> Lsn -> Lsn #

(-) :: Lsn -> Lsn -> Lsn #

(*) :: Lsn -> Lsn -> Lsn #

negate :: Lsn -> Lsn #

abs :: Lsn -> Lsn #

signum :: Lsn -> Lsn #

fromInteger :: Integer -> Lsn #

Ord Lsn # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

compare :: Lsn -> Lsn -> Ordering #

(<) :: Lsn -> Lsn -> Bool #

(<=) :: Lsn -> Lsn -> Bool #

(>) :: Lsn -> Lsn -> Bool #

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

max :: Lsn -> Lsn -> Lsn #

min :: Lsn -> Lsn -> Lsn #

Read Lsn # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Real Lsn # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

toRational :: Lsn -> Rational #

Show Lsn # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

showsPrec :: Int -> Lsn -> ShowS #

show :: Lsn -> String #

showList :: [Lsn] -> ShowS #

Ix Lsn # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

range :: (Lsn, Lsn) -> [Lsn] #

index :: (Lsn, Lsn) -> Lsn -> Int #

unsafeIndex :: (Lsn, Lsn) -> Lsn -> Int #

inRange :: (Lsn, Lsn) -> Lsn -> Bool #

rangeSize :: (Lsn, Lsn) -> Int #

unsafeRangeSize :: (Lsn, Lsn) -> Int #

PrintfArg Lsn # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Storable Lsn # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

sizeOf :: Lsn -> Int #

alignment :: Lsn -> Int #

peekElemOff :: Ptr Lsn -> Int -> IO Lsn #

pokeElemOff :: Ptr Lsn -> Int -> Lsn -> IO () #

peekByteOff :: Ptr b -> Int -> IO Lsn #

pokeByteOff :: Ptr b -> Int -> Lsn -> IO () #

peek :: Ptr Lsn -> IO Lsn #

poke :: Ptr Lsn -> Lsn -> IO () #

Bits Lsn # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

(.&.) :: Lsn -> Lsn -> Lsn #

(.|.) :: Lsn -> Lsn -> Lsn #

xor :: Lsn -> Lsn -> Lsn #

complement :: Lsn -> Lsn #

shift :: Lsn -> Int -> Lsn #

rotate :: Lsn -> Int -> Lsn #

zeroBits :: Lsn #

bit :: Int -> Lsn #

setBit :: Lsn -> Int -> Lsn #

clearBit :: Lsn -> Int -> Lsn #

complementBit :: Lsn -> Int -> Lsn #

testBit :: Lsn -> Int -> Bool #

bitSizeMaybe :: Lsn -> Maybe Int #

bitSize :: Lsn -> Int #

isSigned :: Lsn -> Bool #

shiftL :: Lsn -> Int -> Lsn #

unsafeShiftL :: Lsn -> Int -> Lsn #

shiftR :: Lsn -> Int -> Lsn #

unsafeShiftR :: Lsn -> Int -> Lsn #

rotateL :: Lsn -> Int -> Lsn #

rotateR :: Lsn -> Int -> Lsn #

popCount :: Lsn -> Int #

FiniteBits Lsn # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

data Track #

An index into the segmentation within a write session on a disc.

Instances

Instances details
Bounded Track # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Enum Track #

Note that fromEnum DiscLeadout uses a value (== 100) chosen to be contiguous to the rest of the datatype rather than that used internally (== 0xAA). toEnum accepts both values.

Instance details

Defined in Foreign.Libcdio.Types.Internal

Eq Track # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

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

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

Num Track # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Ord Track # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

compare :: Track -> Track -> Ordering #

(<) :: Track -> Track -> Bool #

(<=) :: Track -> Track -> Bool #

(>) :: Track -> Track -> Bool #

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

max :: Track -> Track -> Track #

min :: Track -> Track -> Track #

Read Track # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Show Track # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

showsPrec :: Int -> Track -> ShowS #

show :: Track -> String #

showList :: [Track] -> ShowS #

Ix Track # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

PrintfArg Track # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Storable Track #

Note that poke uses the official representation of DiscLeadout (CDIO_CDROM_LEADOUT_TRACK == 0xAA, as used by libcdio) rather than the hscdio fromEnum DiscLeadout (== 100), as the latter was chosen for proximity to the other constructors.

Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

sizeOf :: Track -> Int #

alignment :: Track -> Int #

peekElemOff :: Ptr Track -> Int -> IO Track #

pokeElemOff :: Ptr Track -> Int -> Track -> IO () #

peekByteOff :: Ptr b -> Int -> IO Track #

pokeByteOff :: Ptr b -> Int -> Track -> IO () #

peek :: Ptr Track -> IO Track #

poke :: Ptr Track -> Track -> IO () #

data TrackNum #

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 #

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.

Instances

Instances details
Bounded TrackFormat # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Enum TrackFormat # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Eq TrackFormat # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ord TrackFormat # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Read TrackFormat # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Show TrackFormat # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

data SessionArg #

Metadata about the session in the form of (often freeform) text, providing a type-safe index to getArg. Note that not every driver type supports every item.

The key "access-mode" is handled separately by getAccessMode, to better reflect its restricted outputs.

Instances

Instances details
Bounded SessionArg # 
Instance details

Defined in Foreign.Libcdio.Device

Enum SessionArg # 
Instance details

Defined in Foreign.Libcdio.Device

Eq SessionArg # 
Instance details

Defined in Foreign.Libcdio.Device

Ord SessionArg # 
Instance details

Defined in Foreign.Libcdio.Device

Read SessionArg # 
Instance details

Defined in Foreign.Libcdio.Device

Show SessionArg # 
Instance details

Defined in Foreign.Libcdio.Device

Storable SessionArg # 
Instance details

Defined in Foreign.Libcdio.Device

CdText

data CdText a #

A computation within the environment of metadata (in a particular language) stored on a CD. The options for affecting that environment from within are limited by design, as this library is intended for reading discs rather than authoring them.

Instances

Instances details
Monad CdText # 
Instance details

Defined in Sound.Libcdio.Read.CdText

Methods

(>>=) :: CdText a -> (a -> CdText b) -> CdText b #

(>>) :: CdText a -> CdText b -> CdText b #

return :: a -> CdText a #

Functor CdText # 
Instance details

Defined in Sound.Libcdio.Read.CdText

Methods

fmap :: (a -> b) -> CdText a -> CdText b #

(<$) :: a -> CdText b -> CdText a #

MonadFail CdText #

Wraps the text in a FreeformCdTextError, for recovery with catchError.

Instance details

Defined in Sound.Libcdio.Read.CdText

Methods

fail :: String -> CdText a #

Applicative CdText # 
Instance details

Defined in Sound.Libcdio.Read.CdText

Methods

pure :: a -> CdText a #

(<*>) :: CdText (a -> b) -> CdText a -> CdText b #

liftA2 :: (a -> b -> c) -> CdText a -> CdText b -> CdText c #

(*>) :: CdText a -> CdText b -> CdText b #

(<*) :: CdText a -> CdText b -> CdText a #

Alternative CdText #

empty fails with CdTextEmpty.

Instance details

Defined in Sound.Libcdio.Read.CdText

Methods

empty :: CdText a #

(<|>) :: CdText a -> CdText a -> CdText a #

some :: CdText a -> CdText [a] #

many :: CdText a -> CdText [a] #

LibcdioLogger CdText # 
Instance details

Defined in Sound.Libcdio.Read.CdText

MonadError CdTextError CdText # 
Instance details

Defined in Sound.Libcdio.Read.CdText

data CdTextError #

Associates a well-typed error with human-readable context information.

data CdTextErrorType #

Potential situations which may cause a computation to fail.

data Info #

Textual metadata describing a single track on a disc, or the disc itself.

Instances

Instances details
Eq Info # 
Instance details

Defined in Sound.Libcdio.Read.CdText

Methods

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

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

Read Info # 
Instance details

Defined in Sound.Libcdio.Read.CdText

Show Info #

Modeled after the standard record syntax, but omitting any Nothing fields for space reasons.

Instance details

Defined in Sound.Libcdio.Read.CdText

Methods

showsPrec :: Int -> Info -> ShowS #

show :: Info -> String #

showList :: [Info] -> ShowS #

data Genre #

Genres recognized in the CD Text standard.

Instances

Instances details
Bounded Genre # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Enum Genre # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Eq Genre # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Methods

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

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

Ord Genre # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Methods

compare :: Genre -> Genre -> Ordering #

(<) :: Genre -> Genre -> Bool #

(<=) :: Genre -> Genre -> Bool #

(>) :: Genre -> Genre -> Bool #

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

max :: Genre -> Genre -> Genre #

min :: Genre -> Genre -> Genre #

Read Genre # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Show Genre # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Methods

showsPrec :: Int -> Genre -> ShowS #

show :: Genre -> String #

showList :: [Genre] -> ShowS #

data Language #

Written languages recognized in the CD Text standard.

Hardware

data DriverId #

Devices or file types supported by the library.

data DriverReturnCode #

Descriptions of various error states which may be returned by driver functions.

Instances

Instances details
Bounded DriverReturnCode # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Enum DriverReturnCode # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Eq DriverReturnCode # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ord DriverReturnCode # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Read DriverReturnCode # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Show DriverReturnCode # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

data HardwareInfo #

Information defining the make and model of a (typically physical) device.

data DriveCapabilityRead #

Instances

Instances details
Bounded DriveCapabilityRead # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Enum DriveCapabilityRead #

Write-related properties a device can have, mostly describing what formats it can burn, which are collected in DriveWriteCaps.

Instance details

Defined in Foreign.Libcdio.Types.Enums

Eq DriveCapabilityRead # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ord DriveCapabilityRead # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Read DriveCapabilityRead # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Show DriveCapabilityRead # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ix DriveCapabilityRead # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

type DriveReadCaps = BitArray DriveCapabilityRead #

The collection of features for reading discs a device provides.

data DriveCapabilityWrite #

Instances

Instances details
Bounded DriveCapabilityWrite # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Enum DriveCapabilityWrite # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Eq DriveCapabilityWrite # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ord DriveCapabilityWrite # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Read DriveCapabilityWrite # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Show DriveCapabilityWrite # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ix DriveCapabilityWrite # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

type DriveWriteCaps = BitArray DriveCapabilityWrite #

The collection of features for writing discs a device provides.

data DriveCapabilityMisc #

Miscellaneous properties a device can have, typically describing hardware features, which are collected in DriveMiscCaps.

Instances

Instances details
Bounded DriveCapabilityMisc # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Enum DriveCapabilityMisc #

Read-related properties a device can have, mostly describing what formats it understands, which are collected in DriveReadCaps.

The difference between ReadAnalogAudio and ReadDigitalAudio is poorly documented in libcdio; they have been named here according to their assumed meanings (see https://www.cdrfaq.org/faq02.html#S2-4-3), but that pattern may not be completely accurate.

Instance details

Defined in Foreign.Libcdio.Types.Enums

Eq DriveCapabilityMisc # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ord DriveCapabilityMisc # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Read DriveCapabilityMisc # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Show DriveCapabilityMisc # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ix DriveCapabilityMisc # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

type DriveMiscCaps = BitArray DriveCapabilityMisc #

The collection of hardware features a device was built with.

type DriveCaps = (DriveReadCaps, DriveWriteCaps, DriveMiscCaps) #

The three types are usually passed around together, so we can simplify the type signatures using them.

data DiscMode #

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:

Data

data Filesystem #

Types of filesystem which may be read from a disc.

Instances

Instances details
Bounded Filesystem # 
Instance details

Defined in Foreign.Libcdio.CdTypes

Enum Filesystem # 
Instance details

Defined in Foreign.Libcdio.CdTypes

Eq Filesystem # 
Instance details

Defined in Foreign.Libcdio.CdTypes

Ord Filesystem # 
Instance details

Defined in Foreign.Libcdio.CdTypes

Read Filesystem # 
Instance details

Defined in Foreign.Libcdio.CdTypes

Show Filesystem # 
Instance details

Defined in Foreign.Libcdio.CdTypes

data FilesystemClass #

Higher-level descriptions of discs/filesystems.

Instances

Instances details
Bounded FilesystemClass # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Enum FilesystemClass # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Eq FilesystemClass # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ord FilesystemClass # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Read FilesystemClass # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Show FilesystemClass # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ix FilesystemClass # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

type FilesystemClasses = BitArray FilesystemClass #

A collection of disc/filesystem descriptions.

data IsoAnalysis #

A collection of data describing a disc using the ISO 9660 standard.

Logging

class LibcdioLogger m #

An environment which integrates the libcdio logging interface; will almost always be a Monad, but as an Applicative might technically be able to implement these, that constraint isn't enforced.

Minimal complete definition

logCutoff, setLogCutoff, readLog, clearLog, putLog

Instances

Instances details
LibcdioLogger IO #

The required initialization function setupLogger isn't called automatically; make sure to do so manually before using any of these.

Instance details

Defined in Sound.Libcdio.Logging

LibcdioLogger Cdio # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

LibcdioLogger CdText # 
Instance details

Defined in Sound.Libcdio.Read.CdText

data LogEntry #

An unstructured message emitted from the library to let the user know what's going on behind the scenes.

Instances

Instances details
Eq LogEntry # 
Instance details

Defined in Foreign.Libcdio.Logging

Read LogEntry # 
Instance details

Defined in Foreign.Libcdio.Logging

Show LogEntry # 
Instance details

Defined in Foreign.Libcdio.Logging

Storable LogEntry # 
Instance details

Defined in Foreign.Libcdio.Logging

data LogLevel #

How much detail should be recorded in the logs.