subtitleParser-0.5: A parser for .srt and .sub files

Portabilityunknown
Maintainerruben.astud@gmail.com
Safe HaskellNone

Text.Subtitles.SRT.Datatypes

Contents

Description

ADT for .srt files. Also serves as a place to provide instance declarations for the ADTs.

Synopsis

Re-exported datatypes.

module Data.Text

Datatypes

type Subtitles = [Line]Source

A subtitle is just a List of independent Lines that appear on screen

data Line Source

The core of the parser. each one of the constructor representing one part of the Line

Constructors

Line 

Fields

index :: Int

The absolute order of this line.

range :: Range

The interval of time that the line is shown.

geometry :: Maybe Rectangle

Sometimes text shouldn't be on the lower center.

dialog :: Text

what to show in screen

Instances

data Range Source

Constructors

Range 

Fields

from :: Time
 
to :: Time
 

Instances

data Time Source

Constructors

Time 

Fields

hour :: Int
 
minutes :: Int
 
seconds :: Int
 
frame :: Int
 

Instances

data Rectangle Source

This represent the position on screen of the Line. Is usually optional in the file.

Constructors

R 

Fields

x1 :: Int
 
x2 :: Int
 
y1 :: Int
 
y2 :: Int