{-# 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-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.Ac3Settings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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'
  { -- | 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,
    -- | 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 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,
    -- | 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,
    -- | 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,
    -- | Dolby Digital coding mode. Determines number of channels.
    Ac3Settings -> Maybe Ac3CodingMode
codingMode :: Prelude.Maybe Ac3CodingMode,
    -- | This value is always 48000. It represents the sample rate in Hz.
    Ac3Settings -> Maybe Natural
sampleRate :: Prelude.Maybe Prelude.Natural,
    -- | 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,
    -- | Specify the average bitrate in bits per second. Valid bitrates depend on
    -- the coding mode.
    Ac3Settings -> Maybe Natural
bitrate :: Prelude.Maybe Prelude.Natural,
    -- | 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
  }
  deriving (Ac3Settings -> Ac3Settings -> Bool
(Ac3Settings -> Ac3Settings -> Bool)
-> (Ac3Settings -> Ac3Settings -> Bool) -> Eq Ac3Settings
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]
(Int -> ReadS Ac3Settings)
-> ReadS [Ac3Settings]
-> ReadPrec Ac3Settings
-> ReadPrec [Ac3Settings]
-> Read 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
(Int -> Ac3Settings -> ShowS)
-> (Ac3Settings -> String)
-> ([Ac3Settings] -> ShowS)
-> Show Ac3Settings
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. Ac3Settings -> Rep Ac3Settings x)
-> (forall x. Rep Ac3Settings x -> Ac3Settings)
-> Generic Ac3Settings
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:
--
-- 'lfeFilter', 'ac3Settings_lfeFilter' - Applies a 120Hz lowpass filter to the LFE channel prior to encoding.
-- Only valid with 3_2_LFE coding mode.
--
-- '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.
--
-- '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.
--
-- '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).
--
-- '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.
--
-- 'codingMode', 'ac3Settings_codingMode' - Dolby Digital coding mode. Determines number of channels.
--
-- 'sampleRate', 'ac3Settings_sampleRate' - This value is always 48000. It represents the sample rate in Hz.
--
-- '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.
--
-- 'bitrate', 'ac3Settings_bitrate' - Specify the average bitrate in bits per second. Valid bitrates depend on
-- the coding mode.
--
-- 'dialnorm', 'ac3Settings_dialnorm' - Sets the dialnorm for the output. If blank and input audio is Dolby
-- Digital, dialnorm will be passed through.
newAc3Settings ::
  Ac3Settings
newAc3Settings :: Ac3Settings
newAc3Settings =
  Ac3Settings' :: Maybe Ac3LfeFilter
-> Maybe Ac3DynamicRangeCompressionLine
-> Maybe Ac3MetadataControl
-> Maybe Ac3BitstreamMode
-> Maybe Ac3DynamicRangeCompressionRf
-> Maybe Ac3CodingMode
-> Maybe Natural
-> Maybe Ac3DynamicRangeCompressionProfile
-> Maybe Natural
-> Maybe Natural
-> Ac3Settings
Ac3Settings'
    { $sel:lfeFilter:Ac3Settings' :: Maybe Ac3LfeFilter
lfeFilter = Maybe Ac3LfeFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:dynamicRangeCompressionLine:Ac3Settings' :: Maybe Ac3DynamicRangeCompressionLine
dynamicRangeCompressionLine = Maybe Ac3DynamicRangeCompressionLine
forall a. Maybe a
Prelude.Nothing,
      $sel:metadataControl:Ac3Settings' :: Maybe Ac3MetadataControl
metadataControl = Maybe Ac3MetadataControl
forall a. Maybe a
Prelude.Nothing,
      $sel:bitstreamMode:Ac3Settings' :: Maybe Ac3BitstreamMode
bitstreamMode = Maybe Ac3BitstreamMode
forall a. Maybe a
Prelude.Nothing,
      $sel:dynamicRangeCompressionRf:Ac3Settings' :: Maybe Ac3DynamicRangeCompressionRf
dynamicRangeCompressionRf = Maybe Ac3DynamicRangeCompressionRf
forall a. Maybe a
Prelude.Nothing,
      $sel:codingMode:Ac3Settings' :: Maybe Ac3CodingMode
codingMode = Maybe Ac3CodingMode
forall a. Maybe a
Prelude.Nothing,
      $sel:sampleRate:Ac3Settings' :: Maybe Natural
sampleRate = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:dynamicRangeCompressionProfile:Ac3Settings' :: Maybe Ac3DynamicRangeCompressionProfile
dynamicRangeCompressionProfile = Maybe Ac3DynamicRangeCompressionProfile
forall a. Maybe a
Prelude.Nothing,
      $sel:bitrate:Ac3Settings' :: Maybe Natural
bitrate = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:dialnorm:Ac3Settings' :: Maybe Natural
dialnorm = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe Ac3LfeFilter -> f (Maybe Ac3LfeFilter))
-> Ac3Settings -> f Ac3Settings
ac3Settings_lfeFilter = (Ac3Settings -> Maybe Ac3LfeFilter)
-> (Ac3Settings -> Maybe Ac3LfeFilter -> Ac3Settings)
-> Lens
     Ac3Settings Ac3Settings (Maybe Ac3LfeFilter) (Maybe Ac3LfeFilter)
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)

-- | 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 :: (Maybe Ac3DynamicRangeCompressionLine
 -> f (Maybe Ac3DynamicRangeCompressionLine))
-> Ac3Settings -> f Ac3Settings
ac3Settings_dynamicRangeCompressionLine = (Ac3Settings -> Maybe Ac3DynamicRangeCompressionLine)
-> (Ac3Settings
    -> Maybe Ac3DynamicRangeCompressionLine -> Ac3Settings)
-> Lens
     Ac3Settings
     Ac3Settings
     (Maybe Ac3DynamicRangeCompressionLine)
     (Maybe Ac3DynamicRangeCompressionLine)
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 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 :: (Maybe Ac3MetadataControl -> f (Maybe Ac3MetadataControl))
-> Ac3Settings -> f Ac3Settings
ac3Settings_metadataControl = (Ac3Settings -> Maybe Ac3MetadataControl)
-> (Ac3Settings -> Maybe Ac3MetadataControl -> Ac3Settings)
-> Lens
     Ac3Settings
     Ac3Settings
     (Maybe Ac3MetadataControl)
     (Maybe Ac3MetadataControl)
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)

-- | 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 :: (Maybe Ac3BitstreamMode -> f (Maybe Ac3BitstreamMode))
-> Ac3Settings -> f Ac3Settings
ac3Settings_bitstreamMode = (Ac3Settings -> Maybe Ac3BitstreamMode)
-> (Ac3Settings -> Maybe Ac3BitstreamMode -> Ac3Settings)
-> Lens
     Ac3Settings
     Ac3Settings
     (Maybe Ac3BitstreamMode)
     (Maybe Ac3BitstreamMode)
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)

-- | 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 :: (Maybe Ac3DynamicRangeCompressionRf
 -> f (Maybe Ac3DynamicRangeCompressionRf))
-> Ac3Settings -> f Ac3Settings
ac3Settings_dynamicRangeCompressionRf = (Ac3Settings -> Maybe Ac3DynamicRangeCompressionRf)
-> (Ac3Settings
    -> Maybe Ac3DynamicRangeCompressionRf -> Ac3Settings)
-> Lens
     Ac3Settings
     Ac3Settings
     (Maybe Ac3DynamicRangeCompressionRf)
     (Maybe Ac3DynamicRangeCompressionRf)
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)

-- | Dolby Digital coding mode. Determines number of channels.
ac3Settings_codingMode :: Lens.Lens' Ac3Settings (Prelude.Maybe Ac3CodingMode)
ac3Settings_codingMode :: (Maybe Ac3CodingMode -> f (Maybe Ac3CodingMode))
-> Ac3Settings -> f Ac3Settings
ac3Settings_codingMode = (Ac3Settings -> Maybe Ac3CodingMode)
-> (Ac3Settings -> Maybe Ac3CodingMode -> Ac3Settings)
-> Lens
     Ac3Settings Ac3Settings (Maybe Ac3CodingMode) (Maybe Ac3CodingMode)
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)

-- | This value is always 48000. It represents the sample rate in Hz.
ac3Settings_sampleRate :: Lens.Lens' Ac3Settings (Prelude.Maybe Prelude.Natural)
ac3Settings_sampleRate :: (Maybe Natural -> f (Maybe Natural))
-> Ac3Settings -> f Ac3Settings
ac3Settings_sampleRate = (Ac3Settings -> Maybe Natural)
-> (Ac3Settings -> Maybe Natural -> Ac3Settings)
-> Lens Ac3Settings Ac3Settings (Maybe Natural) (Maybe Natural)
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)

-- | 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 :: (Maybe Ac3DynamicRangeCompressionProfile
 -> f (Maybe Ac3DynamicRangeCompressionProfile))
-> Ac3Settings -> f Ac3Settings
ac3Settings_dynamicRangeCompressionProfile = (Ac3Settings -> Maybe Ac3DynamicRangeCompressionProfile)
-> (Ac3Settings
    -> Maybe Ac3DynamicRangeCompressionProfile -> Ac3Settings)
-> Lens
     Ac3Settings
     Ac3Settings
     (Maybe Ac3DynamicRangeCompressionProfile)
     (Maybe Ac3DynamicRangeCompressionProfile)
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)

-- | Specify the average bitrate in bits per second. Valid bitrates depend on
-- the coding mode.
ac3Settings_bitrate :: Lens.Lens' Ac3Settings (Prelude.Maybe Prelude.Natural)
ac3Settings_bitrate :: (Maybe Natural -> f (Maybe Natural))
-> Ac3Settings -> f Ac3Settings
ac3Settings_bitrate = (Ac3Settings -> Maybe Natural)
-> (Ac3Settings -> Maybe Natural -> Ac3Settings)
-> Lens Ac3Settings Ac3Settings (Maybe Natural) (Maybe Natural)
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)

-- | 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 :: (Maybe Natural -> f (Maybe Natural))
-> Ac3Settings -> f Ac3Settings
ac3Settings_dialnorm = (Ac3Settings -> Maybe Natural)
-> (Ac3Settings -> Maybe Natural -> Ac3Settings)
-> Lens Ac3Settings Ac3Settings (Maybe Natural) (Maybe Natural)
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)

instance Core.FromJSON Ac3Settings where
  parseJSON :: Value -> Parser Ac3Settings
parseJSON =
    String
-> (Object -> Parser Ac3Settings) -> Value -> Parser Ac3Settings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Ac3Settings"
      ( \Object
x ->
          Maybe Ac3LfeFilter
-> Maybe Ac3DynamicRangeCompressionLine
-> Maybe Ac3MetadataControl
-> Maybe Ac3BitstreamMode
-> Maybe Ac3DynamicRangeCompressionRf
-> Maybe Ac3CodingMode
-> Maybe Natural
-> Maybe Ac3DynamicRangeCompressionProfile
-> Maybe Natural
-> Maybe Natural
-> Ac3Settings
Ac3Settings'
            (Maybe Ac3LfeFilter
 -> Maybe Ac3DynamicRangeCompressionLine
 -> Maybe Ac3MetadataControl
 -> Maybe Ac3BitstreamMode
 -> Maybe Ac3DynamicRangeCompressionRf
 -> Maybe Ac3CodingMode
 -> Maybe Natural
 -> Maybe Ac3DynamicRangeCompressionProfile
 -> Maybe Natural
 -> Maybe Natural
 -> Ac3Settings)
-> Parser (Maybe Ac3LfeFilter)
-> Parser
     (Maybe Ac3DynamicRangeCompressionLine
      -> Maybe Ac3MetadataControl
      -> Maybe Ac3BitstreamMode
      -> Maybe Ac3DynamicRangeCompressionRf
      -> Maybe Ac3CodingMode
      -> Maybe Natural
      -> Maybe Ac3DynamicRangeCompressionProfile
      -> Maybe Natural
      -> Maybe Natural
      -> Ac3Settings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Ac3LfeFilter)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lfeFilter")
            Parser
  (Maybe Ac3DynamicRangeCompressionLine
   -> Maybe Ac3MetadataControl
   -> Maybe Ac3BitstreamMode
   -> Maybe Ac3DynamicRangeCompressionRf
   -> Maybe Ac3CodingMode
   -> Maybe Natural
   -> Maybe Ac3DynamicRangeCompressionProfile
   -> Maybe Natural
   -> Maybe Natural
   -> Ac3Settings)
-> Parser (Maybe Ac3DynamicRangeCompressionLine)
-> Parser
     (Maybe Ac3MetadataControl
      -> Maybe Ac3BitstreamMode
      -> Maybe Ac3DynamicRangeCompressionRf
      -> Maybe Ac3CodingMode
      -> Maybe Natural
      -> Maybe Ac3DynamicRangeCompressionProfile
      -> Maybe Natural
      -> Maybe Natural
      -> Ac3Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Ac3DynamicRangeCompressionLine)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dynamicRangeCompressionLine")
            Parser
  (Maybe Ac3MetadataControl
   -> Maybe Ac3BitstreamMode
   -> Maybe Ac3DynamicRangeCompressionRf
   -> Maybe Ac3CodingMode
   -> Maybe Natural
   -> Maybe Ac3DynamicRangeCompressionProfile
   -> Maybe Natural
   -> Maybe Natural
   -> Ac3Settings)
-> Parser (Maybe Ac3MetadataControl)
-> Parser
     (Maybe Ac3BitstreamMode
      -> Maybe Ac3DynamicRangeCompressionRf
      -> Maybe Ac3CodingMode
      -> Maybe Natural
      -> Maybe Ac3DynamicRangeCompressionProfile
      -> Maybe Natural
      -> Maybe Natural
      -> Ac3Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Ac3MetadataControl)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"metadataControl")
            Parser
  (Maybe Ac3BitstreamMode
   -> Maybe Ac3DynamicRangeCompressionRf
   -> Maybe Ac3CodingMode
   -> Maybe Natural
   -> Maybe Ac3DynamicRangeCompressionProfile
   -> Maybe Natural
   -> Maybe Natural
   -> Ac3Settings)
-> Parser (Maybe Ac3BitstreamMode)
-> Parser
     (Maybe Ac3DynamicRangeCompressionRf
      -> Maybe Ac3CodingMode
      -> Maybe Natural
      -> Maybe Ac3DynamicRangeCompressionProfile
      -> Maybe Natural
      -> Maybe Natural
      -> Ac3Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Ac3BitstreamMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bitstreamMode")
            Parser
  (Maybe Ac3DynamicRangeCompressionRf
   -> Maybe Ac3CodingMode
   -> Maybe Natural
   -> Maybe Ac3DynamicRangeCompressionProfile
   -> Maybe Natural
   -> Maybe Natural
   -> Ac3Settings)
-> Parser (Maybe Ac3DynamicRangeCompressionRf)
-> Parser
     (Maybe Ac3CodingMode
      -> Maybe Natural
      -> Maybe Ac3DynamicRangeCompressionProfile
      -> Maybe Natural
      -> Maybe Natural
      -> Ac3Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Ac3DynamicRangeCompressionRf)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dynamicRangeCompressionRf")
            Parser
  (Maybe Ac3CodingMode
   -> Maybe Natural
   -> Maybe Ac3DynamicRangeCompressionProfile
   -> Maybe Natural
   -> Maybe Natural
   -> Ac3Settings)
-> Parser (Maybe Ac3CodingMode)
-> Parser
     (Maybe Natural
      -> Maybe Ac3DynamicRangeCompressionProfile
      -> Maybe Natural
      -> Maybe Natural
      -> Ac3Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Ac3CodingMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"codingMode")
            Parser
  (Maybe Natural
   -> Maybe Ac3DynamicRangeCompressionProfile
   -> Maybe Natural
   -> Maybe Natural
   -> Ac3Settings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Ac3DynamicRangeCompressionProfile
      -> Maybe Natural -> Maybe Natural -> Ac3Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sampleRate")
            Parser
  (Maybe Ac3DynamicRangeCompressionProfile
   -> Maybe Natural -> Maybe Natural -> Ac3Settings)
-> Parser (Maybe Ac3DynamicRangeCompressionProfile)
-> Parser (Maybe Natural -> Maybe Natural -> Ac3Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Ac3DynamicRangeCompressionProfile)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dynamicRangeCompressionProfile")
            Parser (Maybe Natural -> Maybe Natural -> Ac3Settings)
-> Parser (Maybe Natural) -> Parser (Maybe Natural -> Ac3Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bitrate")
            Parser (Maybe Natural -> Ac3Settings)
-> Parser (Maybe Natural) -> Parser Ac3Settings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dialnorm")
      )

instance Prelude.Hashable Ac3Settings

instance Prelude.NFData Ac3Settings

instance Core.ToJSON Ac3Settings where
  toJSON :: Ac3Settings -> Value
toJSON Ac3Settings' {Maybe Natural
Maybe Ac3BitstreamMode
Maybe Ac3CodingMode
Maybe Ac3DynamicRangeCompressionLine
Maybe Ac3DynamicRangeCompressionProfile
Maybe Ac3DynamicRangeCompressionRf
Maybe Ac3LfeFilter
Maybe Ac3MetadataControl
dialnorm :: Maybe Natural
bitrate :: Maybe Natural
dynamicRangeCompressionProfile :: Maybe Ac3DynamicRangeCompressionProfile
sampleRate :: Maybe Natural
codingMode :: Maybe Ac3CodingMode
dynamicRangeCompressionRf :: Maybe Ac3DynamicRangeCompressionRf
bitstreamMode :: Maybe Ac3BitstreamMode
metadataControl :: Maybe Ac3MetadataControl
dynamicRangeCompressionLine :: Maybe Ac3DynamicRangeCompressionLine
lfeFilter :: Maybe Ac3LfeFilter
$sel:dialnorm:Ac3Settings' :: Ac3Settings -> Maybe Natural
$sel:bitrate:Ac3Settings' :: Ac3Settings -> Maybe Natural
$sel:dynamicRangeCompressionProfile:Ac3Settings' :: Ac3Settings -> Maybe Ac3DynamicRangeCompressionProfile
$sel:sampleRate:Ac3Settings' :: Ac3Settings -> Maybe Natural
$sel:codingMode:Ac3Settings' :: Ac3Settings -> Maybe Ac3CodingMode
$sel:dynamicRangeCompressionRf:Ac3Settings' :: Ac3Settings -> Maybe Ac3DynamicRangeCompressionRf
$sel:bitstreamMode:Ac3Settings' :: Ac3Settings -> Maybe Ac3BitstreamMode
$sel:metadataControl:Ac3Settings' :: Ac3Settings -> Maybe Ac3MetadataControl
$sel:dynamicRangeCompressionLine:Ac3Settings' :: Ac3Settings -> Maybe Ac3DynamicRangeCompressionLine
$sel:lfeFilter:Ac3Settings' :: Ac3Settings -> Maybe Ac3LfeFilter
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"lfeFilter" Text -> Ac3LfeFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Ac3LfeFilter -> Pair) -> Maybe Ac3LfeFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Ac3LfeFilter
lfeFilter,
            (Text
"dynamicRangeCompressionLine" Text -> Ac3DynamicRangeCompressionLine -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Ac3DynamicRangeCompressionLine -> Pair)
-> Maybe Ac3DynamicRangeCompressionLine -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Ac3DynamicRangeCompressionLine
dynamicRangeCompressionLine,
            (Text
"metadataControl" Text -> Ac3MetadataControl -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Ac3MetadataControl -> Pair)
-> Maybe Ac3MetadataControl -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Ac3MetadataControl
metadataControl,
            (Text
"bitstreamMode" Text -> Ac3BitstreamMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Ac3BitstreamMode -> Pair) -> Maybe Ac3BitstreamMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Ac3BitstreamMode
bitstreamMode,
            (Text
"dynamicRangeCompressionRf" Text -> Ac3DynamicRangeCompressionRf -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Ac3DynamicRangeCompressionRf -> Pair)
-> Maybe Ac3DynamicRangeCompressionRf -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Ac3DynamicRangeCompressionRf
dynamicRangeCompressionRf,
            (Text
"codingMode" Text -> Ac3CodingMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Ac3CodingMode -> Pair) -> Maybe Ac3CodingMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Ac3CodingMode
codingMode,
            (Text
"sampleRate" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
sampleRate,
            (Text
"dynamicRangeCompressionProfile" Text -> Ac3DynamicRangeCompressionProfile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Ac3DynamicRangeCompressionProfile -> Pair)
-> Maybe Ac3DynamicRangeCompressionProfile -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Ac3DynamicRangeCompressionProfile
dynamicRangeCompressionProfile,
            (Text
"bitrate" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
bitrate,
            (Text
"dialnorm" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
dialnorm
          ]
      )