{-# 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.MediaLive.Types.EbuTtDDestinationSettings
-- 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.MediaLive.Types.EbuTtDDestinationSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.EbuTtDDestinationStyleControl
import Amazonka.MediaLive.Types.EbuTtDFillLineGapControl
import qualified Amazonka.Prelude as Prelude

-- | Ebu Tt DDestination Settings
--
-- /See:/ 'newEbuTtDDestinationSettings' smart constructor.
data EbuTtDDestinationSettings = EbuTtDDestinationSettings'
  { -- | Complete this field if you want to include the name of the copyright
    -- holder in the copyright tag in the captions metadata.
    EbuTtDDestinationSettings -> Maybe Text
copyrightHolder :: Prelude.Maybe Prelude.Text,
    -- | Specifies how to handle the gap between the lines (in multi-line
    -- captions). - enabled: Fill with the captions background color (as
    -- specified in the input captions). - disabled: Leave the gap unfilled.
    EbuTtDDestinationSettings -> Maybe EbuTtDFillLineGapControl
fillLineGap :: Prelude.Maybe EbuTtDFillLineGapControl,
    -- | Specifies the font family to include in the font data attached to the
    -- EBU-TT captions. Valid only if styleControl is set to include. If you
    -- leave this field empty, the font family is set to \"monospaced\". (If
    -- styleControl is set to exclude, the font family is always set to
    -- \"monospaced\".) You specify only the font family. All other style
    -- information (color, bold, position and so on) is copied from the input
    -- captions. The size is always set to 100% to allow the downstream player
    -- to choose the size. - Enter a list of font families, as a
    -- comma-separated list of font names, in order of preference. The name can
    -- be a font family (such as “Arial”), or a generic font family (such as
    -- “serif”), or “default” (to let the downstream player choose the font). -
    -- Leave blank to set the family to “monospace”.
    EbuTtDDestinationSettings -> Maybe Text
fontFamily :: Prelude.Maybe Prelude.Text,
    -- | Specifies the style information (font color, font position, and so on)
    -- to include in the font data that is attached to the EBU-TT captions. -
    -- include: Take the style information (font color, font position, and so
    -- on) from the source captions and include that information in the font
    -- data attached to the EBU-TT captions. This option is valid only if the
    -- source captions are Embedded or Teletext. - exclude: In the font data
    -- attached to the EBU-TT captions, set the font family to \"monospaced\".
    -- Do not include any other style information.
    EbuTtDDestinationSettings -> Maybe EbuTtDDestinationStyleControl
styleControl :: Prelude.Maybe EbuTtDDestinationStyleControl
  }
  deriving (EbuTtDDestinationSettings -> EbuTtDDestinationSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EbuTtDDestinationSettings -> EbuTtDDestinationSettings -> Bool
$c/= :: EbuTtDDestinationSettings -> EbuTtDDestinationSettings -> Bool
== :: EbuTtDDestinationSettings -> EbuTtDDestinationSettings -> Bool
$c== :: EbuTtDDestinationSettings -> EbuTtDDestinationSettings -> Bool
Prelude.Eq, ReadPrec [EbuTtDDestinationSettings]
ReadPrec EbuTtDDestinationSettings
Int -> ReadS EbuTtDDestinationSettings
ReadS [EbuTtDDestinationSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EbuTtDDestinationSettings]
$creadListPrec :: ReadPrec [EbuTtDDestinationSettings]
readPrec :: ReadPrec EbuTtDDestinationSettings
$creadPrec :: ReadPrec EbuTtDDestinationSettings
readList :: ReadS [EbuTtDDestinationSettings]
$creadList :: ReadS [EbuTtDDestinationSettings]
readsPrec :: Int -> ReadS EbuTtDDestinationSettings
$creadsPrec :: Int -> ReadS EbuTtDDestinationSettings
Prelude.Read, Int -> EbuTtDDestinationSettings -> ShowS
[EbuTtDDestinationSettings] -> ShowS
EbuTtDDestinationSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EbuTtDDestinationSettings] -> ShowS
$cshowList :: [EbuTtDDestinationSettings] -> ShowS
show :: EbuTtDDestinationSettings -> String
$cshow :: EbuTtDDestinationSettings -> String
showsPrec :: Int -> EbuTtDDestinationSettings -> ShowS
$cshowsPrec :: Int -> EbuTtDDestinationSettings -> ShowS
Prelude.Show, forall x.
Rep EbuTtDDestinationSettings x -> EbuTtDDestinationSettings
forall x.
EbuTtDDestinationSettings -> Rep EbuTtDDestinationSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EbuTtDDestinationSettings x -> EbuTtDDestinationSettings
$cfrom :: forall x.
EbuTtDDestinationSettings -> Rep EbuTtDDestinationSettings x
Prelude.Generic)

-- |
-- Create a value of 'EbuTtDDestinationSettings' 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:
--
-- 'copyrightHolder', 'ebuTtDDestinationSettings_copyrightHolder' - Complete this field if you want to include the name of the copyright
-- holder in the copyright tag in the captions metadata.
--
-- 'fillLineGap', 'ebuTtDDestinationSettings_fillLineGap' - Specifies how to handle the gap between the lines (in multi-line
-- captions). - enabled: Fill with the captions background color (as
-- specified in the input captions). - disabled: Leave the gap unfilled.
--
-- 'fontFamily', 'ebuTtDDestinationSettings_fontFamily' - Specifies the font family to include in the font data attached to the
-- EBU-TT captions. Valid only if styleControl is set to include. If you
-- leave this field empty, the font family is set to \"monospaced\". (If
-- styleControl is set to exclude, the font family is always set to
-- \"monospaced\".) You specify only the font family. All other style
-- information (color, bold, position and so on) is copied from the input
-- captions. The size is always set to 100% to allow the downstream player
-- to choose the size. - Enter a list of font families, as a
-- comma-separated list of font names, in order of preference. The name can
-- be a font family (such as “Arial”), or a generic font family (such as
-- “serif”), or “default” (to let the downstream player choose the font). -
-- Leave blank to set the family to “monospace”.
--
-- 'styleControl', 'ebuTtDDestinationSettings_styleControl' - Specifies the style information (font color, font position, and so on)
-- to include in the font data that is attached to the EBU-TT captions. -
-- include: Take the style information (font color, font position, and so
-- on) from the source captions and include that information in the font
-- data attached to the EBU-TT captions. This option is valid only if the
-- source captions are Embedded or Teletext. - exclude: In the font data
-- attached to the EBU-TT captions, set the font family to \"monospaced\".
-- Do not include any other style information.
newEbuTtDDestinationSettings ::
  EbuTtDDestinationSettings
newEbuTtDDestinationSettings :: EbuTtDDestinationSettings
newEbuTtDDestinationSettings =
  EbuTtDDestinationSettings'
    { $sel:copyrightHolder:EbuTtDDestinationSettings' :: Maybe Text
copyrightHolder =
        forall a. Maybe a
Prelude.Nothing,
      $sel:fillLineGap:EbuTtDDestinationSettings' :: Maybe EbuTtDFillLineGapControl
fillLineGap = forall a. Maybe a
Prelude.Nothing,
      $sel:fontFamily:EbuTtDDestinationSettings' :: Maybe Text
fontFamily = forall a. Maybe a
Prelude.Nothing,
      $sel:styleControl:EbuTtDDestinationSettings' :: Maybe EbuTtDDestinationStyleControl
styleControl = forall a. Maybe a
Prelude.Nothing
    }

-- | Complete this field if you want to include the name of the copyright
-- holder in the copyright tag in the captions metadata.
ebuTtDDestinationSettings_copyrightHolder :: Lens.Lens' EbuTtDDestinationSettings (Prelude.Maybe Prelude.Text)
ebuTtDDestinationSettings_copyrightHolder :: Lens' EbuTtDDestinationSettings (Maybe Text)
ebuTtDDestinationSettings_copyrightHolder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbuTtDDestinationSettings' {Maybe Text
copyrightHolder :: Maybe Text
$sel:copyrightHolder:EbuTtDDestinationSettings' :: EbuTtDDestinationSettings -> Maybe Text
copyrightHolder} -> Maybe Text
copyrightHolder) (\s :: EbuTtDDestinationSettings
s@EbuTtDDestinationSettings' {} Maybe Text
a -> EbuTtDDestinationSettings
s {$sel:copyrightHolder:EbuTtDDestinationSettings' :: Maybe Text
copyrightHolder = Maybe Text
a} :: EbuTtDDestinationSettings)

-- | Specifies how to handle the gap between the lines (in multi-line
-- captions). - enabled: Fill with the captions background color (as
-- specified in the input captions). - disabled: Leave the gap unfilled.
ebuTtDDestinationSettings_fillLineGap :: Lens.Lens' EbuTtDDestinationSettings (Prelude.Maybe EbuTtDFillLineGapControl)
ebuTtDDestinationSettings_fillLineGap :: Lens' EbuTtDDestinationSettings (Maybe EbuTtDFillLineGapControl)
ebuTtDDestinationSettings_fillLineGap = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbuTtDDestinationSettings' {Maybe EbuTtDFillLineGapControl
fillLineGap :: Maybe EbuTtDFillLineGapControl
$sel:fillLineGap:EbuTtDDestinationSettings' :: EbuTtDDestinationSettings -> Maybe EbuTtDFillLineGapControl
fillLineGap} -> Maybe EbuTtDFillLineGapControl
fillLineGap) (\s :: EbuTtDDestinationSettings
s@EbuTtDDestinationSettings' {} Maybe EbuTtDFillLineGapControl
a -> EbuTtDDestinationSettings
s {$sel:fillLineGap:EbuTtDDestinationSettings' :: Maybe EbuTtDFillLineGapControl
fillLineGap = Maybe EbuTtDFillLineGapControl
a} :: EbuTtDDestinationSettings)

-- | Specifies the font family to include in the font data attached to the
-- EBU-TT captions. Valid only if styleControl is set to include. If you
-- leave this field empty, the font family is set to \"monospaced\". (If
-- styleControl is set to exclude, the font family is always set to
-- \"monospaced\".) You specify only the font family. All other style
-- information (color, bold, position and so on) is copied from the input
-- captions. The size is always set to 100% to allow the downstream player
-- to choose the size. - Enter a list of font families, as a
-- comma-separated list of font names, in order of preference. The name can
-- be a font family (such as “Arial”), or a generic font family (such as
-- “serif”), or “default” (to let the downstream player choose the font). -
-- Leave blank to set the family to “monospace”.
ebuTtDDestinationSettings_fontFamily :: Lens.Lens' EbuTtDDestinationSettings (Prelude.Maybe Prelude.Text)
ebuTtDDestinationSettings_fontFamily :: Lens' EbuTtDDestinationSettings (Maybe Text)
ebuTtDDestinationSettings_fontFamily = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbuTtDDestinationSettings' {Maybe Text
fontFamily :: Maybe Text
$sel:fontFamily:EbuTtDDestinationSettings' :: EbuTtDDestinationSettings -> Maybe Text
fontFamily} -> Maybe Text
fontFamily) (\s :: EbuTtDDestinationSettings
s@EbuTtDDestinationSettings' {} Maybe Text
a -> EbuTtDDestinationSettings
s {$sel:fontFamily:EbuTtDDestinationSettings' :: Maybe Text
fontFamily = Maybe Text
a} :: EbuTtDDestinationSettings)

-- | Specifies the style information (font color, font position, and so on)
-- to include in the font data that is attached to the EBU-TT captions. -
-- include: Take the style information (font color, font position, and so
-- on) from the source captions and include that information in the font
-- data attached to the EBU-TT captions. This option is valid only if the
-- source captions are Embedded or Teletext. - exclude: In the font data
-- attached to the EBU-TT captions, set the font family to \"monospaced\".
-- Do not include any other style information.
ebuTtDDestinationSettings_styleControl :: Lens.Lens' EbuTtDDestinationSettings (Prelude.Maybe EbuTtDDestinationStyleControl)
ebuTtDDestinationSettings_styleControl :: Lens'
  EbuTtDDestinationSettings (Maybe EbuTtDDestinationStyleControl)
ebuTtDDestinationSettings_styleControl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbuTtDDestinationSettings' {Maybe EbuTtDDestinationStyleControl
styleControl :: Maybe EbuTtDDestinationStyleControl
$sel:styleControl:EbuTtDDestinationSettings' :: EbuTtDDestinationSettings -> Maybe EbuTtDDestinationStyleControl
styleControl} -> Maybe EbuTtDDestinationStyleControl
styleControl) (\s :: EbuTtDDestinationSettings
s@EbuTtDDestinationSettings' {} Maybe EbuTtDDestinationStyleControl
a -> EbuTtDDestinationSettings
s {$sel:styleControl:EbuTtDDestinationSettings' :: Maybe EbuTtDDestinationStyleControl
styleControl = Maybe EbuTtDDestinationStyleControl
a} :: EbuTtDDestinationSettings)

instance Data.FromJSON EbuTtDDestinationSettings where
  parseJSON :: Value -> Parser EbuTtDDestinationSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EbuTtDDestinationSettings"
      ( \Object
x ->
          Maybe Text
-> Maybe EbuTtDFillLineGapControl
-> Maybe Text
-> Maybe EbuTtDDestinationStyleControl
-> EbuTtDDestinationSettings
EbuTtDDestinationSettings'
            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
"copyrightHolder")
            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
"fillLineGap")
            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
"fontFamily")
            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
"styleControl")
      )

instance Prelude.Hashable EbuTtDDestinationSettings where
  hashWithSalt :: Int -> EbuTtDDestinationSettings -> Int
hashWithSalt Int
_salt EbuTtDDestinationSettings' {Maybe Text
Maybe EbuTtDDestinationStyleControl
Maybe EbuTtDFillLineGapControl
styleControl :: Maybe EbuTtDDestinationStyleControl
fontFamily :: Maybe Text
fillLineGap :: Maybe EbuTtDFillLineGapControl
copyrightHolder :: Maybe Text
$sel:styleControl:EbuTtDDestinationSettings' :: EbuTtDDestinationSettings -> Maybe EbuTtDDestinationStyleControl
$sel:fontFamily:EbuTtDDestinationSettings' :: EbuTtDDestinationSettings -> Maybe Text
$sel:fillLineGap:EbuTtDDestinationSettings' :: EbuTtDDestinationSettings -> Maybe EbuTtDFillLineGapControl
$sel:copyrightHolder:EbuTtDDestinationSettings' :: EbuTtDDestinationSettings -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
copyrightHolder
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EbuTtDFillLineGapControl
fillLineGap
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fontFamily
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EbuTtDDestinationStyleControl
styleControl

instance Prelude.NFData EbuTtDDestinationSettings where
  rnf :: EbuTtDDestinationSettings -> ()
rnf EbuTtDDestinationSettings' {Maybe Text
Maybe EbuTtDDestinationStyleControl
Maybe EbuTtDFillLineGapControl
styleControl :: Maybe EbuTtDDestinationStyleControl
fontFamily :: Maybe Text
fillLineGap :: Maybe EbuTtDFillLineGapControl
copyrightHolder :: Maybe Text
$sel:styleControl:EbuTtDDestinationSettings' :: EbuTtDDestinationSettings -> Maybe EbuTtDDestinationStyleControl
$sel:fontFamily:EbuTtDDestinationSettings' :: EbuTtDDestinationSettings -> Maybe Text
$sel:fillLineGap:EbuTtDDestinationSettings' :: EbuTtDDestinationSettings -> Maybe EbuTtDFillLineGapControl
$sel:copyrightHolder:EbuTtDDestinationSettings' :: EbuTtDDestinationSettings -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
copyrightHolder
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EbuTtDFillLineGapControl
fillLineGap
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fontFamily
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EbuTtDDestinationStyleControl
styleControl

instance Data.ToJSON EbuTtDDestinationSettings where
  toJSON :: EbuTtDDestinationSettings -> Value
toJSON EbuTtDDestinationSettings' {Maybe Text
Maybe EbuTtDDestinationStyleControl
Maybe EbuTtDFillLineGapControl
styleControl :: Maybe EbuTtDDestinationStyleControl
fontFamily :: Maybe Text
fillLineGap :: Maybe EbuTtDFillLineGapControl
copyrightHolder :: Maybe Text
$sel:styleControl:EbuTtDDestinationSettings' :: EbuTtDDestinationSettings -> Maybe EbuTtDDestinationStyleControl
$sel:fontFamily:EbuTtDDestinationSettings' :: EbuTtDDestinationSettings -> Maybe Text
$sel:fillLineGap:EbuTtDDestinationSettings' :: EbuTtDDestinationSettings -> Maybe EbuTtDFillLineGapControl
$sel:copyrightHolder:EbuTtDDestinationSettings' :: EbuTtDDestinationSettings -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"copyrightHolder" 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
copyrightHolder,
            (Key
"fillLineGap" 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 EbuTtDFillLineGapControl
fillLineGap,
            (Key
"fontFamily" 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
fontFamily,
            (Key
"styleControl" 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 EbuTtDDestinationStyleControl
styleControl
          ]
      )