Copyright | © 2016–present Mark Karpov |
---|---|
License | BSD 3 clause |
Maintainer | Mark Karpov <markkarpov92@gmail.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Types describing structure of a CUE sheet. You probably want to import Text.CueSheet instead.
Synopsis
- 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
CUE sheet, contains one or more files (see CueFile
).
CueSheet | |
|
Instances
A file to be written. Single file can be divided into one or more
tracks (see CueTrack
).
CueFile | |
|
Instances
Eq CueFile Source # | |
Ord CueFile Source # | |
Show CueFile Source # | |
Generic CueFile Source # | |
Arbitrary CueFile Source # | |
type Rep CueFile Source # | |
Defined in Text.CueSheet.Types type Rep CueFile = D1 ('MetaData "CueFile" "Text.CueSheet.Types" "cue-sheet-2.0.2-GGixdMe9eW2IdNm87otXvp" 'False) (C1 ('MetaCons "CueFile" 'PrefixI 'True) (S1 ('MetaSel ('Just "cueFileName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FilePath) :*: (S1 ('MetaSel ('Just "cueFileType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CueFileType) :*: S1 ('MetaSel ('Just "cueFileTracks") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NonEmpty CueTrack))))) |
data CueFileType Source #
Enumeration of audio or file's data types.
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.
CueTrack | |
|
Instances
data CueTrackType Source #
Track datatype.
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.
:: 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) Source #
Get minutes, seconds, and frames from a CueTime
value.
Disc's Media Catalog Number (MCN), must be 13 characters long, all the characters must be numeric.
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 Source #
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 Source #
Make an Isrc
, if the provided Text
value is not a valid ISRC, throw
the InvalidIsrc
exception.
data CueSheetException Source #
Exception type for the bad things that may happen while you use the library.
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. |