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

 
Synopsis

Disc

data Cdio a Source #

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 Source # 
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 Source # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

Methods

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

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

MonadFail Cdio Source #

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

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 Source # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

MonadError CdioError Cdio Source # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

Methods

throwError :: CdioError -> Cdio a #

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

data CdioError Source #

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

Instances

Instances details
Eq CdioError Source # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

Read CdioError Source # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

Show CdioError Source # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

MonadError CdioError Cdio Source # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

Methods

throwError :: CdioError -> Cdio a #

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

data CdioErrorType Source #

Potential situations which may cause a computation to fail.

data Whence Source #

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

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

data Lsn Source #

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 Source # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

minBound :: Lsn #

maxBound :: Lsn #

Enum Lsn Source # 
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 Source # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

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

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

Integral Lsn Source # 
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 Source # 
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 Source # 
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 Source # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Real Lsn Source # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

toRational :: Lsn -> Rational #

Show Lsn Source # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

showsPrec :: Int -> Lsn -> ShowS #

show :: Lsn -> String #

showList :: [Lsn] -> ShowS #

Ix Lsn Source # 
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 Source # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Storable Lsn Source # 
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 Source # 
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 Source # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

data Track Source #

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

Instances

Instances details
Bounded Track Source # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Enum Track Source #

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 Source # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

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

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

Num Track Source # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Ord Track Source # 
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 Source # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Show Track Source # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Methods

showsPrec :: Int -> Track -> ShowS #

show :: Track -> String #

showList :: [Track] -> ShowS #

Ix Track Source # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

PrintfArg Track Source # 
Instance details

Defined in Foreign.Libcdio.Types.Internal

Storable Track Source #

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

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

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 Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Enum TrackFormat Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Eq TrackFormat Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ord TrackFormat Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Read TrackFormat Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Show TrackFormat Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

data SessionArg Source #

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 Source # 
Instance details

Defined in Foreign.Libcdio.Device

Enum SessionArg Source # 
Instance details

Defined in Foreign.Libcdio.Device

Eq SessionArg Source # 
Instance details

Defined in Foreign.Libcdio.Device

Ord SessionArg Source # 
Instance details

Defined in Foreign.Libcdio.Device

Read SessionArg Source # 
Instance details

Defined in Foreign.Libcdio.Device

Show SessionArg Source # 
Instance details

Defined in Foreign.Libcdio.Device

Storable SessionArg Source # 
Instance details

Defined in Foreign.Libcdio.Device

CdText

data CdText a Source #

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 Source # 
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 Source # 
Instance details

Defined in Sound.Libcdio.Read.CdText

Methods

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

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

MonadFail CdText Source #

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

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 Source # 
Instance details

Defined in Sound.Libcdio.Read.CdText

MonadError CdTextError CdText Source # 
Instance details

Defined in Sound.Libcdio.Read.CdText

data CdTextError Source #

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

data Info Source #

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

Instances

Instances details
Eq Info Source # 
Instance details

Defined in Sound.Libcdio.Read.CdText

Methods

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

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

Read Info Source # 
Instance details

Defined in Sound.Libcdio.Read.CdText

Show Info Source #

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

Genres recognized in the CD Text standard.

Instances

Instances details
Bounded Genre Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Enum Genre Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Eq Genre Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Methods

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

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

Ord Genre Source # 
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 Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Show Genre Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Methods

showsPrec :: Int -> Genre -> ShowS #

show :: Genre -> String #

showList :: [Genre] -> ShowS #

data Language Source #

Written languages recognized in the CD Text standard.

Hardware

data DriverId Source #

Devices or file types supported by the library.

data DriverReturnCode Source #

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

Instances

Instances details
Bounded DriverReturnCode Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Enum DriverReturnCode Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Eq DriverReturnCode Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ord DriverReturnCode Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Read DriverReturnCode Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Show DriverReturnCode Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

data DriveCapabilityRead Source #

Instances

Instances details
Bounded DriveCapabilityRead Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Enum DriveCapabilityRead Source #

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 Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ord DriveCapabilityRead Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Read DriveCapabilityRead Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Show DriveCapabilityRead Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ix DriveCapabilityRead Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

type DriveReadCaps = BitArray DriveCapabilityRead Source #

The collection of features for reading discs a device provides.

data DriveCapabilityWrite Source #

Instances

Instances details
Bounded DriveCapabilityWrite Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Enum DriveCapabilityWrite Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Eq DriveCapabilityWrite Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ord DriveCapabilityWrite Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Read DriveCapabilityWrite Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Show DriveCapabilityWrite Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ix DriveCapabilityWrite Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

type DriveWriteCaps = BitArray DriveCapabilityWrite Source #

The collection of features for writing discs a device provides.

data DriveCapabilityMisc Source #

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

Instances

Instances details
Bounded DriveCapabilityMisc Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Enum DriveCapabilityMisc Source #

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 Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ord DriveCapabilityMisc Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Read DriveCapabilityMisc Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Show DriveCapabilityMisc Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ix DriveCapabilityMisc Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

type DriveMiscCaps = BitArray DriveCapabilityMisc Source #

The collection of hardware features a device was built with.

type DriveCaps = (DriveReadCaps, DriveWriteCaps, DriveMiscCaps) Source #

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

data DiscMode Source #

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

Types of filesystem which may be read from a disc.

Instances

Instances details
Bounded Filesystem Source # 
Instance details

Defined in Foreign.Libcdio.CdTypes

Enum Filesystem Source # 
Instance details

Defined in Foreign.Libcdio.CdTypes

Eq Filesystem Source # 
Instance details

Defined in Foreign.Libcdio.CdTypes

Ord Filesystem Source # 
Instance details

Defined in Foreign.Libcdio.CdTypes

Read Filesystem Source # 
Instance details

Defined in Foreign.Libcdio.CdTypes

Show Filesystem Source # 
Instance details

Defined in Foreign.Libcdio.CdTypes

data FilesystemClass Source #

Higher-level descriptions of discs/filesystems.

Instances

Instances details
Bounded FilesystemClass Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Enum FilesystemClass Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Eq FilesystemClass Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ord FilesystemClass Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Read FilesystemClass Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Show FilesystemClass Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

Ix FilesystemClass Source # 
Instance details

Defined in Foreign.Libcdio.Types.Enums

type FilesystemClasses = BitArray FilesystemClass Source #

A collection of disc/filesystem descriptions.

data IsoAnalysis Source #

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

Logging

class LibcdioLogger m Source #

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

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 Source # 
Instance details

Defined in Sound.Libcdio.Types.Cdio

LibcdioLogger CdText Source # 
Instance details

Defined in Sound.Libcdio.Read.CdText

data LogEntry Source #

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

data LogLevel Source #

How much detail should be recorded in the logs.