{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaConvert.Types.TimecodeBurnin where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 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,
    -- | 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
  }
  deriving (TimecodeBurnin -> TimecodeBurnin -> Bool
(TimecodeBurnin -> TimecodeBurnin -> Bool)
-> (TimecodeBurnin -> TimecodeBurnin -> Bool) -> Eq TimecodeBurnin
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]
(Int -> ReadS TimecodeBurnin)
-> ReadS [TimecodeBurnin]
-> ReadPrec TimecodeBurnin
-> ReadPrec [TimecodeBurnin]
-> Read 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
(Int -> TimecodeBurnin -> ShowS)
-> (TimecodeBurnin -> String)
-> ([TimecodeBurnin] -> ShowS)
-> Show TimecodeBurnin
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. TimecodeBurnin -> Rep TimecodeBurnin x)
-> (forall x. Rep TimecodeBurnin x -> TimecodeBurnin)
-> Generic TimecodeBurnin
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:
--
-- '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.
--
-- '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.
newTimecodeBurnin ::
  TimecodeBurnin
newTimecodeBurnin :: TimecodeBurnin
newTimecodeBurnin =
  TimecodeBurnin' :: Maybe Text
-> Maybe Natural -> Maybe TimecodeBurninPosition -> TimecodeBurnin
TimecodeBurnin'
    { $sel:prefix:TimecodeBurnin' :: Maybe Text
prefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fontSize:TimecodeBurnin' :: Maybe Natural
fontSize = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:position:TimecodeBurnin' :: Maybe TimecodeBurninPosition
position = Maybe TimecodeBurninPosition
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> TimecodeBurnin -> f TimecodeBurnin
timecodeBurnin_prefix = (TimecodeBurnin -> Maybe Text)
-> (TimecodeBurnin -> Maybe Text -> TimecodeBurnin)
-> Lens TimecodeBurnin TimecodeBurnin (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Natural -> f (Maybe Natural))
-> TimecodeBurnin -> f TimecodeBurnin
timecodeBurnin_fontSize = (TimecodeBurnin -> Maybe Natural)
-> (TimecodeBurnin -> Maybe Natural -> TimecodeBurnin)
-> Lens
     TimecodeBurnin TimecodeBurnin (Maybe Natural) (Maybe Natural)
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 :: (Maybe TimecodeBurninPosition -> f (Maybe TimecodeBurninPosition))
-> TimecodeBurnin -> f TimecodeBurnin
timecodeBurnin_position = (TimecodeBurnin -> Maybe TimecodeBurninPosition)
-> (TimecodeBurnin
    -> Maybe TimecodeBurninPosition -> TimecodeBurnin)
-> Lens
     TimecodeBurnin
     TimecodeBurnin
     (Maybe TimecodeBurninPosition)
     (Maybe TimecodeBurninPosition)
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)

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

instance Prelude.Hashable TimecodeBurnin

instance Prelude.NFData TimecodeBurnin

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