aboutsummaryrefslogtreecommitdiffhomepage
path: root/Presets.hs
blob: b31aefc89fead1dcd75951121ad90de3fc4fe30a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{-# LANGUAGE OverloadedStrings #-}

module Presets (presets, lookupPreset) where

import           Data.List    (find)
import           Lens.Micro   ((&), (.~), (^.))

import           Types.Preset
import           Types.State

presets :: [Preset]
presets = [ Preset 'h' "handwritten notes" handwrittenNotes
          , Preset 't' "typewritten docs" typewrittenDocs
          ]

lookupPreset :: Char -> Maybe Preset
lookupPreset c = find (\(Preset k _ _) -> c == k) presets

handwrittenNotes = \st -> st
    { _stOCR     = False
    , _stColour  = Greyscale
    , _stDPI     = 75
    , _stPaper  = st^.stDefaultPaper
    }

typewrittenDocs = \st -> st
    { _stOCR    = True
    , _stColour = Greyscale
    , _stDPI    = 300
    , _stPaper  = st^.stDefaultPaper
    }