cue-sheet-0.1.1: Support for construction, rendering, and parsing of CUE sheets

Copyright© 2016–2017 Mark Karpov
LicenseBSD 3 clause
MaintainerMark Karpov <markkarpov92@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Text.CueSheet.Types

Description

Types describing structure of a CUE sheet. You probably want to import Text.CueSheet instead.

Synopsis

Documentation

data CueSheet #

Entire CUE sheet, contains one or more files (see CueFile).

Constructors

CueSheet 

Fields

Instances

Eq CueSheet # 
Ord CueSheet # 
Show CueSheet # 
Generic CueSheet # 

Associated Types

type Rep CueSheet :: * -> * #

Methods

from :: CueSheet -> Rep CueSheet x #

to :: Rep CueSheet x -> CueSheet #

Arbitrary CueSheet # 
type Rep CueSheet # 

data CueFile #

A file to be written. Single file can be divided into one or more tracks (see CueTrack).

Constructors

CueFile 

Fields

Instances

Eq CueFile # 

Methods

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

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

Ord CueFile # 
Show CueFile # 
Generic CueFile # 

Associated Types

type Rep CueFile :: * -> * #

Methods

from :: CueFile -> Rep CueFile x #

to :: Rep CueFile x -> CueFile #

Arbitrary CueFile # 
type Rep CueFile # 
type Rep CueFile = D1 (MetaData "CueFile" "Text.CueSheet.Types" "cue-sheet-0.1.1-HLkt4NeOXN93aFGmtLCSTj" False) (C1 (MetaCons "CueFile" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "cueFileName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 FilePath)) ((:*:) (S1 (MetaSel (Just Symbol "cueFileType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 CueFileType)) (S1 (MetaSel (Just Symbol "cueFileTracks") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (NonEmpty CueTrack))))))

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

Bounded CueFileType # 
Enum CueFileType # 
Eq CueFileType # 
Ord CueFileType # 
Read CueFileType # 
Show CueFileType # 
Generic CueFileType # 

Associated Types

type Rep CueFileType :: * -> * #

Arbitrary CueFileType # 
type Rep CueFileType # 
type Rep CueFileType = D1 (MetaData "CueFileType" "Text.CueSheet.Types" "cue-sheet-0.1.1-HLkt4NeOXN93aFGmtLCSTj" False) ((:+:) ((:+:) (C1 (MetaCons "Binary" PrefixI False) U1) (C1 (MetaCons "Motorola" PrefixI False) U1)) ((:+:) (C1 (MetaCons "Aiff" PrefixI False) U1) ((:+:) (C1 (MetaCons "Wave" PrefixI False) U1) (C1 (MetaCons "MP3" PrefixI False) U1))))

data CueTrack #

A track. Single track can have one or more indices.

Constructors

CueTrack 

Fields

Instances

Eq CueTrack # 
Ord CueTrack # 
Show CueTrack # 
Generic CueTrack # 

Associated Types

type Rep CueTrack :: * -> * #

Methods

from :: CueTrack -> Rep CueTrack x #

to :: Rep CueTrack x -> CueTrack #

Arbitrary CueTrack # 
type Rep CueTrack # 
type Rep CueTrack = D1 (MetaData "CueTrack" "Text.CueSheet.Types" "cue-sheet-0.1.1-HLkt4NeOXN93aFGmtLCSTj" False) (C1 (MetaCons "CueTrack" PrefixI True) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "cueTrackDigitalCopyPermitted") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Bool)) ((:*:) (S1 (MetaSel (Just Symbol "cueTrackFourChannelAudio") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Bool)) (S1 (MetaSel (Just Symbol "cueTrackPreemphasisEnabled") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Bool)))) ((:*:) (S1 (MetaSel (Just Symbol "cueTrackSerialCopyManagement") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Bool)) ((:*:) (S1 (MetaSel (Just Symbol "cueTrackType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 CueTrackType)) (S1 (MetaSel (Just Symbol "cueTrackIsrc") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Isrc)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "cueTrackTitle") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe CueText))) ((:*:) (S1 (MetaSel (Just Symbol "cueTrackPerformer") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe CueText))) (S1 (MetaSel (Just Symbol "cueTrackSongwriter") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe CueText))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "cueTrackPregap") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe CueTime))) (S1 (MetaSel (Just Symbol "cueTrackPregapIndex") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe CueTime)))) ((:*:) (S1 (MetaSel (Just Symbol "cueTrackIndices") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (NonEmpty CueTime))) (S1 (MetaSel (Just Symbol "cueTrackPostgap") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe CueTime))))))))

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

Bounded CueTrackType # 
Enum CueTrackType # 
Eq CueTrackType # 
Ord CueTrackType # 
Read CueTrackType # 
Show CueTrackType # 
Generic CueTrackType # 

Associated Types

type Rep CueTrackType :: * -> * #

Arbitrary CueTrackType # 
type Rep CueTrackType # 
type Rep CueTrackType = D1 (MetaData "CueTrackType" "Text.CueSheet.Types" "cue-sheet-0.1.1-HLkt4NeOXN93aFGmtLCSTj" False) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "CueTrackAudio" PrefixI False) U1) (C1 (MetaCons "CueTrackCdg" PrefixI False) U1)) ((:+:) (C1 (MetaCons "CueTrackMode1_2048" PrefixI False) U1) (C1 (MetaCons "CueTrackMode1_2352" PrefixI False) U1))) ((:+:) ((:+:) (C1 (MetaCons "CueTrackMode2_2336" PrefixI False) U1) (C1 (MetaCons "CueTrackMode2_2352" PrefixI False) U1)) ((:+:) (C1 (MetaCons "CueTrackCdi2336" PrefixI False) U1) (C1 (MetaCons "CueTrackCdi2352" PrefixI False) U1))))

newtype CueTime #

This datatype is used to indicate duration and position in time. It contains number of frames. There are 75 frames in one second.

Constructors

CueTime Natural 

Instances

fromMmSsFf #

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.

data Mcn #

Disc's Media Catalog Number (MCN), must be 13 characters long, all the characters must be numeric.

Instances

Eq Mcn # 

Methods

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

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

Ord Mcn # 

Methods

compare :: Mcn -> Mcn -> Ordering #

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

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

(>) :: Mcn -> Mcn -> Bool #

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

max :: Mcn -> Mcn -> Mcn #

min :: Mcn -> Mcn -> Mcn #

Show Mcn # 

Methods

showsPrec :: Int -> Mcn -> ShowS #

show :: Mcn -> String #

showList :: [Mcn] -> ShowS #

Generic Mcn # 

Associated Types

type Rep Mcn :: * -> * #

Methods

from :: Mcn -> Rep Mcn x #

to :: Rep Mcn x -> Mcn #

Arbitrary Mcn # 

Methods

arbitrary :: Gen Mcn #

shrink :: Mcn -> [Mcn] #

type Rep Mcn # 
type Rep Mcn = D1 (MetaData "Mcn" "Text.CueSheet.Types" "cue-sheet-0.1.1-HLkt4NeOXN93aFGmtLCSTj" True) (C1 (MetaCons "Mcn" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))

mkMcn :: MonadThrow m => Text -> m Mcn #

Make a Mcn. If the provided Text value is not a valid MCN, throw the InvalidMcnException.

unMcn :: Mcn -> Text #

Get Text from Mcn.

data CueText #

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.

Instances

Eq CueText # 

Methods

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

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

Ord CueText # 
Show CueText # 
Generic CueText # 

Associated Types

type Rep CueText :: * -> * #

Methods

from :: CueText -> Rep CueText x #

to :: Rep CueText x -> CueText #

Arbitrary CueText # 
type Rep CueText # 
type Rep CueText = D1 (MetaData "CueText" "Text.CueSheet.Types" "cue-sheet-0.1.1-HLkt4NeOXN93aFGmtLCSTj" True) (C1 (MetaCons "CueText" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))

mkCueText :: MonadThrow m => Text -> m CueText #

Make a CueText. If the provided Text value is not a valid CUE text, throw the InvalidCueText exception.

data Isrc #

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.

Instances

Eq Isrc # 

Methods

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

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

Ord Isrc # 

Methods

compare :: Isrc -> Isrc -> Ordering #

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

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

(>) :: Isrc -> Isrc -> Bool #

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

max :: Isrc -> Isrc -> Isrc #

min :: Isrc -> Isrc -> Isrc #

Show Isrc # 

Methods

showsPrec :: Int -> Isrc -> ShowS #

show :: Isrc -> String #

showList :: [Isrc] -> ShowS #

Generic Isrc # 

Associated Types

type Rep Isrc :: * -> * #

Methods

from :: Isrc -> Rep Isrc x #

to :: Rep Isrc x -> Isrc #

Arbitrary Isrc # 

Methods

arbitrary :: Gen Isrc #

shrink :: Isrc -> [Isrc] #

type Rep Isrc # 
type Rep Isrc = D1 (MetaData "Isrc" "Text.CueSheet.Types" "cue-sheet-0.1.1-HLkt4NeOXN93aFGmtLCSTj" True) (C1 (MetaCons "Isrc" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))

mkIsrc :: MonadThrow m => Text -> m Isrc #

Make an Isrc, if the provided Text value is not a valid ISRC, throw the InvalidIsrc exception.

unIsrc :: Isrc -> Text #

Get Text from Isrc.

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 fromMmSsFf.

InvalidFrames Natural

The value is greater than 74 and thus is invalid for fromMmSsFf.

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.

Instances

Eq CueSheetException # 
Ord CueSheetException # 
Read CueSheetException # 
Show CueSheetException # 
Generic CueSheetException # 
Exception CueSheetException # 
type Rep CueSheetException #