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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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'
  { -- | 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,
    -- | Applies only if you plan to convert these source captions to EBU-TT-D or
    -- TTML in an output. Complete this field if you want to include the name
    -- of the copyright holder in the copyright metadata tag in the TTML
    EbuTtDDestinationSettings -> Maybe Text
copyrightHolder :: Prelude.Maybe Prelude.Text,
    -- | 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
(EbuTtDDestinationSettings -> EbuTtDDestinationSettings -> Bool)
-> (EbuTtDDestinationSettings -> EbuTtDDestinationSettings -> Bool)
-> Eq EbuTtDDestinationSettings
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]
(Int -> ReadS EbuTtDDestinationSettings)
-> ReadS [EbuTtDDestinationSettings]
-> ReadPrec EbuTtDDestinationSettings
-> ReadPrec [EbuTtDDestinationSettings]
-> Read 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
(Int -> EbuTtDDestinationSettings -> ShowS)
-> (EbuTtDDestinationSettings -> String)
-> ([EbuTtDDestinationSettings] -> ShowS)
-> Show EbuTtDDestinationSettings
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.
 EbuTtDDestinationSettings -> Rep EbuTtDDestinationSettings x)
-> (forall x.
    Rep EbuTtDDestinationSettings x -> EbuTtDDestinationSettings)
-> Generic EbuTtDDestinationSettings
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:
--
-- '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.
--
-- 'copyrightHolder', 'ebuTtDDestinationSettings_copyrightHolder' - Applies only if you plan to convert these source captions to EBU-TT-D or
-- TTML in an output. Complete this field if you want to include the name
-- of the copyright holder in the copyright metadata tag in the TTML
--
-- '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' :: Maybe EbuTtDFillLineGapControl
-> Maybe Text
-> Maybe Text
-> Maybe EbuTtDDestinationStyleControl
-> EbuTtDDestinationSettings
EbuTtDDestinationSettings'
    { $sel:fillLineGap:EbuTtDDestinationSettings' :: Maybe EbuTtDFillLineGapControl
fillLineGap =
        Maybe EbuTtDFillLineGapControl
forall a. Maybe a
Prelude.Nothing,
      $sel:copyrightHolder:EbuTtDDestinationSettings' :: Maybe Text
copyrightHolder = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fontFamily:EbuTtDDestinationSettings' :: Maybe Text
fontFamily = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:styleControl:EbuTtDDestinationSettings' :: Maybe EbuTtDDestinationStyleControl
styleControl = Maybe EbuTtDDestinationStyleControl
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe EbuTtDFillLineGapControl
 -> f (Maybe EbuTtDFillLineGapControl))
-> EbuTtDDestinationSettings -> f EbuTtDDestinationSettings
ebuTtDDestinationSettings_fillLineGap = (EbuTtDDestinationSettings -> Maybe EbuTtDFillLineGapControl)
-> (EbuTtDDestinationSettings
    -> Maybe EbuTtDFillLineGapControl -> EbuTtDDestinationSettings)
-> Lens
     EbuTtDDestinationSettings
     EbuTtDDestinationSettings
     (Maybe EbuTtDFillLineGapControl)
     (Maybe EbuTtDFillLineGapControl)
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)

-- | Applies only if you plan to convert these source captions to EBU-TT-D or
-- TTML in an output. Complete this field if you want to include the name
-- of the copyright holder in the copyright metadata tag in the TTML
ebuTtDDestinationSettings_copyrightHolder :: Lens.Lens' EbuTtDDestinationSettings (Prelude.Maybe Prelude.Text)
ebuTtDDestinationSettings_copyrightHolder :: (Maybe Text -> f (Maybe Text))
-> EbuTtDDestinationSettings -> f EbuTtDDestinationSettings
ebuTtDDestinationSettings_copyrightHolder = (EbuTtDDestinationSettings -> Maybe Text)
-> (EbuTtDDestinationSettings
    -> Maybe Text -> EbuTtDDestinationSettings)
-> Lens
     EbuTtDDestinationSettings
     EbuTtDDestinationSettings
     (Maybe Text)
     (Maybe Text)
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 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 :: (Maybe Text -> f (Maybe Text))
-> EbuTtDDestinationSettings -> f EbuTtDDestinationSettings
ebuTtDDestinationSettings_fontFamily = (EbuTtDDestinationSettings -> Maybe Text)
-> (EbuTtDDestinationSettings
    -> Maybe Text -> EbuTtDDestinationSettings)
-> Lens
     EbuTtDDestinationSettings
     EbuTtDDestinationSettings
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe EbuTtDDestinationStyleControl
 -> f (Maybe EbuTtDDestinationStyleControl))
-> EbuTtDDestinationSettings -> f EbuTtDDestinationSettings
ebuTtDDestinationSettings_styleControl = (EbuTtDDestinationSettings -> Maybe EbuTtDDestinationStyleControl)
-> (EbuTtDDestinationSettings
    -> Maybe EbuTtDDestinationStyleControl
    -> EbuTtDDestinationSettings)
-> Lens
     EbuTtDDestinationSettings
     EbuTtDDestinationSettings
     (Maybe EbuTtDDestinationStyleControl)
     (Maybe EbuTtDDestinationStyleControl)
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 Core.FromJSON EbuTtDDestinationSettings where
  parseJSON :: Value -> Parser EbuTtDDestinationSettings
parseJSON =
    String
-> (Object -> Parser EbuTtDDestinationSettings)
-> Value
-> Parser EbuTtDDestinationSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EbuTtDDestinationSettings"
      ( \Object
x ->
          Maybe EbuTtDFillLineGapControl
-> Maybe Text
-> Maybe Text
-> Maybe EbuTtDDestinationStyleControl
-> EbuTtDDestinationSettings
EbuTtDDestinationSettings'
            (Maybe EbuTtDFillLineGapControl
 -> Maybe Text
 -> Maybe Text
 -> Maybe EbuTtDDestinationStyleControl
 -> EbuTtDDestinationSettings)
-> Parser (Maybe EbuTtDFillLineGapControl)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe EbuTtDDestinationStyleControl
      -> EbuTtDDestinationSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe EbuTtDFillLineGapControl)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"fillLineGap")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe EbuTtDDestinationStyleControl
   -> EbuTtDDestinationSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe EbuTtDDestinationStyleControl
      -> EbuTtDDestinationSettings)
forall (f :: * -> *) a b. Applicative f => 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
"copyrightHolder")
            Parser
  (Maybe Text
   -> Maybe EbuTtDDestinationStyleControl
   -> EbuTtDDestinationSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe EbuTtDDestinationStyleControl -> EbuTtDDestinationSettings)
forall (f :: * -> *) a b. Applicative f => 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
"fontFamily")
            Parser
  (Maybe EbuTtDDestinationStyleControl -> EbuTtDDestinationSettings)
-> Parser (Maybe EbuTtDDestinationStyleControl)
-> Parser EbuTtDDestinationSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EbuTtDDestinationStyleControl)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"styleControl")
      )

instance Prelude.Hashable EbuTtDDestinationSettings

instance Prelude.NFData EbuTtDDestinationSettings

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