{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}

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

-- |
-- Module      : Amazonka.MediaConvert.Types.CmfcAudioDuration
-- 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.CmfcAudioDuration
  ( CmfcAudioDuration
      ( ..,
        CmfcAudioDuration_DEFAULT_CODEC_DURATION,
        CmfcAudioDuration_MATCH_VIDEO_DURATION
      ),
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Prelude as Prelude

-- | Specify this setting only when your output will be consumed by a
-- downstream repackaging workflow that is sensitive to very small duration
-- differences between video and audio. For this situation, choose Match
-- video duration (MATCH_VIDEO_DURATION). In all other cases, keep the
-- default value, Default codec duration (DEFAULT_CODEC_DURATION). When you
-- choose Match video duration, MediaConvert pads the output audio streams
-- with silence or trims them to ensure that the total duration of each
-- audio stream is at least as long as the total duration of the video
-- stream. After padding or trimming, the audio stream duration is no more
-- than one frame longer than the video stream. MediaConvert applies audio
-- padding or trimming only to the end of the last segment of the output.
-- For unsegmented outputs, MediaConvert adds padding only to the end of
-- the file. When you keep the default value, any minor discrepancies
-- between audio and video duration will depend on your output audio codec.
newtype CmfcAudioDuration = CmfcAudioDuration'
  { CmfcAudioDuration -> Text
fromCmfcAudioDuration ::
      Core.Text
  }
  deriving stock
    ( Int -> CmfcAudioDuration -> ShowS
[CmfcAudioDuration] -> ShowS
CmfcAudioDuration -> String
(Int -> CmfcAudioDuration -> ShowS)
-> (CmfcAudioDuration -> String)
-> ([CmfcAudioDuration] -> ShowS)
-> Show CmfcAudioDuration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CmfcAudioDuration] -> ShowS
$cshowList :: [CmfcAudioDuration] -> ShowS
show :: CmfcAudioDuration -> String
$cshow :: CmfcAudioDuration -> String
showsPrec :: Int -> CmfcAudioDuration -> ShowS
$cshowsPrec :: Int -> CmfcAudioDuration -> ShowS
Prelude.Show,
      ReadPrec [CmfcAudioDuration]
ReadPrec CmfcAudioDuration
Int -> ReadS CmfcAudioDuration
ReadS [CmfcAudioDuration]
(Int -> ReadS CmfcAudioDuration)
-> ReadS [CmfcAudioDuration]
-> ReadPrec CmfcAudioDuration
-> ReadPrec [CmfcAudioDuration]
-> Read CmfcAudioDuration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CmfcAudioDuration]
$creadListPrec :: ReadPrec [CmfcAudioDuration]
readPrec :: ReadPrec CmfcAudioDuration
$creadPrec :: ReadPrec CmfcAudioDuration
readList :: ReadS [CmfcAudioDuration]
$creadList :: ReadS [CmfcAudioDuration]
readsPrec :: Int -> ReadS CmfcAudioDuration
$creadsPrec :: Int -> ReadS CmfcAudioDuration
Prelude.Read,
      CmfcAudioDuration -> CmfcAudioDuration -> Bool
(CmfcAudioDuration -> CmfcAudioDuration -> Bool)
-> (CmfcAudioDuration -> CmfcAudioDuration -> Bool)
-> Eq CmfcAudioDuration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CmfcAudioDuration -> CmfcAudioDuration -> Bool
$c/= :: CmfcAudioDuration -> CmfcAudioDuration -> Bool
== :: CmfcAudioDuration -> CmfcAudioDuration -> Bool
$c== :: CmfcAudioDuration -> CmfcAudioDuration -> Bool
Prelude.Eq,
      Eq CmfcAudioDuration
Eq CmfcAudioDuration
-> (CmfcAudioDuration -> CmfcAudioDuration -> Ordering)
-> (CmfcAudioDuration -> CmfcAudioDuration -> Bool)
-> (CmfcAudioDuration -> CmfcAudioDuration -> Bool)
-> (CmfcAudioDuration -> CmfcAudioDuration -> Bool)
-> (CmfcAudioDuration -> CmfcAudioDuration -> Bool)
-> (CmfcAudioDuration -> CmfcAudioDuration -> CmfcAudioDuration)
-> (CmfcAudioDuration -> CmfcAudioDuration -> CmfcAudioDuration)
-> Ord CmfcAudioDuration
CmfcAudioDuration -> CmfcAudioDuration -> Bool
CmfcAudioDuration -> CmfcAudioDuration -> Ordering
CmfcAudioDuration -> CmfcAudioDuration -> CmfcAudioDuration
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: CmfcAudioDuration -> CmfcAudioDuration -> CmfcAudioDuration
$cmin :: CmfcAudioDuration -> CmfcAudioDuration -> CmfcAudioDuration
max :: CmfcAudioDuration -> CmfcAudioDuration -> CmfcAudioDuration
$cmax :: CmfcAudioDuration -> CmfcAudioDuration -> CmfcAudioDuration
>= :: CmfcAudioDuration -> CmfcAudioDuration -> Bool
$c>= :: CmfcAudioDuration -> CmfcAudioDuration -> Bool
> :: CmfcAudioDuration -> CmfcAudioDuration -> Bool
$c> :: CmfcAudioDuration -> CmfcAudioDuration -> Bool
<= :: CmfcAudioDuration -> CmfcAudioDuration -> Bool
$c<= :: CmfcAudioDuration -> CmfcAudioDuration -> Bool
< :: CmfcAudioDuration -> CmfcAudioDuration -> Bool
$c< :: CmfcAudioDuration -> CmfcAudioDuration -> Bool
compare :: CmfcAudioDuration -> CmfcAudioDuration -> Ordering
$ccompare :: CmfcAudioDuration -> CmfcAudioDuration -> Ordering
$cp1Ord :: Eq CmfcAudioDuration
Prelude.Ord,
      (forall x. CmfcAudioDuration -> Rep CmfcAudioDuration x)
-> (forall x. Rep CmfcAudioDuration x -> CmfcAudioDuration)
-> Generic CmfcAudioDuration
forall x. Rep CmfcAudioDuration x -> CmfcAudioDuration
forall x. CmfcAudioDuration -> Rep CmfcAudioDuration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CmfcAudioDuration x -> CmfcAudioDuration
$cfrom :: forall x. CmfcAudioDuration -> Rep CmfcAudioDuration x
Prelude.Generic
    )
  deriving newtype
    ( Int -> CmfcAudioDuration -> Int
CmfcAudioDuration -> Int
(Int -> CmfcAudioDuration -> Int)
-> (CmfcAudioDuration -> Int) -> Hashable CmfcAudioDuration
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: CmfcAudioDuration -> Int
$chash :: CmfcAudioDuration -> Int
hashWithSalt :: Int -> CmfcAudioDuration -> Int
$chashWithSalt :: Int -> CmfcAudioDuration -> Int
Prelude.Hashable,
      CmfcAudioDuration -> ()
(CmfcAudioDuration -> ()) -> NFData CmfcAudioDuration
forall a. (a -> ()) -> NFData a
rnf :: CmfcAudioDuration -> ()
$crnf :: CmfcAudioDuration -> ()
Prelude.NFData,
      Text -> Either String CmfcAudioDuration
(Text -> Either String CmfcAudioDuration)
-> FromText CmfcAudioDuration
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String CmfcAudioDuration
$cfromText :: Text -> Either String CmfcAudioDuration
Core.FromText,
      CmfcAudioDuration -> Text
(CmfcAudioDuration -> Text) -> ToText CmfcAudioDuration
forall a. (a -> Text) -> ToText a
toText :: CmfcAudioDuration -> Text
$ctoText :: CmfcAudioDuration -> Text
Core.ToText,
      CmfcAudioDuration -> ByteString
(CmfcAudioDuration -> ByteString) -> ToByteString CmfcAudioDuration
forall a. (a -> ByteString) -> ToByteString a
toBS :: CmfcAudioDuration -> ByteString
$ctoBS :: CmfcAudioDuration -> ByteString
Core.ToByteString,
      CmfcAudioDuration -> ByteStringBuilder
(CmfcAudioDuration -> ByteStringBuilder) -> ToLog CmfcAudioDuration
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: CmfcAudioDuration -> ByteStringBuilder
$cbuild :: CmfcAudioDuration -> ByteStringBuilder
Core.ToLog,
      HeaderName -> CmfcAudioDuration -> [Header]
(HeaderName -> CmfcAudioDuration -> [Header])
-> ToHeader CmfcAudioDuration
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> CmfcAudioDuration -> [Header]
$ctoHeader :: HeaderName -> CmfcAudioDuration -> [Header]
Core.ToHeader,
      CmfcAudioDuration -> QueryString
(CmfcAudioDuration -> QueryString) -> ToQuery CmfcAudioDuration
forall a. (a -> QueryString) -> ToQuery a
toQuery :: CmfcAudioDuration -> QueryString
$ctoQuery :: CmfcAudioDuration -> QueryString
Core.ToQuery,
      Value -> Parser [CmfcAudioDuration]
Value -> Parser CmfcAudioDuration
(Value -> Parser CmfcAudioDuration)
-> (Value -> Parser [CmfcAudioDuration])
-> FromJSON CmfcAudioDuration
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [CmfcAudioDuration]
$cparseJSONList :: Value -> Parser [CmfcAudioDuration]
parseJSON :: Value -> Parser CmfcAudioDuration
$cparseJSON :: Value -> Parser CmfcAudioDuration
Core.FromJSON,
      FromJSONKeyFunction [CmfcAudioDuration]
FromJSONKeyFunction CmfcAudioDuration
FromJSONKeyFunction CmfcAudioDuration
-> FromJSONKeyFunction [CmfcAudioDuration]
-> FromJSONKey CmfcAudioDuration
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [CmfcAudioDuration]
$cfromJSONKeyList :: FromJSONKeyFunction [CmfcAudioDuration]
fromJSONKey :: FromJSONKeyFunction CmfcAudioDuration
$cfromJSONKey :: FromJSONKeyFunction CmfcAudioDuration
Core.FromJSONKey,
      [CmfcAudioDuration] -> Encoding
[CmfcAudioDuration] -> Value
CmfcAudioDuration -> Encoding
CmfcAudioDuration -> Value
(CmfcAudioDuration -> Value)
-> (CmfcAudioDuration -> Encoding)
-> ([CmfcAudioDuration] -> Value)
-> ([CmfcAudioDuration] -> Encoding)
-> ToJSON CmfcAudioDuration
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [CmfcAudioDuration] -> Encoding
$ctoEncodingList :: [CmfcAudioDuration] -> Encoding
toJSONList :: [CmfcAudioDuration] -> Value
$ctoJSONList :: [CmfcAudioDuration] -> Value
toEncoding :: CmfcAudioDuration -> Encoding
$ctoEncoding :: CmfcAudioDuration -> Encoding
toJSON :: CmfcAudioDuration -> Value
$ctoJSON :: CmfcAudioDuration -> Value
Core.ToJSON,
      ToJSONKeyFunction [CmfcAudioDuration]
ToJSONKeyFunction CmfcAudioDuration
ToJSONKeyFunction CmfcAudioDuration
-> ToJSONKeyFunction [CmfcAudioDuration]
-> ToJSONKey CmfcAudioDuration
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [CmfcAudioDuration]
$ctoJSONKeyList :: ToJSONKeyFunction [CmfcAudioDuration]
toJSONKey :: ToJSONKeyFunction CmfcAudioDuration
$ctoJSONKey :: ToJSONKeyFunction CmfcAudioDuration
Core.ToJSONKey,
      [Node] -> Either String CmfcAudioDuration
([Node] -> Either String CmfcAudioDuration)
-> FromXML CmfcAudioDuration
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String CmfcAudioDuration
$cparseXML :: [Node] -> Either String CmfcAudioDuration
Core.FromXML,
      CmfcAudioDuration -> XML
(CmfcAudioDuration -> XML) -> ToXML CmfcAudioDuration
forall a. (a -> XML) -> ToXML a
toXML :: CmfcAudioDuration -> XML
$ctoXML :: CmfcAudioDuration -> XML
Core.ToXML
    )

pattern CmfcAudioDuration_DEFAULT_CODEC_DURATION :: CmfcAudioDuration
pattern $bCmfcAudioDuration_DEFAULT_CODEC_DURATION :: CmfcAudioDuration
$mCmfcAudioDuration_DEFAULT_CODEC_DURATION :: forall r. CmfcAudioDuration -> (Void# -> r) -> (Void# -> r) -> r
CmfcAudioDuration_DEFAULT_CODEC_DURATION = CmfcAudioDuration' "DEFAULT_CODEC_DURATION"

pattern CmfcAudioDuration_MATCH_VIDEO_DURATION :: CmfcAudioDuration
pattern $bCmfcAudioDuration_MATCH_VIDEO_DURATION :: CmfcAudioDuration
$mCmfcAudioDuration_MATCH_VIDEO_DURATION :: forall r. CmfcAudioDuration -> (Void# -> r) -> (Void# -> r) -> r
CmfcAudioDuration_MATCH_VIDEO_DURATION = CmfcAudioDuration' "MATCH_VIDEO_DURATION"

{-# COMPLETE
  CmfcAudioDuration_DEFAULT_CODEC_DURATION,
  CmfcAudioDuration_MATCH_VIDEO_DURATION,
  CmfcAudioDuration'
  #-}