{-# 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-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.CmfcAudioDuration
  ( CmfcAudioDuration
      ( ..,
        CmfcAudioDuration_DEFAULT_CODEC_DURATION,
        CmfcAudioDuration_MATCH_VIDEO_DURATION
      ),
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Data as Data
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 ::
      Data.Text
  }
  deriving stock
    ( Int -> CmfcAudioDuration -> ShowS
[CmfcAudioDuration] -> ShowS
CmfcAudioDuration -> String
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]
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
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
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
Prelude.Ord,
      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
    ( Eq CmfcAudioDuration
Int -> CmfcAudioDuration -> Int
CmfcAudioDuration -> Int
forall a. Eq 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 -> ()
forall a. (a -> ()) -> NFData a
rnf :: CmfcAudioDuration -> ()
$crnf :: CmfcAudioDuration -> ()
Prelude.NFData,
      Text -> Either String CmfcAudioDuration
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String CmfcAudioDuration
$cfromText :: Text -> Either String CmfcAudioDuration
Data.FromText,
      CmfcAudioDuration -> Text
forall a. (a -> Text) -> ToText a
toText :: CmfcAudioDuration -> Text
$ctoText :: CmfcAudioDuration -> Text
Data.ToText,
      CmfcAudioDuration -> ByteString
forall a. (a -> ByteString) -> ToByteString a
toBS :: CmfcAudioDuration -> ByteString
$ctoBS :: CmfcAudioDuration -> ByteString
Data.ToByteString,
      CmfcAudioDuration -> ByteStringBuilder
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: CmfcAudioDuration -> ByteStringBuilder
$cbuild :: CmfcAudioDuration -> ByteStringBuilder
Data.ToLog,
      HeaderName -> CmfcAudioDuration -> [Header]
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> CmfcAudioDuration -> [Header]
$ctoHeader :: HeaderName -> CmfcAudioDuration -> [Header]
Data.ToHeader,
      CmfcAudioDuration -> QueryString
forall a. (a -> QueryString) -> ToQuery a
toQuery :: CmfcAudioDuration -> QueryString
$ctoQuery :: CmfcAudioDuration -> QueryString
Data.ToQuery,
      Value -> Parser [CmfcAudioDuration]
Value -> Parser 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
Data.FromJSON,
      FromJSONKeyFunction [CmfcAudioDuration]
FromJSONKeyFunction CmfcAudioDuration
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [CmfcAudioDuration]
$cfromJSONKeyList :: FromJSONKeyFunction [CmfcAudioDuration]
fromJSONKey :: FromJSONKeyFunction CmfcAudioDuration
$cfromJSONKey :: FromJSONKeyFunction CmfcAudioDuration
Data.FromJSONKey,
      [CmfcAudioDuration] -> Encoding
[CmfcAudioDuration] -> Value
CmfcAudioDuration -> Encoding
CmfcAudioDuration -> Value
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
Data.ToJSON,
      ToJSONKeyFunction [CmfcAudioDuration]
ToJSONKeyFunction CmfcAudioDuration
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [CmfcAudioDuration]
$ctoJSONKeyList :: ToJSONKeyFunction [CmfcAudioDuration]
toJSONKey :: ToJSONKeyFunction CmfcAudioDuration
$ctoJSONKey :: ToJSONKeyFunction CmfcAudioDuration
Data.ToJSONKey,
      [Node] -> Either String CmfcAudioDuration
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String CmfcAudioDuration
$cparseXML :: [Node] -> Either String CmfcAudioDuration
Data.FromXML,
      CmfcAudioDuration -> XML
forall a. (a -> XML) -> ToXML a
toXML :: CmfcAudioDuration -> XML
$ctoXML :: CmfcAudioDuration -> XML
Data.ToXML
    )

pattern CmfcAudioDuration_DEFAULT_CODEC_DURATION :: CmfcAudioDuration
pattern $bCmfcAudioDuration_DEFAULT_CODEC_DURATION :: CmfcAudioDuration
$mCmfcAudioDuration_DEFAULT_CODEC_DURATION :: forall {r}. CmfcAudioDuration -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> r) -> r
CmfcAudioDuration_MATCH_VIDEO_DURATION = CmfcAudioDuration' "MATCH_VIDEO_DURATION"

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