{-# 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.SccDestinationSettings
-- 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.SccDestinationSettings 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.SccDestinationFramerate
import qualified Amazonka.Prelude as Prelude

-- | Settings related to SCC captions. SCC is a sidecar format that holds
-- captions in a file that is separate from the video container. Set up
-- sidecar captions in the same output group, but different output from
-- your video. For more information, see
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/scc-srt-output-captions.html.
-- When you work directly in your JSON job specification, include this
-- object and any required children when you set destinationType to SCC.
--
-- /See:/ 'newSccDestinationSettings' smart constructor.
data SccDestinationSettings = SccDestinationSettings'
  { -- | Set Framerate (SccDestinationFramerate) to make sure that the captions
    -- and the video are synchronized in the output. Specify a frame rate that
    -- matches the frame rate of the associated video. If the video frame rate
    -- is 29.97, choose 29.97 dropframe (FRAMERATE_29_97_DROPFRAME) only if the
    -- video has video_insertion=true and drop_frame_timecode=true; otherwise,
    -- choose 29.97 non-dropframe (FRAMERATE_29_97_NON_DROPFRAME).
    SccDestinationSettings -> Maybe SccDestinationFramerate
framerate :: Prelude.Maybe SccDestinationFramerate
  }
  deriving (SccDestinationSettings -> SccDestinationSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SccDestinationSettings -> SccDestinationSettings -> Bool
$c/= :: SccDestinationSettings -> SccDestinationSettings -> Bool
== :: SccDestinationSettings -> SccDestinationSettings -> Bool
$c== :: SccDestinationSettings -> SccDestinationSettings -> Bool
Prelude.Eq, ReadPrec [SccDestinationSettings]
ReadPrec SccDestinationSettings
Int -> ReadS SccDestinationSettings
ReadS [SccDestinationSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SccDestinationSettings]
$creadListPrec :: ReadPrec [SccDestinationSettings]
readPrec :: ReadPrec SccDestinationSettings
$creadPrec :: ReadPrec SccDestinationSettings
readList :: ReadS [SccDestinationSettings]
$creadList :: ReadS [SccDestinationSettings]
readsPrec :: Int -> ReadS SccDestinationSettings
$creadsPrec :: Int -> ReadS SccDestinationSettings
Prelude.Read, Int -> SccDestinationSettings -> ShowS
[SccDestinationSettings] -> ShowS
SccDestinationSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SccDestinationSettings] -> ShowS
$cshowList :: [SccDestinationSettings] -> ShowS
show :: SccDestinationSettings -> String
$cshow :: SccDestinationSettings -> String
showsPrec :: Int -> SccDestinationSettings -> ShowS
$cshowsPrec :: Int -> SccDestinationSettings -> ShowS
Prelude.Show, forall x. Rep SccDestinationSettings x -> SccDestinationSettings
forall x. SccDestinationSettings -> Rep SccDestinationSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SccDestinationSettings x -> SccDestinationSettings
$cfrom :: forall x. SccDestinationSettings -> Rep SccDestinationSettings x
Prelude.Generic)

-- |
-- Create a value of 'SccDestinationSettings' 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:
--
-- 'framerate', 'sccDestinationSettings_framerate' - Set Framerate (SccDestinationFramerate) to make sure that the captions
-- and the video are synchronized in the output. Specify a frame rate that
-- matches the frame rate of the associated video. If the video frame rate
-- is 29.97, choose 29.97 dropframe (FRAMERATE_29_97_DROPFRAME) only if the
-- video has video_insertion=true and drop_frame_timecode=true; otherwise,
-- choose 29.97 non-dropframe (FRAMERATE_29_97_NON_DROPFRAME).
newSccDestinationSettings ::
  SccDestinationSettings
newSccDestinationSettings :: SccDestinationSettings
newSccDestinationSettings =
  SccDestinationSettings'
    { $sel:framerate:SccDestinationSettings' :: Maybe SccDestinationFramerate
framerate =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Set Framerate (SccDestinationFramerate) to make sure that the captions
-- and the video are synchronized in the output. Specify a frame rate that
-- matches the frame rate of the associated video. If the video frame rate
-- is 29.97, choose 29.97 dropframe (FRAMERATE_29_97_DROPFRAME) only if the
-- video has video_insertion=true and drop_frame_timecode=true; otherwise,
-- choose 29.97 non-dropframe (FRAMERATE_29_97_NON_DROPFRAME).
sccDestinationSettings_framerate :: Lens.Lens' SccDestinationSettings (Prelude.Maybe SccDestinationFramerate)
sccDestinationSettings_framerate :: Lens' SccDestinationSettings (Maybe SccDestinationFramerate)
sccDestinationSettings_framerate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SccDestinationSettings' {Maybe SccDestinationFramerate
framerate :: Maybe SccDestinationFramerate
$sel:framerate:SccDestinationSettings' :: SccDestinationSettings -> Maybe SccDestinationFramerate
framerate} -> Maybe SccDestinationFramerate
framerate) (\s :: SccDestinationSettings
s@SccDestinationSettings' {} Maybe SccDestinationFramerate
a -> SccDestinationSettings
s {$sel:framerate:SccDestinationSettings' :: Maybe SccDestinationFramerate
framerate = Maybe SccDestinationFramerate
a} :: SccDestinationSettings)

instance Data.FromJSON SccDestinationSettings where
  parseJSON :: Value -> Parser SccDestinationSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SccDestinationSettings"
      ( \Object
x ->
          Maybe SccDestinationFramerate -> SccDestinationSettings
SccDestinationSettings'
            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
"framerate")
      )

instance Prelude.Hashable SccDestinationSettings where
  hashWithSalt :: Int -> SccDestinationSettings -> Int
hashWithSalt Int
_salt SccDestinationSettings' {Maybe SccDestinationFramerate
framerate :: Maybe SccDestinationFramerate
$sel:framerate:SccDestinationSettings' :: SccDestinationSettings -> Maybe SccDestinationFramerate
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SccDestinationFramerate
framerate

instance Prelude.NFData SccDestinationSettings where
  rnf :: SccDestinationSettings -> ()
rnf SccDestinationSettings' {Maybe SccDestinationFramerate
framerate :: Maybe SccDestinationFramerate
$sel:framerate:SccDestinationSettings' :: SccDestinationSettings -> Maybe SccDestinationFramerate
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe SccDestinationFramerate
framerate

instance Data.ToJSON SccDestinationSettings where
  toJSON :: SccDestinationSettings -> Value
toJSON SccDestinationSettings' {Maybe SccDestinationFramerate
framerate :: Maybe SccDestinationFramerate
$sel:framerate:SccDestinationSettings' :: SccDestinationSettings -> Maybe SccDestinationFramerate
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"framerate" 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 SccDestinationFramerate
framerate]
      )