{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MediaConvert.Types.TimecodeBurnin
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaConvert.Types.TimecodeBurnin where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConvert.Types.TimecodeBurninPosition
import qualified Amazonka.Prelude as Prelude

-- | Settings for burning the output timecode and specified prefix into the
-- output.
--
-- /See:/ 'newTimecodeBurnin' smart constructor.
data TimecodeBurnin = TimecodeBurnin'
  { -- | Use Font Size (FontSize) to set the font size of any burned-in timecode.
    -- Valid values are 10, 16, 32, 48.
    TimecodeBurnin -> Maybe Natural
fontSize :: Prelude.Maybe Prelude.Natural,
    -- | Use Position (Position) under under Timecode burn-in (TimecodeBurnIn) to
    -- specify the location the burned-in timecode on output video.
    TimecodeBurnin -> Maybe TimecodeBurninPosition
position :: Prelude.Maybe TimecodeBurninPosition,
    -- | Use Prefix (Prefix) to place ASCII characters before any burned-in
    -- timecode. For example, a prefix of \"EZ-\" will result in the timecode
    -- \"EZ-00:00:00:00\". Provide either the characters themselves or the
    -- ASCII code equivalents. The supported range of characters is 0x20
    -- through 0x7e. This includes letters, numbers, and all special characters
    -- represented on a standard English keyboard.
    TimecodeBurnin -> Maybe Text
prefix :: Prelude.Maybe Prelude.Text
  }
  deriving (TimecodeBurnin -> TimecodeBurnin -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TimecodeBurnin -> TimecodeBurnin -> Bool
$c/= :: TimecodeBurnin -> TimecodeBurnin -> Bool
== :: TimecodeBurnin -> TimecodeBurnin -> Bool
$c== :: TimecodeBurnin -> TimecodeBurnin -> Bool
Prelude.Eq, ReadPrec [TimecodeBurnin]
ReadPrec TimecodeBurnin
Int -> ReadS TimecodeBurnin
ReadS [TimecodeBurnin]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TimecodeBurnin]
$creadListPrec :: ReadPrec [TimecodeBurnin]
readPrec :: ReadPrec TimecodeBurnin
$creadPrec :: ReadPrec TimecodeBurnin
readList :: ReadS [TimecodeBurnin]
$creadList :: ReadS [TimecodeBurnin]
readsPrec :: Int -> ReadS TimecodeBurnin
$creadsPrec :: Int -> ReadS TimecodeBurnin
Prelude.Read, Int -> TimecodeBurnin -> ShowS
[TimecodeBurnin] -> ShowS
TimecodeBurnin -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TimecodeBurnin] -> ShowS
$cshowList :: [TimecodeBurnin] -> ShowS
show :: TimecodeBurnin -> String
$cshow :: TimecodeBurnin -> String
showsPrec :: Int -> TimecodeBurnin -> ShowS
$cshowsPrec :: Int -> TimecodeBurnin -> ShowS
Prelude.Show, forall x. Rep TimecodeBurnin x -> TimecodeBurnin
forall x. TimecodeBurnin -> Rep TimecodeBurnin x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TimecodeBurnin x -> TimecodeBurnin
$cfrom :: forall x. TimecodeBurnin -> Rep TimecodeBurnin x
Prelude.Generic)

-- |
-- Create a value of 'TimecodeBurnin' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'fontSize', 'timecodeBurnin_fontSize' - Use Font Size (FontSize) to set the font size of any burned-in timecode.
-- Valid values are 10, 16, 32, 48.
--
-- 'position', 'timecodeBurnin_position' - Use Position (Position) under under Timecode burn-in (TimecodeBurnIn) to
-- specify the location the burned-in timecode on output video.
--
-- 'prefix', 'timecodeBurnin_prefix' - Use Prefix (Prefix) to place ASCII characters before any burned-in
-- timecode. For example, a prefix of \"EZ-\" will result in the timecode
-- \"EZ-00:00:00:00\". Provide either the characters themselves or the
-- ASCII code equivalents. The supported range of characters is 0x20
-- through 0x7e. This includes letters, numbers, and all special characters
-- represented on a standard English keyboard.
newTimecodeBurnin ::
  TimecodeBurnin
newTimecodeBurnin :: TimecodeBurnin
newTimecodeBurnin =
  TimecodeBurnin'
    { $sel:fontSize:TimecodeBurnin' :: Maybe Natural
fontSize = forall a. Maybe a
Prelude.Nothing,
      $sel:position:TimecodeBurnin' :: Maybe TimecodeBurninPosition
position = forall a. Maybe a
Prelude.Nothing,
      $sel:prefix:TimecodeBurnin' :: Maybe Text
prefix = forall a. Maybe a
Prelude.Nothing
    }

-- | Use Font Size (FontSize) to set the font size of any burned-in timecode.
-- Valid values are 10, 16, 32, 48.
timecodeBurnin_fontSize :: Lens.Lens' TimecodeBurnin (Prelude.Maybe Prelude.Natural)
timecodeBurnin_fontSize :: Lens' TimecodeBurnin (Maybe Natural)
timecodeBurnin_fontSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimecodeBurnin' {Maybe Natural
fontSize :: Maybe Natural
$sel:fontSize:TimecodeBurnin' :: TimecodeBurnin -> Maybe Natural
fontSize} -> Maybe Natural
fontSize) (\s :: TimecodeBurnin
s@TimecodeBurnin' {} Maybe Natural
a -> TimecodeBurnin
s {$sel:fontSize:TimecodeBurnin' :: Maybe Natural
fontSize = Maybe Natural
a} :: TimecodeBurnin)

-- | Use Position (Position) under under Timecode burn-in (TimecodeBurnIn) to
-- specify the location the burned-in timecode on output video.
timecodeBurnin_position :: Lens.Lens' TimecodeBurnin (Prelude.Maybe TimecodeBurninPosition)
timecodeBurnin_position :: Lens' TimecodeBurnin (Maybe TimecodeBurninPosition)
timecodeBurnin_position = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimecodeBurnin' {Maybe TimecodeBurninPosition
position :: Maybe TimecodeBurninPosition
$sel:position:TimecodeBurnin' :: TimecodeBurnin -> Maybe TimecodeBurninPosition
position} -> Maybe TimecodeBurninPosition
position) (\s :: TimecodeBurnin
s@TimecodeBurnin' {} Maybe TimecodeBurninPosition
a -> TimecodeBurnin
s {$sel:position:TimecodeBurnin' :: Maybe TimecodeBurninPosition
position = Maybe TimecodeBurninPosition
a} :: TimecodeBurnin)

-- | Use Prefix (Prefix) to place ASCII characters before any burned-in
-- timecode. For example, a prefix of \"EZ-\" will result in the timecode
-- \"EZ-00:00:00:00\". Provide either the characters themselves or the
-- ASCII code equivalents. The supported range of characters is 0x20
-- through 0x7e. This includes letters, numbers, and all special characters
-- represented on a standard English keyboard.
timecodeBurnin_prefix :: Lens.Lens' TimecodeBurnin (Prelude.Maybe Prelude.Text)
timecodeBurnin_prefix :: Lens' TimecodeBurnin (Maybe Text)
timecodeBurnin_prefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimecodeBurnin' {Maybe Text
prefix :: Maybe Text
$sel:prefix:TimecodeBurnin' :: TimecodeBurnin -> Maybe Text
prefix} -> Maybe Text
prefix) (\s :: TimecodeBurnin
s@TimecodeBurnin' {} Maybe Text
a -> TimecodeBurnin
s {$sel:prefix:TimecodeBurnin' :: Maybe Text
prefix = Maybe Text
a} :: TimecodeBurnin)

instance Data.FromJSON TimecodeBurnin where
  parseJSON :: Value -> Parser TimecodeBurnin
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TimecodeBurnin"
      ( \Object
x ->
          Maybe Natural
-> Maybe TimecodeBurninPosition -> Maybe Text -> TimecodeBurnin
TimecodeBurnin'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"fontSize")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"position")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"prefix")
      )

instance Prelude.Hashable TimecodeBurnin where
  hashWithSalt :: Int -> TimecodeBurnin -> Int
hashWithSalt Int
_salt TimecodeBurnin' {Maybe Natural
Maybe Text
Maybe TimecodeBurninPosition
prefix :: Maybe Text
position :: Maybe TimecodeBurninPosition
fontSize :: Maybe Natural
$sel:prefix:TimecodeBurnin' :: TimecodeBurnin -> Maybe Text
$sel:position:TimecodeBurnin' :: TimecodeBurnin -> Maybe TimecodeBurninPosition
$sel:fontSize:TimecodeBurnin' :: TimecodeBurnin -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
fontSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TimecodeBurninPosition
position
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
prefix

instance Prelude.NFData TimecodeBurnin where
  rnf :: TimecodeBurnin -> ()
rnf TimecodeBurnin' {Maybe Natural
Maybe Text
Maybe TimecodeBurninPosition
prefix :: Maybe Text
position :: Maybe TimecodeBurninPosition
fontSize :: Maybe Natural
$sel:prefix:TimecodeBurnin' :: TimecodeBurnin -> Maybe Text
$sel:position:TimecodeBurnin' :: TimecodeBurnin -> Maybe TimecodeBurninPosition
$sel:fontSize:TimecodeBurnin' :: TimecodeBurnin -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
fontSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TimecodeBurninPosition
position
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
prefix

instance Data.ToJSON TimecodeBurnin where
  toJSON :: TimecodeBurnin -> Value
toJSON TimecodeBurnin' {Maybe Natural
Maybe Text
Maybe TimecodeBurninPosition
prefix :: Maybe Text
position :: Maybe TimecodeBurninPosition
fontSize :: Maybe Natural
$sel:prefix:TimecodeBurnin' :: TimecodeBurnin -> Maybe Text
$sel:position:TimecodeBurnin' :: TimecodeBurnin -> Maybe TimecodeBurninPosition
$sel:fontSize:TimecodeBurnin' :: TimecodeBurnin -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"fontSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
fontSize,
            (Key
"position" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TimecodeBurninPosition
position,
            (Key
"prefix" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
prefix
          ]
      )