module Text.Subtitles.SRT.Datatypes
(
module Data.Attoparsec.Text,
module Data.Text,
Subtitles,
Rectangle(..),
Line(..),
Range(..),
Time(..)
) where
import Data.List (intercalate)
import Data.Text (Text, unpack)
import Data.Attoparsec.Text (Parser)
data Rectangle = R { x1 :: Int, x2 :: Int, y1 :: Int, y2 :: Int}
deriving (Eq, Ord, Show)
data Time = Time
{ hour :: Int
, minutes :: Int
, seconds :: Int
, frame :: Int
} deriving (Eq, Ord, Show)
data Range = Range
{ from :: Time
, to :: Time
} deriving (Eq, Ord, Show)
data Line = Line
{ index :: Int
, range :: Range
, geometry :: Maybe Rectangle
, dialog :: Text
} deriving (Eq, Ord, Show)
type Subtitles = [Line]