Copyright | © 2016–2017 Mark Karpov |
---|---|
License | BSD 3 clause |
Maintainer | Mark Karpov <markkarpov92@gmail.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Text.CueSheet.Types
Description
Types describing structure of a CUE sheet. You probably want to import Text.CueSheet instead.
- data CueSheet = CueSheet {
- cueCatalog :: !(Maybe Mcn)
- cueCdTextFile :: !(Maybe FilePath)
- cuePerformer :: !(Maybe CueText)
- cueTitle :: !(Maybe CueText)
- cueSongwriter :: !(Maybe CueText)
- cueFirstTrackNumber :: !Natural
- cueFiles :: !(NonEmpty CueFile)
- data CueFile = CueFile {
- cueFileName :: !FilePath
- cueFileType :: !CueFileType
- cueFileTracks :: !(NonEmpty CueTrack)
- data CueFileType
- data CueTrack = CueTrack {
- cueTrackDigitalCopyPermitted :: !Bool
- cueTrackFourChannelAudio :: !Bool
- cueTrackPreemphasisEnabled :: !Bool
- cueTrackSerialCopyManagement :: !Bool
- cueTrackType :: !CueTrackType
- cueTrackIsrc :: !(Maybe Isrc)
- cueTrackTitle :: !(Maybe CueText)
- cueTrackPerformer :: !(Maybe CueText)
- cueTrackSongwriter :: !(Maybe CueText)
- cueTrackPregap :: !(Maybe CueTime)
- cueTrackPregapIndex :: !(Maybe CueTime)
- cueTrackIndices :: !(NonEmpty CueTime)
- cueTrackPostgap :: !(Maybe CueTime)
- data CueTrackType
- newtype CueTime = CueTime Natural
- fromMmSsFf :: MonadThrow m => Natural -> Natural -> Natural -> m CueTime
- toMmSsFf :: CueTime -> (Natural, Natural, Natural)
- showMmSsFf :: CueTime -> Text
- data Mcn
- mkMcn :: MonadThrow m => Text -> m Mcn
- unMcn :: Mcn -> Text
- data CueText
- mkCueText :: MonadThrow m => Text -> m CueText
- unCueText :: CueText -> Text
- data Isrc
- mkIsrc :: MonadThrow m => Text -> m Isrc
- unIsrc :: Isrc -> Text
- data CueSheetException
Documentation
Entire CUE sheet, contains one or more files (see CueFile
).
Constructors
CueSheet | |
Fields
|
A file to be written. Single file can be divided into one or more
tracks (see CueTrack
).
Constructors
CueFile | |
Fields
|
data CueFileType #
Enumeration of audio or file's data types.
Constructors
Binary | Intel binary file (least significant byte first). Use for data files. |
Motorola | Motorola binary file (most significant file first). Use for data files. |
Aiff | Audio AIFF file (44.1 kHz, 16 bit stereo). |
Wave | Audio WAVE file (44.1 kHz, 16 bit stereo). |
MP3 | Audio MP3 file (44.1 kHz 16 bit stereo). |
Instances
A track. Single track can have one or more indices.
Constructors
CueTrack | |
Fields
|
data CueTrackType #
Track datatype.
Constructors
CueTrackAudio | Audio/Music (2352). |
CueTrackCdg | Karaoke CD+G (2448). |
CueTrackMode1_2048 | CD-ROM Mode1 data (cooked). |
CueTrackMode1_2352 | CD-ROM Mode1 data (raw). |
CueTrackMode2_2336 | CD-ROM XA Mode2 data. |
CueTrackMode2_2352 | CD-ROM XA Mode2 data. |
CueTrackCdi2336 | CD-I Mode2 data. |
CueTrackCdi2352 | CD-I Mode2 data. |
Instances
This datatype is used to indicate duration and position in time. It contains number of frames. There are 75 frames in one second.
Arguments
:: MonadThrow m | |
=> Natural | Number of minutes, no limit here |
-> Natural | Number of seconds, 0–59 inclusive |
-> Natural | Number of frames, 0–74 inclusive |
-> m CueTime | The result |
Construct CueTime
from minutes, seconds, and frames. There are 75
frames per second. If number of seconds or frames is invalid,
InvalidSeconds
or InvalidFrames
will be thrown.
toMmSsFf :: CueTime -> (Natural, Natural, Natural) #
Get minutes, seconds, and frames from a CueTime
value.
showMmSsFf :: CueTime -> Text #
Render representation of CueTime
in mm:ss:ff
format.
Disc's Media Catalog Number (MCN), must be 13 characters long, all the characters must be numeric.
mkMcn :: MonadThrow m => Text -> m Mcn #
A type for things like title or performer that should have length
between 1 and 80 characters as per spec. We also demand that it does not
contain "
and newline characters, as it's not clear from the spec how
to escape them properly.
mkCueText :: MonadThrow m => Text -> m CueText #
Make a CueText
. If the provided Text
value is not a valid CUE text,
throw the InvalidCueText
exception.
The track's International Standard Recording Code (ISRC). It must be 12 characters in length. The first five characters are alphanumeric, the last seven are numeric only.
mkIsrc :: MonadThrow m => Text -> m Isrc #
Make an Isrc
, if the provided Text
value is not a valid ISRC, throw
the InvalidIsrc
exception.
data CueSheetException #
Exception type for the bad things that may happen while you use the library.
Constructors
InvalidSeconds Natural | The value is greater than 59 and thus is invalid for |
InvalidFrames Natural | The value is greater than 74 and thus is invalid for |
InvalidMcn Text | Provided text wasn't a correct media catalog number (MCN). |
InvalidCueText Text | Provided text wasn't a valid CUE text. |
InvalidIsrc Text | Provided text wasn't a valid ISRC. |