{-# 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.Ac3Settings
-- 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.Ac3Settings 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.Ac3BitstreamMode
import Amazonka.MediaConvert.Types.Ac3CodingMode
import Amazonka.MediaConvert.Types.Ac3DynamicRangeCompressionLine
import Amazonka.MediaConvert.Types.Ac3DynamicRangeCompressionProfile
import Amazonka.MediaConvert.Types.Ac3DynamicRangeCompressionRf
import Amazonka.MediaConvert.Types.Ac3LfeFilter
import Amazonka.MediaConvert.Types.Ac3MetadataControl
import qualified Amazonka.Prelude as Prelude

-- | Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
-- to the value AC3.
--
-- /See:/ 'newAc3Settings' smart constructor.
data Ac3Settings = Ac3Settings'
  { -- | Specify the average bitrate in bits per second. The bitrate that you
    -- specify must be a multiple of 8000 within the allowed minimum and
    -- maximum values. Leave blank to use the default bitrate for the coding
    -- mode you select according ETSI TS 102 366. Valid bitrates for coding
    -- mode 1\/0: Default: 96000. Minimum: 64000. Maximum: 128000. Valid
    -- bitrates for coding mode 1\/1: Default: 192000. Minimum: 128000.
    -- Maximum: 384000. Valid bitrates for coding mode 2\/0: Default: 192000.
    -- Minimum: 128000. Maximum: 384000. Valid bitrates for coding mode 3\/2
    -- with FLE: Default: 384000. Minimum: 384000. Maximum: 640000.
    Ac3Settings -> Maybe Natural
bitrate :: Prelude.Maybe Prelude.Natural,
    -- | Specify the bitstream mode for the AC-3 stream that the encoder emits.
    -- For more information about the AC3 bitstream mode, see ATSC A\/52-2012
    -- (Annex E).
    Ac3Settings -> Maybe Ac3BitstreamMode
bitstreamMode :: Prelude.Maybe Ac3BitstreamMode,
    -- | Dolby Digital coding mode. Determines number of channels.
    Ac3Settings -> Maybe Ac3CodingMode
codingMode :: Prelude.Maybe Ac3CodingMode,
    -- | Sets the dialnorm for the output. If blank and input audio is Dolby
    -- Digital, dialnorm will be passed through.
    Ac3Settings -> Maybe Natural
dialnorm :: Prelude.Maybe Prelude.Natural,
    -- | Choose the Dolby Digital dynamic range control (DRC) profile that
    -- MediaConvert uses when encoding the metadata in the Dolby Digital stream
    -- for the line operating mode. Related setting: When you use this setting,
    -- MediaConvert ignores any value you provide for Dynamic range compression
    -- profile (DynamicRangeCompressionProfile). For information about the
    -- Dolby Digital DRC operating modes and profiles, see the Dynamic Range
    -- Control chapter of the Dolby Metadata Guide at
    -- https:\/\/developer.dolby.com\/globalassets\/professional\/documents\/dolby-metadata-guide.pdf.
    Ac3Settings -> Maybe Ac3DynamicRangeCompressionLine
dynamicRangeCompressionLine :: Prelude.Maybe Ac3DynamicRangeCompressionLine,
    -- | When you want to add Dolby dynamic range compression (DRC) signaling to
    -- your output stream, we recommend that you use the mode-specific settings
    -- instead of Dynamic range compression profile
    -- (DynamicRangeCompressionProfile). The mode-specific settings are Dynamic
    -- range compression profile, line mode (dynamicRangeCompressionLine) and
    -- Dynamic range compression profile, RF mode (dynamicRangeCompressionRf).
    -- Note that when you specify values for all three settings, MediaConvert
    -- ignores the value of this setting in favor of the mode-specific
    -- settings. If you do use this setting instead of the mode-specific
    -- settings, choose None (NONE) to leave out DRC signaling. Keep the
    -- default Film standard (FILM_STANDARD) to set the profile to Dolby\'s
    -- film standard profile for all operating modes.
    Ac3Settings -> Maybe Ac3DynamicRangeCompressionProfile
dynamicRangeCompressionProfile :: Prelude.Maybe Ac3DynamicRangeCompressionProfile,
    -- | Choose the Dolby Digital dynamic range control (DRC) profile that
    -- MediaConvert uses when encoding the metadata in the Dolby Digital stream
    -- for the RF operating mode. Related setting: When you use this setting,
    -- MediaConvert ignores any value you provide for Dynamic range compression
    -- profile (DynamicRangeCompressionProfile). For information about the
    -- Dolby Digital DRC operating modes and profiles, see the Dynamic Range
    -- Control chapter of the Dolby Metadata Guide at
    -- https:\/\/developer.dolby.com\/globalassets\/professional\/documents\/dolby-metadata-guide.pdf.
    Ac3Settings -> Maybe Ac3DynamicRangeCompressionRf
dynamicRangeCompressionRf :: Prelude.Maybe Ac3DynamicRangeCompressionRf,
    -- | Applies a 120Hz lowpass filter to the LFE channel prior to encoding.
    -- Only valid with 3_2_LFE coding mode.
    Ac3Settings -> Maybe Ac3LfeFilter
lfeFilter :: Prelude.Maybe Ac3LfeFilter,
    -- | When set to FOLLOW_INPUT, encoder metadata will be sourced from the DD,
    -- DD+, or DolbyE decoder that supplied this audio data. If audio was not
    -- supplied from one of these streams, then the static metadata settings
    -- will be used.
    Ac3Settings -> Maybe Ac3MetadataControl
metadataControl :: Prelude.Maybe Ac3MetadataControl,
    -- | This value is always 48000. It represents the sample rate in Hz.
    Ac3Settings -> Maybe Natural
sampleRate :: Prelude.Maybe Prelude.Natural
  }
  deriving (Ac3Settings -> Ac3Settings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Ac3Settings -> Ac3Settings -> Bool
$c/= :: Ac3Settings -> Ac3Settings -> Bool
== :: Ac3Settings -> Ac3Settings -> Bool
$c== :: Ac3Settings -> Ac3Settings -> Bool
Prelude.Eq, ReadPrec [Ac3Settings]
ReadPrec Ac3Settings
Int -> ReadS Ac3Settings
ReadS [Ac3Settings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Ac3Settings]
$creadListPrec :: ReadPrec [Ac3Settings]
readPrec :: ReadPrec Ac3Settings
$creadPrec :: ReadPrec Ac3Settings
readList :: ReadS [Ac3Settings]
$creadList :: ReadS [Ac3Settings]
readsPrec :: Int -> ReadS Ac3Settings
$creadsPrec :: Int -> ReadS Ac3Settings
Prelude.Read, Int -> Ac3Settings -> ShowS
[Ac3Settings] -> ShowS
Ac3Settings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Ac3Settings] -> ShowS
$cshowList :: [Ac3Settings] -> ShowS
show :: Ac3Settings -> String
$cshow :: Ac3Settings -> String
showsPrec :: Int -> Ac3Settings -> ShowS
$cshowsPrec :: Int -> Ac3Settings -> ShowS
Prelude.Show, forall x. Rep Ac3Settings x -> Ac3Settings
forall x. Ac3Settings -> Rep Ac3Settings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Ac3Settings x -> Ac3Settings
$cfrom :: forall x. Ac3Settings -> Rep Ac3Settings x
Prelude.Generic)

-- |
-- Create a value of 'Ac3Settings' 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:
--
-- 'bitrate', 'ac3Settings_bitrate' - Specify the average bitrate in bits per second. The bitrate that you
-- specify must be a multiple of 8000 within the allowed minimum and
-- maximum values. Leave blank to use the default bitrate for the coding
-- mode you select according ETSI TS 102 366. Valid bitrates for coding
-- mode 1\/0: Default: 96000. Minimum: 64000. Maximum: 128000. Valid
-- bitrates for coding mode 1\/1: Default: 192000. Minimum: 128000.
-- Maximum: 384000. Valid bitrates for coding mode 2\/0: Default: 192000.
-- Minimum: 128000. Maximum: 384000. Valid bitrates for coding mode 3\/2
-- with FLE: Default: 384000. Minimum: 384000. Maximum: 640000.
--
-- 'bitstreamMode', 'ac3Settings_bitstreamMode' - Specify the bitstream mode for the AC-3 stream that the encoder emits.
-- For more information about the AC3 bitstream mode, see ATSC A\/52-2012
-- (Annex E).
--
-- 'codingMode', 'ac3Settings_codingMode' - Dolby Digital coding mode. Determines number of channels.
--
-- 'dialnorm', 'ac3Settings_dialnorm' - Sets the dialnorm for the output. If blank and input audio is Dolby
-- Digital, dialnorm will be passed through.
--
-- 'dynamicRangeCompressionLine', 'ac3Settings_dynamicRangeCompressionLine' - Choose the Dolby Digital dynamic range control (DRC) profile that
-- MediaConvert uses when encoding the metadata in the Dolby Digital stream
-- for the line operating mode. Related setting: When you use this setting,
-- MediaConvert ignores any value you provide for Dynamic range compression
-- profile (DynamicRangeCompressionProfile). For information about the
-- Dolby Digital DRC operating modes and profiles, see the Dynamic Range
-- Control chapter of the Dolby Metadata Guide at
-- https:\/\/developer.dolby.com\/globalassets\/professional\/documents\/dolby-metadata-guide.pdf.
--
-- 'dynamicRangeCompressionProfile', 'ac3Settings_dynamicRangeCompressionProfile' - When you want to add Dolby dynamic range compression (DRC) signaling to
-- your output stream, we recommend that you use the mode-specific settings
-- instead of Dynamic range compression profile
-- (DynamicRangeCompressionProfile). The mode-specific settings are Dynamic
-- range compression profile, line mode (dynamicRangeCompressionLine) and
-- Dynamic range compression profile, RF mode (dynamicRangeCompressionRf).
-- Note that when you specify values for all three settings, MediaConvert
-- ignores the value of this setting in favor of the mode-specific
-- settings. If you do use this setting instead of the mode-specific
-- settings, choose None (NONE) to leave out DRC signaling. Keep the
-- default Film standard (FILM_STANDARD) to set the profile to Dolby\'s
-- film standard profile for all operating modes.
--
-- 'dynamicRangeCompressionRf', 'ac3Settings_dynamicRangeCompressionRf' - Choose the Dolby Digital dynamic range control (DRC) profile that
-- MediaConvert uses when encoding the metadata in the Dolby Digital stream
-- for the RF operating mode. Related setting: When you use this setting,
-- MediaConvert ignores any value you provide for Dynamic range compression
-- profile (DynamicRangeCompressionProfile). For information about the
-- Dolby Digital DRC operating modes and profiles, see the Dynamic Range
-- Control chapter of the Dolby Metadata Guide at
-- https:\/\/developer.dolby.com\/globalassets\/professional\/documents\/dolby-metadata-guide.pdf.
--
-- 'lfeFilter', 'ac3Settings_lfeFilter' - Applies a 120Hz lowpass filter to the LFE channel prior to encoding.
-- Only valid with 3_2_LFE coding mode.
--
-- 'metadataControl', 'ac3Settings_metadataControl' - When set to FOLLOW_INPUT, encoder metadata will be sourced from the DD,
-- DD+, or DolbyE decoder that supplied this audio data. If audio was not
-- supplied from one of these streams, then the static metadata settings
-- will be used.
--
-- 'sampleRate', 'ac3Settings_sampleRate' - This value is always 48000. It represents the sample rate in Hz.
newAc3Settings ::
  Ac3Settings
newAc3Settings :: Ac3Settings
newAc3Settings =
  Ac3Settings'
    { $sel:bitrate:Ac3Settings' :: Maybe Natural
bitrate = forall a. Maybe a
Prelude.Nothing,
      $sel:bitstreamMode:Ac3Settings' :: Maybe Ac3BitstreamMode
bitstreamMode = forall a. Maybe a
Prelude.Nothing,
      $sel:codingMode:Ac3Settings' :: Maybe Ac3CodingMode
codingMode = forall a. Maybe a
Prelude.Nothing,
      $sel:dialnorm:Ac3Settings' :: Maybe Natural
dialnorm = forall a. Maybe a
Prelude.Nothing,
      $sel:dynamicRangeCompressionLine:Ac3Settings' :: Maybe Ac3DynamicRangeCompressionLine
dynamicRangeCompressionLine = forall a. Maybe a
Prelude.Nothing,
      $sel:dynamicRangeCompressionProfile:Ac3Settings' :: Maybe Ac3DynamicRangeCompressionProfile
dynamicRangeCompressionProfile = forall a. Maybe a
Prelude.Nothing,
      $sel:dynamicRangeCompressionRf:Ac3Settings' :: Maybe Ac3DynamicRangeCompressionRf
dynamicRangeCompressionRf = forall a. Maybe a
Prelude.Nothing,
      $sel:lfeFilter:Ac3Settings' :: Maybe Ac3LfeFilter
lfeFilter = forall a. Maybe a
Prelude.Nothing,
      $sel:metadataControl:Ac3Settings' :: Maybe Ac3MetadataControl
metadataControl = forall a. Maybe a
Prelude.Nothing,
      $sel:sampleRate:Ac3Settings' :: Maybe Natural
sampleRate = forall a. Maybe a
Prelude.Nothing
    }

-- | Specify the average bitrate in bits per second. The bitrate that you
-- specify must be a multiple of 8000 within the allowed minimum and
-- maximum values. Leave blank to use the default bitrate for the coding
-- mode you select according ETSI TS 102 366. Valid bitrates for coding
-- mode 1\/0: Default: 96000. Minimum: 64000. Maximum: 128000. Valid
-- bitrates for coding mode 1\/1: Default: 192000. Minimum: 128000.
-- Maximum: 384000. Valid bitrates for coding mode 2\/0: Default: 192000.
-- Minimum: 128000. Maximum: 384000. Valid bitrates for coding mode 3\/2
-- with FLE: Default: 384000. Minimum: 384000. Maximum: 640000.
ac3Settings_bitrate :: Lens.Lens' Ac3Settings (Prelude.Maybe Prelude.Natural)
ac3Settings_bitrate :: Lens' Ac3Settings (Maybe Natural)
ac3Settings_bitrate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ac3Settings' {Maybe Natural
bitrate :: Maybe Natural
$sel:bitrate:Ac3Settings' :: Ac3Settings -> Maybe Natural
bitrate} -> Maybe Natural
bitrate) (\s :: Ac3Settings
s@Ac3Settings' {} Maybe Natural
a -> Ac3Settings
s {$sel:bitrate:Ac3Settings' :: Maybe Natural
bitrate = Maybe Natural
a} :: Ac3Settings)

-- | Specify the bitstream mode for the AC-3 stream that the encoder emits.
-- For more information about the AC3 bitstream mode, see ATSC A\/52-2012
-- (Annex E).
ac3Settings_bitstreamMode :: Lens.Lens' Ac3Settings (Prelude.Maybe Ac3BitstreamMode)
ac3Settings_bitstreamMode :: Lens' Ac3Settings (Maybe Ac3BitstreamMode)
ac3Settings_bitstreamMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ac3Settings' {Maybe Ac3BitstreamMode
bitstreamMode :: Maybe Ac3BitstreamMode
$sel:bitstreamMode:Ac3Settings' :: Ac3Settings -> Maybe Ac3BitstreamMode
bitstreamMode} -> Maybe Ac3BitstreamMode
bitstreamMode) (\s :: Ac3Settings
s@Ac3Settings' {} Maybe Ac3BitstreamMode
a -> Ac3Settings
s {$sel:bitstreamMode:Ac3Settings' :: Maybe Ac3BitstreamMode
bitstreamMode = Maybe Ac3BitstreamMode
a} :: Ac3Settings)

-- | Dolby Digital coding mode. Determines number of channels.
ac3Settings_codingMode :: Lens.Lens' Ac3Settings (Prelude.Maybe Ac3CodingMode)
ac3Settings_codingMode :: Lens' Ac3Settings (Maybe Ac3CodingMode)
ac3Settings_codingMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ac3Settings' {Maybe Ac3CodingMode
codingMode :: Maybe Ac3CodingMode
$sel:codingMode:Ac3Settings' :: Ac3Settings -> Maybe Ac3CodingMode
codingMode} -> Maybe Ac3CodingMode
codingMode) (\s :: Ac3Settings
s@Ac3Settings' {} Maybe Ac3CodingMode
a -> Ac3Settings
s {$sel:codingMode:Ac3Settings' :: Maybe Ac3CodingMode
codingMode = Maybe Ac3CodingMode
a} :: Ac3Settings)

-- | Sets the dialnorm for the output. If blank and input audio is Dolby
-- Digital, dialnorm will be passed through.
ac3Settings_dialnorm :: Lens.Lens' Ac3Settings (Prelude.Maybe Prelude.Natural)
ac3Settings_dialnorm :: Lens' Ac3Settings (Maybe Natural)
ac3Settings_dialnorm = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ac3Settings' {Maybe Natural
dialnorm :: Maybe Natural
$sel:dialnorm:Ac3Settings' :: Ac3Settings -> Maybe Natural
dialnorm} -> Maybe Natural
dialnorm) (\s :: Ac3Settings
s@Ac3Settings' {} Maybe Natural
a -> Ac3Settings
s {$sel:dialnorm:Ac3Settings' :: Maybe Natural
dialnorm = Maybe Natural
a} :: Ac3Settings)

-- | Choose the Dolby Digital dynamic range control (DRC) profile that
-- MediaConvert uses when encoding the metadata in the Dolby Digital stream
-- for the line operating mode. Related setting: When you use this setting,
-- MediaConvert ignores any value you provide for Dynamic range compression
-- profile (DynamicRangeCompressionProfile). For information about the
-- Dolby Digital DRC operating modes and profiles, see the Dynamic Range
-- Control chapter of the Dolby Metadata Guide at
-- https:\/\/developer.dolby.com\/globalassets\/professional\/documents\/dolby-metadata-guide.pdf.
ac3Settings_dynamicRangeCompressionLine :: Lens.Lens' Ac3Settings (Prelude.Maybe Ac3DynamicRangeCompressionLine)
ac3Settings_dynamicRangeCompressionLine :: Lens' Ac3Settings (Maybe Ac3DynamicRangeCompressionLine)
ac3Settings_dynamicRangeCompressionLine = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ac3Settings' {Maybe Ac3DynamicRangeCompressionLine
dynamicRangeCompressionLine :: Maybe Ac3DynamicRangeCompressionLine
$sel:dynamicRangeCompressionLine:Ac3Settings' :: Ac3Settings -> Maybe Ac3DynamicRangeCompressionLine
dynamicRangeCompressionLine} -> Maybe Ac3DynamicRangeCompressionLine
dynamicRangeCompressionLine) (\s :: Ac3Settings
s@Ac3Settings' {} Maybe Ac3DynamicRangeCompressionLine
a -> Ac3Settings
s {$sel:dynamicRangeCompressionLine:Ac3Settings' :: Maybe Ac3DynamicRangeCompressionLine
dynamicRangeCompressionLine = Maybe Ac3DynamicRangeCompressionLine
a} :: Ac3Settings)

-- | When you want to add Dolby dynamic range compression (DRC) signaling to
-- your output stream, we recommend that you use the mode-specific settings
-- instead of Dynamic range compression profile
-- (DynamicRangeCompressionProfile). The mode-specific settings are Dynamic
-- range compression profile, line mode (dynamicRangeCompressionLine) and
-- Dynamic range compression profile, RF mode (dynamicRangeCompressionRf).
-- Note that when you specify values for all three settings, MediaConvert
-- ignores the value of this setting in favor of the mode-specific
-- settings. If you do use this setting instead of the mode-specific
-- settings, choose None (NONE) to leave out DRC signaling. Keep the
-- default Film standard (FILM_STANDARD) to set the profile to Dolby\'s
-- film standard profile for all operating modes.
ac3Settings_dynamicRangeCompressionProfile :: Lens.Lens' Ac3Settings (Prelude.Maybe Ac3DynamicRangeCompressionProfile)
ac3Settings_dynamicRangeCompressionProfile :: Lens' Ac3Settings (Maybe Ac3DynamicRangeCompressionProfile)
ac3Settings_dynamicRangeCompressionProfile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ac3Settings' {Maybe Ac3DynamicRangeCompressionProfile
dynamicRangeCompressionProfile :: Maybe Ac3DynamicRangeCompressionProfile
$sel:dynamicRangeCompressionProfile:Ac3Settings' :: Ac3Settings -> Maybe Ac3DynamicRangeCompressionProfile
dynamicRangeCompressionProfile} -> Maybe Ac3DynamicRangeCompressionProfile
dynamicRangeCompressionProfile) (\s :: Ac3Settings
s@Ac3Settings' {} Maybe Ac3DynamicRangeCompressionProfile
a -> Ac3Settings
s {$sel:dynamicRangeCompressionProfile:Ac3Settings' :: Maybe Ac3DynamicRangeCompressionProfile
dynamicRangeCompressionProfile = Maybe Ac3DynamicRangeCompressionProfile
a} :: Ac3Settings)

-- | Choose the Dolby Digital dynamic range control (DRC) profile that
-- MediaConvert uses when encoding the metadata in the Dolby Digital stream
-- for the RF operating mode. Related setting: When you use this setting,
-- MediaConvert ignores any value you provide for Dynamic range compression
-- profile (DynamicRangeCompressionProfile). For information about the
-- Dolby Digital DRC operating modes and profiles, see the Dynamic Range
-- Control chapter of the Dolby Metadata Guide at
-- https:\/\/developer.dolby.com\/globalassets\/professional\/documents\/dolby-metadata-guide.pdf.
ac3Settings_dynamicRangeCompressionRf :: Lens.Lens' Ac3Settings (Prelude.Maybe Ac3DynamicRangeCompressionRf)
ac3Settings_dynamicRangeCompressionRf :: Lens' Ac3Settings (Maybe Ac3DynamicRangeCompressionRf)
ac3Settings_dynamicRangeCompressionRf = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ac3Settings' {Maybe Ac3DynamicRangeCompressionRf
dynamicRangeCompressionRf :: Maybe Ac3DynamicRangeCompressionRf
$sel:dynamicRangeCompressionRf:Ac3Settings' :: Ac3Settings -> Maybe Ac3DynamicRangeCompressionRf
dynamicRangeCompressionRf} -> Maybe Ac3DynamicRangeCompressionRf
dynamicRangeCompressionRf) (\s :: Ac3Settings
s@Ac3Settings' {} Maybe Ac3DynamicRangeCompressionRf
a -> Ac3Settings
s {$sel:dynamicRangeCompressionRf:Ac3Settings' :: Maybe Ac3DynamicRangeCompressionRf
dynamicRangeCompressionRf = Maybe Ac3DynamicRangeCompressionRf
a} :: Ac3Settings)

-- | Applies a 120Hz lowpass filter to the LFE channel prior to encoding.
-- Only valid with 3_2_LFE coding mode.
ac3Settings_lfeFilter :: Lens.Lens' Ac3Settings (Prelude.Maybe Ac3LfeFilter)
ac3Settings_lfeFilter :: Lens' Ac3Settings (Maybe Ac3LfeFilter)
ac3Settings_lfeFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ac3Settings' {Maybe Ac3LfeFilter
lfeFilter :: Maybe Ac3LfeFilter
$sel:lfeFilter:Ac3Settings' :: Ac3Settings -> Maybe Ac3LfeFilter
lfeFilter} -> Maybe Ac3LfeFilter
lfeFilter) (\s :: Ac3Settings
s@Ac3Settings' {} Maybe Ac3LfeFilter
a -> Ac3Settings
s {$sel:lfeFilter:Ac3Settings' :: Maybe Ac3LfeFilter
lfeFilter = Maybe Ac3LfeFilter
a} :: Ac3Settings)

-- | When set to FOLLOW_INPUT, encoder metadata will be sourced from the DD,
-- DD+, or DolbyE decoder that supplied this audio data. If audio was not
-- supplied from one of these streams, then the static metadata settings
-- will be used.
ac3Settings_metadataControl :: Lens.Lens' Ac3Settings (Prelude.Maybe Ac3MetadataControl)
ac3Settings_metadataControl :: Lens' Ac3Settings (Maybe Ac3MetadataControl)
ac3Settings_metadataControl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ac3Settings' {Maybe Ac3MetadataControl
metadataControl :: Maybe Ac3MetadataControl
$sel:metadataControl:Ac3Settings' :: Ac3Settings -> Maybe Ac3MetadataControl
metadataControl} -> Maybe Ac3MetadataControl
metadataControl) (\s :: Ac3Settings
s@Ac3Settings' {} Maybe Ac3MetadataControl
a -> Ac3Settings
s {$sel:metadataControl:Ac3Settings' :: Maybe Ac3MetadataControl
metadataControl = Maybe Ac3MetadataControl
a} :: Ac3Settings)

-- | This value is always 48000. It represents the sample rate in Hz.
ac3Settings_sampleRate :: Lens.Lens' Ac3Settings (Prelude.Maybe Prelude.Natural)
ac3Settings_sampleRate :: Lens' Ac3Settings (Maybe Natural)
ac3Settings_sampleRate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ac3Settings' {Maybe Natural
sampleRate :: Maybe Natural
$sel:sampleRate:Ac3Settings' :: Ac3Settings -> Maybe Natural
sampleRate} -> Maybe Natural
sampleRate) (\s :: Ac3Settings
s@Ac3Settings' {} Maybe Natural
a -> Ac3Settings
s {$sel:sampleRate:Ac3Settings' :: Maybe Natural
sampleRate = Maybe Natural
a} :: Ac3Settings)

instance Data.FromJSON Ac3Settings where
  parseJSON :: Value -> Parser Ac3Settings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Ac3Settings"
      ( \Object
x ->
          Maybe Natural
-> Maybe Ac3BitstreamMode
-> Maybe Ac3CodingMode
-> Maybe Natural
-> Maybe Ac3DynamicRangeCompressionLine
-> Maybe Ac3DynamicRangeCompressionProfile
-> Maybe Ac3DynamicRangeCompressionRf
-> Maybe Ac3LfeFilter
-> Maybe Ac3MetadataControl
-> Maybe Natural
-> Ac3Settings
Ac3Settings'
            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
"bitrate")
            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
"bitstreamMode")
            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
"codingMode")
            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
"dialnorm")
            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
"dynamicRangeCompressionLine")
            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
"dynamicRangeCompressionProfile")
            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
"dynamicRangeCompressionRf")
            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
"lfeFilter")
            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
"metadataControl")
            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
"sampleRate")
      )

instance Prelude.Hashable Ac3Settings where
  hashWithSalt :: Int -> Ac3Settings -> Int
hashWithSalt Int
_salt Ac3Settings' {Maybe Natural
Maybe Ac3BitstreamMode
Maybe Ac3CodingMode
Maybe Ac3DynamicRangeCompressionLine
Maybe Ac3DynamicRangeCompressionProfile
Maybe Ac3DynamicRangeCompressionRf
Maybe Ac3LfeFilter
Maybe Ac3MetadataControl
sampleRate :: Maybe Natural
metadataControl :: Maybe Ac3MetadataControl
lfeFilter :: Maybe Ac3LfeFilter
dynamicRangeCompressionRf :: Maybe Ac3DynamicRangeCompressionRf
dynamicRangeCompressionProfile :: Maybe Ac3DynamicRangeCompressionProfile
dynamicRangeCompressionLine :: Maybe Ac3DynamicRangeCompressionLine
dialnorm :: Maybe Natural
codingMode :: Maybe Ac3CodingMode
bitstreamMode :: Maybe Ac3BitstreamMode
bitrate :: Maybe Natural
$sel:sampleRate:Ac3Settings' :: Ac3Settings -> Maybe Natural
$sel:metadataControl:Ac3Settings' :: Ac3Settings -> Maybe Ac3MetadataControl
$sel:lfeFilter:Ac3Settings' :: Ac3Settings -> Maybe Ac3LfeFilter
$sel:dynamicRangeCompressionRf:Ac3Settings' :: Ac3Settings -> Maybe Ac3DynamicRangeCompressionRf
$sel:dynamicRangeCompressionProfile:Ac3Settings' :: Ac3Settings -> Maybe Ac3DynamicRangeCompressionProfile
$sel:dynamicRangeCompressionLine:Ac3Settings' :: Ac3Settings -> Maybe Ac3DynamicRangeCompressionLine
$sel:dialnorm:Ac3Settings' :: Ac3Settings -> Maybe Natural
$sel:codingMode:Ac3Settings' :: Ac3Settings -> Maybe Ac3CodingMode
$sel:bitstreamMode:Ac3Settings' :: Ac3Settings -> Maybe Ac3BitstreamMode
$sel:bitrate:Ac3Settings' :: Ac3Settings -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
bitrate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Ac3BitstreamMode
bitstreamMode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Ac3CodingMode
codingMode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
dialnorm
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Ac3DynamicRangeCompressionLine
dynamicRangeCompressionLine
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Ac3DynamicRangeCompressionProfile
dynamicRangeCompressionProfile
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Ac3DynamicRangeCompressionRf
dynamicRangeCompressionRf
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Ac3LfeFilter
lfeFilter
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Ac3MetadataControl
metadataControl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
sampleRate

instance Prelude.NFData Ac3Settings where
  rnf :: Ac3Settings -> ()
rnf Ac3Settings' {Maybe Natural
Maybe Ac3BitstreamMode
Maybe Ac3CodingMode
Maybe Ac3DynamicRangeCompressionLine
Maybe Ac3DynamicRangeCompressionProfile
Maybe Ac3DynamicRangeCompressionRf
Maybe Ac3LfeFilter
Maybe Ac3MetadataControl
sampleRate :: Maybe Natural
metadataControl :: Maybe Ac3MetadataControl
lfeFilter :: Maybe Ac3LfeFilter
dynamicRangeCompressionRf :: Maybe Ac3DynamicRangeCompressionRf
dynamicRangeCompressionProfile :: Maybe Ac3DynamicRangeCompressionProfile
dynamicRangeCompressionLine :: Maybe Ac3DynamicRangeCompressionLine
dialnorm :: Maybe Natural
codingMode :: Maybe Ac3CodingMode
bitstreamMode :: Maybe Ac3BitstreamMode
bitrate :: Maybe Natural
$sel:sampleRate:Ac3Settings' :: Ac3Settings -> Maybe Natural
$sel:metadataControl:Ac3Settings' :: Ac3Settings -> Maybe Ac3MetadataControl
$sel:lfeFilter:Ac3Settings' :: Ac3Settings -> Maybe Ac3LfeFilter
$sel:dynamicRangeCompressionRf:Ac3Settings' :: Ac3Settings -> Maybe Ac3DynamicRangeCompressionRf
$sel:dynamicRangeCompressionProfile:Ac3Settings' :: Ac3Settings -> Maybe Ac3DynamicRangeCompressionProfile
$sel:dynamicRangeCompressionLine:Ac3Settings' :: Ac3Settings -> Maybe Ac3DynamicRangeCompressionLine
$sel:dialnorm:Ac3Settings' :: Ac3Settings -> Maybe Natural
$sel:codingMode:Ac3Settings' :: Ac3Settings -> Maybe Ac3CodingMode
$sel:bitstreamMode:Ac3Settings' :: Ac3Settings -> Maybe Ac3BitstreamMode
$sel:bitrate:Ac3Settings' :: Ac3Settings -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
bitrate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Ac3BitstreamMode
bitstreamMode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Ac3CodingMode
codingMode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
dialnorm
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Ac3DynamicRangeCompressionLine
dynamicRangeCompressionLine
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Ac3DynamicRangeCompressionProfile
dynamicRangeCompressionProfile
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Ac3DynamicRangeCompressionRf
dynamicRangeCompressionRf
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Ac3LfeFilter
lfeFilter
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Ac3MetadataControl
metadataControl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
sampleRate

instance Data.ToJSON Ac3Settings where
  toJSON :: Ac3Settings -> Value
toJSON Ac3Settings' {Maybe Natural
Maybe Ac3BitstreamMode
Maybe Ac3CodingMode
Maybe Ac3DynamicRangeCompressionLine
Maybe Ac3DynamicRangeCompressionProfile
Maybe Ac3DynamicRangeCompressionRf
Maybe Ac3LfeFilter
Maybe Ac3MetadataControl
sampleRate :: Maybe Natural
metadataControl :: Maybe Ac3MetadataControl
lfeFilter :: Maybe Ac3LfeFilter
dynamicRangeCompressionRf :: Maybe Ac3DynamicRangeCompressionRf
dynamicRangeCompressionProfile :: Maybe Ac3DynamicRangeCompressionProfile
dynamicRangeCompressionLine :: Maybe Ac3DynamicRangeCompressionLine
dialnorm :: Maybe Natural
codingMode :: Maybe Ac3CodingMode
bitstreamMode :: Maybe Ac3BitstreamMode
bitrate :: Maybe Natural
$sel:sampleRate:Ac3Settings' :: Ac3Settings -> Maybe Natural
$sel:metadataControl:Ac3Settings' :: Ac3Settings -> Maybe Ac3MetadataControl
$sel:lfeFilter:Ac3Settings' :: Ac3Settings -> Maybe Ac3LfeFilter
$sel:dynamicRangeCompressionRf:Ac3Settings' :: Ac3Settings -> Maybe Ac3DynamicRangeCompressionRf
$sel:dynamicRangeCompressionProfile:Ac3Settings' :: Ac3Settings -> Maybe Ac3DynamicRangeCompressionProfile
$sel:dynamicRangeCompressionLine:Ac3Settings' :: Ac3Settings -> Maybe Ac3DynamicRangeCompressionLine
$sel:dialnorm:Ac3Settings' :: Ac3Settings -> Maybe Natural
$sel:codingMode:Ac3Settings' :: Ac3Settings -> Maybe Ac3CodingMode
$sel:bitstreamMode:Ac3Settings' :: Ac3Settings -> Maybe Ac3BitstreamMode
$sel:bitrate:Ac3Settings' :: Ac3Settings -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"bitrate" 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 Natural
bitrate,
            (Key
"bitstreamMode" 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 Ac3BitstreamMode
bitstreamMode,
            (Key
"codingMode" 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 Ac3CodingMode
codingMode,
            (Key
"dialnorm" 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 Natural
dialnorm,
            (Key
"dynamicRangeCompressionLine" 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 Ac3DynamicRangeCompressionLine
dynamicRangeCompressionLine,
            (Key
"dynamicRangeCompressionProfile" 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 Ac3DynamicRangeCompressionProfile
dynamicRangeCompressionProfile,
            (Key
"dynamicRangeCompressionRf" 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 Ac3DynamicRangeCompressionRf
dynamicRangeCompressionRf,
            (Key
"lfeFilter" 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 Ac3LfeFilter
lfeFilter,
            (Key
"metadataControl" 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 Ac3MetadataControl
metadataControl,
            (Key
"sampleRate" 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 Natural
sampleRate
          ]
      )