Copyright | (c) 2020-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.Types
Description
The original header defined a rather heterogeneous collection of typedefs,
enums, and preprocessor macros, none of which provide much utility when
separated from their associated functions. Instead of following that design
decision (which only makes sense under the C #include
model), this module
instead exports every type used by the interface without any constructors or
associated functions, for any type signatures which may expose an object only
in passing it along.
types.h
Defines
CDIO_INVALID_LBA
(removed; handled viaNothing
)CDIO_INVALID_LSN
(removed; handled viaNothing
)CDIO_INVALID_SESSION
(removed; handled viaNothing
)CDIO_ISRC_SIZE
->Foreign.Libcdio.Track.
isrcLength
CDIO_MCN_SIZE
->Foreign.Libcdio.Disc.
mcnLength
__cd_offsetof
(removed; structural calculation encapsulated behind the scenes)
Types
CdioDataFree_t
(removed; pointer handling is encapsulated behind the scenes)bitfield_t
(removed; accomplished with greater safety through Data.Array.BitArray)
cdio_cdrom_addr
(removed; never used in library code)cdio_fs_anal_t
->Foreign.Libcdio.CdTypes.
,Filesystem
FilesystemClasses
, andIsoAnalysis
cdio_isrc_t
(removed; never used in library code)cdio_mcn_t
(removed; never used in library code)cdio_track_flag
(removed; identical in all but name toFlag
)cdio_utf8_t
(removed;Char
already serves this purpose)lba_t
->Foreign.Libcdio.Sector.
Lba
lsn_t
->Foreign.Libcdio.Sector.
Lsn
msf_t
->Foreign.Libcdio.Sector.
Msf
session_t
(removed: only used internally)track_t
->Foreign.Libcdio.Track.
Track
Sound.Libcdio.Types
The exact collection of exported types has been changed to reflect those used by the higher-level interface, but the modules are otherwise very similar; many types are shared between the two.
Synopsis
- data Cdio
- data Whence
- data Lba
- data Lsn
- data Msf
- data Bcd
- data Track
- data TrackNum
- data TrackFormat
- data ReadMode
- data SessionArg
- data SubchannelData
- data Field
- data Genre
- data Language
- data Flag
- type Flags = BitArray Flag
- data DriverId
- data DriverReturnCode
- data HardwareInfo
- data DriveCapabilityRead
- type DriveReadCaps = BitArray DriveCapabilityRead
- data DriveCapabilityWrite
- type DriveWriteCaps = BitArray DriveCapabilityWrite
- data DriveCapabilityMisc
- type DriveMiscCaps = BitArray DriveCapabilityMisc
- type DriveCaps = (DriveReadCaps, DriveWriteCaps, DriveMiscCaps)
- data DiscMode
- data Filesystem
- data FilesystemClass
- type FilesystemClasses = BitArray FilesystemClass
- data IsoAnalysis
- data LogEntry
- data LogLevel
Disc
A particular disc reading/writing device, along with the data contained on the loaded disc. Note well that this is always a mutable object, and is not thread-safe; moreover, any function this is passed to may wind up silently modifying the data.
Which location an offset passed to seek
should be
based on.
The type-safe representation of a Logical Block Address, counting sectors
from the very beginning of the write session. See also Lsn
.
Instances
Bounded Lba # | |
Enum Lba # | |
Eq Lba # | |
Integral Lba # | |
Num Lba # | |
Ord Lba # | |
Read Lba # | |
Real Lba # | |
Defined in Foreign.Libcdio.Types.Internal Methods toRational :: Lba -> Rational # | |
Show Lba # | |
Ix Lba # | |
PrintfArg Lba # | |
Defined in Foreign.Libcdio.Types.Internal | |
Storable Lba # | |
Defined in Foreign.Libcdio.Types.Internal | |
Bits Lba # | |
Defined in Foreign.Libcdio.Types.Internal | |
FiniteBits Lba # | |
Defined in Foreign.Libcdio.Types.Internal Methods finiteBitSize :: Lba -> Int # countLeadingZeros :: Lba -> Int # countTrailingZeros :: Lba -> Int # |
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
Bounded Lsn # | |
Enum Lsn # | |
Eq Lsn # | |
Integral Lsn # | |
Num Lsn # | |
Ord Lsn # | |
Read Lsn # | |
Real Lsn # | |
Defined in Foreign.Libcdio.Types.Internal Methods toRational :: Lsn -> Rational # | |
Show Lsn # | |
Ix Lsn # | |
PrintfArg Lsn # | |
Defined in Foreign.Libcdio.Types.Internal | |
Storable Lsn # | |
Defined in Foreign.Libcdio.Types.Internal | |
Bits Lsn # | |
Defined in Foreign.Libcdio.Types.Internal | |
FiniteBits Lsn # | |
Defined in Foreign.Libcdio.Types.Internal Methods finiteBitSize :: Lsn -> Int # countLeadingZeros :: Lsn -> Int # countTrailingZeros :: Lsn -> Int # |
Minute/second/frame structure for addresses. Generally only makes sense for audio discs.
A bitwise encoding where the lower four bits encode a number modulo 10, and the upper encode the same divided by 10.
Instances
Bounded Bcd # |
|
Enum Bcd # | |
Eq Bcd # | |
Integral Bcd # | |
Num Bcd # | |
Ord Bcd # | |
Read Bcd # | |
Real Bcd # | |
Defined in Foreign.Libcdio.Util Methods toRational :: Bcd -> Rational # | |
Show Bcd # | |
Ix Bcd # | |
PrintfArg Bcd # | |
Defined in Foreign.Libcdio.Util | |
Storable Bcd # | |
Defined in Foreign.Libcdio.Util |
An index into the segmentation within a write session on a disc.
Instances
Bounded Track # | |
Enum Track # | Note that |
Defined in Foreign.Libcdio.Types.Internal | |
Eq Track # | |
Num Track # | |
Ord Track # | |
Read Track # | |
Show Track # | |
Ix Track # | |
PrintfArg Track # | |
Defined in Foreign.Libcdio.Types.Internal | |
Storable Track # | Note that |
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
How data is laid out on a disc.
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 # | |
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
CdText
data SubchannelData #
Types of information stored on disc subchannels.
Instances
Genres recognized in the CD Text standard.
Written languages recognized in the CD Text standard.
Instances
Bounded Language # | |
Enum Language # | |
Defined in Foreign.Libcdio.Types.Enums | |
Eq Language # | |
Ord Language # | |
Defined in Foreign.Libcdio.Types.Enums | |
Read Language # | |
Show Language # | |
Metadata describing the layout or type of data on a track.
Hardware
Devices or file types supported by the library.
Instances
Bounded DriverId # | |
Enum DriverId # | |
Defined in Foreign.Libcdio.Types.Enums | |
Eq DriverId # | |
Ord DriverId # | |
Defined in Foreign.Libcdio.Types.Enums | |
Read DriverId # | |
Show DriverId # | |
data DriverReturnCode #
Descriptions of various error states which may be returned by driver functions.
Instances
data HardwareInfo #
Information defining the make and model of a (typically physical) device.
Instances
Eq HardwareInfo # | |
Defined in Foreign.Libcdio.Device | |
Read HardwareInfo # | |
Defined in Foreign.Libcdio.Device Methods readsPrec :: Int -> ReadS HardwareInfo # readList :: ReadS [HardwareInfo] # | |
Show HardwareInfo # | |
Defined in Foreign.Libcdio.Device Methods showsPrec :: Int -> HardwareInfo -> ShowS # show :: HardwareInfo -> String # showList :: [HardwareInfo] -> ShowS # | |
Storable HardwareInfo # | |
Defined in Foreign.Libcdio.Device Methods sizeOf :: HardwareInfo -> Int # alignment :: HardwareInfo -> Int # peekElemOff :: Ptr HardwareInfo -> Int -> IO HardwareInfo # pokeElemOff :: Ptr HardwareInfo -> Int -> HardwareInfo -> IO () # peekByteOff :: Ptr b -> Int -> IO HardwareInfo # pokeByteOff :: Ptr b -> Int -> HardwareInfo -> IO () # peek :: Ptr HardwareInfo -> IO HardwareInfo # poke :: Ptr HardwareInfo -> HardwareInfo -> IO () # |
data DriveCapabilityRead #
Instances
type DriveReadCaps = BitArray DriveCapabilityRead #
The collection of features for reading discs a device provides.
data DriveCapabilityWrite #
Instances
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
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.
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:
DataCdMode
: CD-ROM form 1MixedCdMode
: some combination ofAudioCdMode
,DataCdMode
, andXaCdMode
DvdPlusRecordableMode
: DVD+RDvdPlusReWritableMode
: DVD+RW
Instances
Bounded DiscMode # | |
Enum DiscMode # | |
Defined in Foreign.Libcdio.Types.Enums | |
Eq DiscMode # | |
Ord DiscMode # | |
Defined in Foreign.Libcdio.Types.Enums | |
Read DiscMode # | |
Show DiscMode # | |
Data
data Filesystem #
Types of filesystem which may be read from a disc.
Instances
data FilesystemClass #
Higher-level descriptions of discs/filesystems.
Instances
type FilesystemClasses = BitArray FilesystemClass #
A collection of disc/filesystem descriptions.
data IsoAnalysis #
A collection of data describing a disc using the ISO 9660 standard.
Instances
Eq IsoAnalysis # | |
Defined in Foreign.Libcdio.CdTypes | |
Read IsoAnalysis # | |
Defined in Foreign.Libcdio.CdTypes Methods readsPrec :: Int -> ReadS IsoAnalysis # readList :: ReadS [IsoAnalysis] # readPrec :: ReadPrec IsoAnalysis # readListPrec :: ReadPrec [IsoAnalysis] # | |
Show IsoAnalysis # | |
Defined in Foreign.Libcdio.CdTypes Methods showsPrec :: Int -> IsoAnalysis -> ShowS # show :: IsoAnalysis -> String # showList :: [IsoAnalysis] -> ShowS # | |
Storable IsoAnalysis # | |
Defined in Foreign.Libcdio.CdTypes Methods sizeOf :: IsoAnalysis -> Int # alignment :: IsoAnalysis -> Int # peekElemOff :: Ptr IsoAnalysis -> Int -> IO IsoAnalysis # pokeElemOff :: Ptr IsoAnalysis -> Int -> IsoAnalysis -> IO () # peekByteOff :: Ptr b -> Int -> IO IsoAnalysis # pokeByteOff :: Ptr b -> Int -> IsoAnalysis -> IO () # peek :: Ptr IsoAnalysis -> IO IsoAnalysis # poke :: Ptr IsoAnalysis -> IsoAnalysis -> IO () # |
Logging
An unstructured message emitted from the library to let the user know what's going on behind the scenes.
Instances
Eq LogEntry # | |
Read LogEntry # | |
Show LogEntry # | |
Storable LogEntry # | |
Defined in Foreign.Libcdio.Logging |
How much detail should be recorded in the logs.
Instances
Bounded LogLevel # | |
Enum LogLevel # | |
Defined in Foreign.Libcdio.Types.Enums | |
Eq LogLevel # | |
Ord LogLevel # | |
Defined in Foreign.Libcdio.Types.Enums | |
Read LogLevel # | |
Show LogLevel # | |