{-# 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 #-}
module Amazonka.MediaLive.Types.AudioNormalizationSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.AudioNormalizationAlgorithm
import Amazonka.MediaLive.Types.AudioNormalizationAlgorithmControl
import qualified Amazonka.Prelude as Prelude
data AudioNormalizationSettings = AudioNormalizationSettings'
{
AudioNormalizationSettings
-> Maybe AudioNormalizationAlgorithmControl
algorithmControl :: Prelude.Maybe AudioNormalizationAlgorithmControl,
AudioNormalizationSettings -> Maybe Double
targetLkfs :: Prelude.Maybe Prelude.Double,
AudioNormalizationSettings -> Maybe AudioNormalizationAlgorithm
algorithm :: Prelude.Maybe AudioNormalizationAlgorithm
}
deriving (AudioNormalizationSettings -> AudioNormalizationSettings -> Bool
(AudioNormalizationSettings -> AudioNormalizationSettings -> Bool)
-> (AudioNormalizationSettings
-> AudioNormalizationSettings -> Bool)
-> Eq AudioNormalizationSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AudioNormalizationSettings -> AudioNormalizationSettings -> Bool
$c/= :: AudioNormalizationSettings -> AudioNormalizationSettings -> Bool
== :: AudioNormalizationSettings -> AudioNormalizationSettings -> Bool
$c== :: AudioNormalizationSettings -> AudioNormalizationSettings -> Bool
Prelude.Eq, ReadPrec [AudioNormalizationSettings]
ReadPrec AudioNormalizationSettings
Int -> ReadS AudioNormalizationSettings
ReadS [AudioNormalizationSettings]
(Int -> ReadS AudioNormalizationSettings)
-> ReadS [AudioNormalizationSettings]
-> ReadPrec AudioNormalizationSettings
-> ReadPrec [AudioNormalizationSettings]
-> Read AudioNormalizationSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AudioNormalizationSettings]
$creadListPrec :: ReadPrec [AudioNormalizationSettings]
readPrec :: ReadPrec AudioNormalizationSettings
$creadPrec :: ReadPrec AudioNormalizationSettings
readList :: ReadS [AudioNormalizationSettings]
$creadList :: ReadS [AudioNormalizationSettings]
readsPrec :: Int -> ReadS AudioNormalizationSettings
$creadsPrec :: Int -> ReadS AudioNormalizationSettings
Prelude.Read, Int -> AudioNormalizationSettings -> ShowS
[AudioNormalizationSettings] -> ShowS
AudioNormalizationSettings -> String
(Int -> AudioNormalizationSettings -> ShowS)
-> (AudioNormalizationSettings -> String)
-> ([AudioNormalizationSettings] -> ShowS)
-> Show AudioNormalizationSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AudioNormalizationSettings] -> ShowS
$cshowList :: [AudioNormalizationSettings] -> ShowS
show :: AudioNormalizationSettings -> String
$cshow :: AudioNormalizationSettings -> String
showsPrec :: Int -> AudioNormalizationSettings -> ShowS
$cshowsPrec :: Int -> AudioNormalizationSettings -> ShowS
Prelude.Show, (forall x.
AudioNormalizationSettings -> Rep AudioNormalizationSettings x)
-> (forall x.
Rep AudioNormalizationSettings x -> AudioNormalizationSettings)
-> Generic AudioNormalizationSettings
forall x.
Rep AudioNormalizationSettings x -> AudioNormalizationSettings
forall x.
AudioNormalizationSettings -> Rep AudioNormalizationSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AudioNormalizationSettings x -> AudioNormalizationSettings
$cfrom :: forall x.
AudioNormalizationSettings -> Rep AudioNormalizationSettings x
Prelude.Generic)
newAudioNormalizationSettings ::
AudioNormalizationSettings
newAudioNormalizationSettings :: AudioNormalizationSettings
newAudioNormalizationSettings =
AudioNormalizationSettings' :: Maybe AudioNormalizationAlgorithmControl
-> Maybe Double
-> Maybe AudioNormalizationAlgorithm
-> AudioNormalizationSettings
AudioNormalizationSettings'
{ $sel:algorithmControl:AudioNormalizationSettings' :: Maybe AudioNormalizationAlgorithmControl
algorithmControl =
Maybe AudioNormalizationAlgorithmControl
forall a. Maybe a
Prelude.Nothing,
$sel:targetLkfs:AudioNormalizationSettings' :: Maybe Double
targetLkfs = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:algorithm:AudioNormalizationSettings' :: Maybe AudioNormalizationAlgorithm
algorithm = Maybe AudioNormalizationAlgorithm
forall a. Maybe a
Prelude.Nothing
}
audioNormalizationSettings_algorithmControl :: Lens.Lens' AudioNormalizationSettings (Prelude.Maybe AudioNormalizationAlgorithmControl)
audioNormalizationSettings_algorithmControl :: (Maybe AudioNormalizationAlgorithmControl
-> f (Maybe AudioNormalizationAlgorithmControl))
-> AudioNormalizationSettings -> f AudioNormalizationSettings
audioNormalizationSettings_algorithmControl = (AudioNormalizationSettings
-> Maybe AudioNormalizationAlgorithmControl)
-> (AudioNormalizationSettings
-> Maybe AudioNormalizationAlgorithmControl
-> AudioNormalizationSettings)
-> Lens
AudioNormalizationSettings
AudioNormalizationSettings
(Maybe AudioNormalizationAlgorithmControl)
(Maybe AudioNormalizationAlgorithmControl)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioNormalizationSettings' {Maybe AudioNormalizationAlgorithmControl
algorithmControl :: Maybe AudioNormalizationAlgorithmControl
$sel:algorithmControl:AudioNormalizationSettings' :: AudioNormalizationSettings
-> Maybe AudioNormalizationAlgorithmControl
algorithmControl} -> Maybe AudioNormalizationAlgorithmControl
algorithmControl) (\s :: AudioNormalizationSettings
s@AudioNormalizationSettings' {} Maybe AudioNormalizationAlgorithmControl
a -> AudioNormalizationSettings
s {$sel:algorithmControl:AudioNormalizationSettings' :: Maybe AudioNormalizationAlgorithmControl
algorithmControl = Maybe AudioNormalizationAlgorithmControl
a} :: AudioNormalizationSettings)
audioNormalizationSettings_targetLkfs :: Lens.Lens' AudioNormalizationSettings (Prelude.Maybe Prelude.Double)
audioNormalizationSettings_targetLkfs :: (Maybe Double -> f (Maybe Double))
-> AudioNormalizationSettings -> f AudioNormalizationSettings
audioNormalizationSettings_targetLkfs = (AudioNormalizationSettings -> Maybe Double)
-> (AudioNormalizationSettings
-> Maybe Double -> AudioNormalizationSettings)
-> Lens
AudioNormalizationSettings
AudioNormalizationSettings
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioNormalizationSettings' {Maybe Double
targetLkfs :: Maybe Double
$sel:targetLkfs:AudioNormalizationSettings' :: AudioNormalizationSettings -> Maybe Double
targetLkfs} -> Maybe Double
targetLkfs) (\s :: AudioNormalizationSettings
s@AudioNormalizationSettings' {} Maybe Double
a -> AudioNormalizationSettings
s {$sel:targetLkfs:AudioNormalizationSettings' :: Maybe Double
targetLkfs = Maybe Double
a} :: AudioNormalizationSettings)
audioNormalizationSettings_algorithm :: Lens.Lens' AudioNormalizationSettings (Prelude.Maybe AudioNormalizationAlgorithm)
audioNormalizationSettings_algorithm :: (Maybe AudioNormalizationAlgorithm
-> f (Maybe AudioNormalizationAlgorithm))
-> AudioNormalizationSettings -> f AudioNormalizationSettings
audioNormalizationSettings_algorithm = (AudioNormalizationSettings -> Maybe AudioNormalizationAlgorithm)
-> (AudioNormalizationSettings
-> Maybe AudioNormalizationAlgorithm -> AudioNormalizationSettings)
-> Lens
AudioNormalizationSettings
AudioNormalizationSettings
(Maybe AudioNormalizationAlgorithm)
(Maybe AudioNormalizationAlgorithm)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioNormalizationSettings' {Maybe AudioNormalizationAlgorithm
algorithm :: Maybe AudioNormalizationAlgorithm
$sel:algorithm:AudioNormalizationSettings' :: AudioNormalizationSettings -> Maybe AudioNormalizationAlgorithm
algorithm} -> Maybe AudioNormalizationAlgorithm
algorithm) (\s :: AudioNormalizationSettings
s@AudioNormalizationSettings' {} Maybe AudioNormalizationAlgorithm
a -> AudioNormalizationSettings
s {$sel:algorithm:AudioNormalizationSettings' :: Maybe AudioNormalizationAlgorithm
algorithm = Maybe AudioNormalizationAlgorithm
a} :: AudioNormalizationSettings)
instance Core.FromJSON AudioNormalizationSettings where
parseJSON :: Value -> Parser AudioNormalizationSettings
parseJSON =
String
-> (Object -> Parser AudioNormalizationSettings)
-> Value
-> Parser AudioNormalizationSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AudioNormalizationSettings"
( \Object
x ->
Maybe AudioNormalizationAlgorithmControl
-> Maybe Double
-> Maybe AudioNormalizationAlgorithm
-> AudioNormalizationSettings
AudioNormalizationSettings'
(Maybe AudioNormalizationAlgorithmControl
-> Maybe Double
-> Maybe AudioNormalizationAlgorithm
-> AudioNormalizationSettings)
-> Parser (Maybe AudioNormalizationAlgorithmControl)
-> Parser
(Maybe Double
-> Maybe AudioNormalizationAlgorithm -> AudioNormalizationSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AudioNormalizationAlgorithmControl)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"algorithmControl")
Parser
(Maybe Double
-> Maybe AudioNormalizationAlgorithm -> AudioNormalizationSettings)
-> Parser (Maybe Double)
-> Parser
(Maybe AudioNormalizationAlgorithm -> AudioNormalizationSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"targetLkfs")
Parser
(Maybe AudioNormalizationAlgorithm -> AudioNormalizationSettings)
-> Parser (Maybe AudioNormalizationAlgorithm)
-> Parser AudioNormalizationSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioNormalizationAlgorithm)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"algorithm")
)
instance Prelude.Hashable AudioNormalizationSettings
instance Prelude.NFData AudioNormalizationSettings
instance Core.ToJSON AudioNormalizationSettings where
toJSON :: AudioNormalizationSettings -> Value
toJSON AudioNormalizationSettings' {Maybe Double
Maybe AudioNormalizationAlgorithm
Maybe AudioNormalizationAlgorithmControl
algorithm :: Maybe AudioNormalizationAlgorithm
targetLkfs :: Maybe Double
algorithmControl :: Maybe AudioNormalizationAlgorithmControl
$sel:algorithm:AudioNormalizationSettings' :: AudioNormalizationSettings -> Maybe AudioNormalizationAlgorithm
$sel:targetLkfs:AudioNormalizationSettings' :: AudioNormalizationSettings -> Maybe Double
$sel:algorithmControl:AudioNormalizationSettings' :: AudioNormalizationSettings
-> Maybe AudioNormalizationAlgorithmControl
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"algorithmControl" Text -> AudioNormalizationAlgorithmControl -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(AudioNormalizationAlgorithmControl -> Pair)
-> Maybe AudioNormalizationAlgorithmControl -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioNormalizationAlgorithmControl
algorithmControl,
(Text
"targetLkfs" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
targetLkfs,
(Text
"algorithm" Text -> AudioNormalizationAlgorithm -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AudioNormalizationAlgorithm -> Pair)
-> Maybe AudioNormalizationAlgorithm -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioNormalizationAlgorithm
algorithm
]
)