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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.AudioDefaultSelection
import Amazonka.MediaConvert.Types.AudioSelectorType
import Amazonka.MediaConvert.Types.HlsRenditionGroupSettings
import Amazonka.MediaConvert.Types.LanguageCode
import Amazonka.MediaConvert.Types.RemixSettings
import qualified Amazonka.Prelude as Prelude

-- | Use Audio selectors (AudioSelectors) to specify a track or set of tracks
-- from the input that you will use in your outputs. You can use multiple
-- Audio selectors per input.
--
-- /See:/ 'newAudioSelector' smart constructor.
data AudioSelector = AudioSelector'
  { -- | Identify a track from the input audio to include in this selector by
    -- entering the track index number. To include several tracks in a single
    -- audio selector, specify multiple tracks as follows. Using the console,
    -- enter a comma-separated list. For examle, type \"1,2,3\" to include
    -- tracks 1 through 3. Specifying directly in your JSON job file, provide
    -- the track numbers in an array. For example, \"tracks\": [1,2,3].
    AudioSelector -> Maybe [Natural]
tracks :: Prelude.Maybe [Prelude.Natural],
    -- | Selects a specific language code from within an audio source, using the
    -- ISO 639-2 or ISO 639-3 three-letter language code
    AudioSelector -> Maybe Text
customLanguageCode :: Prelude.Maybe Prelude.Text,
    -- | Use this setting for input streams that contain Dolby E, to have the
    -- service extract specific program data from the track. To select multiple
    -- programs, create multiple selectors with the same Track and different
    -- Program numbers. In the console, this setting is visible when you set
    -- Selector type to Track. Choose the program number from the dropdown
    -- list. If you are sending a JSON file, provide the program ID, which is
    -- part of the audio metadata. If your input file has incorrect metadata,
    -- you can choose All channels instead of a program number to have the
    -- service ignore the program IDs and include all the programs in the
    -- track.
    AudioSelector -> Maybe Natural
programSelection :: Prelude.Maybe Prelude.Natural,
    -- | Selects a specific language code from within an audio source.
    AudioSelector -> Maybe LanguageCode
languageCode :: Prelude.Maybe LanguageCode,
    -- | Specifies a time delta in milliseconds to offset the audio from the
    -- input video.
    AudioSelector -> Maybe Int
offset :: Prelude.Maybe Prelude.Int,
    -- | Enable this setting on one audio selector to set it as the default for
    -- the job. The service uses this default for outputs where it can\'t find
    -- the specified input audio. If you don\'t set a default, those outputs
    -- have no audio.
    AudioSelector -> Maybe AudioDefaultSelection
defaultSelection :: Prelude.Maybe AudioDefaultSelection,
    -- | Selects a specific PID from within an audio source (e.g. 257 selects PID
    -- 0x101).
    AudioSelector -> Maybe [Natural]
pids :: Prelude.Maybe [Prelude.Natural],
    -- | Settings specific to audio sources in an HLS alternate rendition group.
    -- Specify the properties (renditionGroupId, renditionName or
    -- renditionLanguageCode) to identify the unique audio track among the
    -- alternative rendition groups present in the HLS manifest. If no unique
    -- track is found, or multiple tracks match the properties provided, the
    -- job fails. If no properties in hlsRenditionGroupSettings are specified,
    -- the default audio track within the video segment is chosen. If there is
    -- no audio within video segment, the alternative audio with DEFAULT=YES is
    -- chosen instead.
    AudioSelector -> Maybe HlsRenditionGroupSettings
hlsRenditionGroupSettings :: Prelude.Maybe HlsRenditionGroupSettings,
    -- | Specifies the type of the audio selector.
    AudioSelector -> Maybe AudioSelectorType
selectorType :: Prelude.Maybe AudioSelectorType,
    -- | Specifies audio data from an external file source.
    AudioSelector -> Maybe Text
externalAudioFileInput :: Prelude.Maybe Prelude.Text,
    -- | Use these settings to reorder the audio channels of one input to match
    -- those of another input. This allows you to combine the two files into a
    -- single output, one after the other.
    AudioSelector -> Maybe RemixSettings
remixSettings :: Prelude.Maybe RemixSettings
  }
  deriving (AudioSelector -> AudioSelector -> Bool
(AudioSelector -> AudioSelector -> Bool)
-> (AudioSelector -> AudioSelector -> Bool) -> Eq AudioSelector
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AudioSelector -> AudioSelector -> Bool
$c/= :: AudioSelector -> AudioSelector -> Bool
== :: AudioSelector -> AudioSelector -> Bool
$c== :: AudioSelector -> AudioSelector -> Bool
Prelude.Eq, ReadPrec [AudioSelector]
ReadPrec AudioSelector
Int -> ReadS AudioSelector
ReadS [AudioSelector]
(Int -> ReadS AudioSelector)
-> ReadS [AudioSelector]
-> ReadPrec AudioSelector
-> ReadPrec [AudioSelector]
-> Read AudioSelector
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AudioSelector]
$creadListPrec :: ReadPrec [AudioSelector]
readPrec :: ReadPrec AudioSelector
$creadPrec :: ReadPrec AudioSelector
readList :: ReadS [AudioSelector]
$creadList :: ReadS [AudioSelector]
readsPrec :: Int -> ReadS AudioSelector
$creadsPrec :: Int -> ReadS AudioSelector
Prelude.Read, Int -> AudioSelector -> ShowS
[AudioSelector] -> ShowS
AudioSelector -> String
(Int -> AudioSelector -> ShowS)
-> (AudioSelector -> String)
-> ([AudioSelector] -> ShowS)
-> Show AudioSelector
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AudioSelector] -> ShowS
$cshowList :: [AudioSelector] -> ShowS
show :: AudioSelector -> String
$cshow :: AudioSelector -> String
showsPrec :: Int -> AudioSelector -> ShowS
$cshowsPrec :: Int -> AudioSelector -> ShowS
Prelude.Show, (forall x. AudioSelector -> Rep AudioSelector x)
-> (forall x. Rep AudioSelector x -> AudioSelector)
-> Generic AudioSelector
forall x. Rep AudioSelector x -> AudioSelector
forall x. AudioSelector -> Rep AudioSelector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AudioSelector x -> AudioSelector
$cfrom :: forall x. AudioSelector -> Rep AudioSelector x
Prelude.Generic)

-- |
-- Create a value of 'AudioSelector' 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:
--
-- 'tracks', 'audioSelector_tracks' - Identify a track from the input audio to include in this selector by
-- entering the track index number. To include several tracks in a single
-- audio selector, specify multiple tracks as follows. Using the console,
-- enter a comma-separated list. For examle, type \"1,2,3\" to include
-- tracks 1 through 3. Specifying directly in your JSON job file, provide
-- the track numbers in an array. For example, \"tracks\": [1,2,3].
--
-- 'customLanguageCode', 'audioSelector_customLanguageCode' - Selects a specific language code from within an audio source, using the
-- ISO 639-2 or ISO 639-3 three-letter language code
--
-- 'programSelection', 'audioSelector_programSelection' - Use this setting for input streams that contain Dolby E, to have the
-- service extract specific program data from the track. To select multiple
-- programs, create multiple selectors with the same Track and different
-- Program numbers. In the console, this setting is visible when you set
-- Selector type to Track. Choose the program number from the dropdown
-- list. If you are sending a JSON file, provide the program ID, which is
-- part of the audio metadata. If your input file has incorrect metadata,
-- you can choose All channels instead of a program number to have the
-- service ignore the program IDs and include all the programs in the
-- track.
--
-- 'languageCode', 'audioSelector_languageCode' - Selects a specific language code from within an audio source.
--
-- 'offset', 'audioSelector_offset' - Specifies a time delta in milliseconds to offset the audio from the
-- input video.
--
-- 'defaultSelection', 'audioSelector_defaultSelection' - Enable this setting on one audio selector to set it as the default for
-- the job. The service uses this default for outputs where it can\'t find
-- the specified input audio. If you don\'t set a default, those outputs
-- have no audio.
--
-- 'pids', 'audioSelector_pids' - Selects a specific PID from within an audio source (e.g. 257 selects PID
-- 0x101).
--
-- 'hlsRenditionGroupSettings', 'audioSelector_hlsRenditionGroupSettings' - Settings specific to audio sources in an HLS alternate rendition group.
-- Specify the properties (renditionGroupId, renditionName or
-- renditionLanguageCode) to identify the unique audio track among the
-- alternative rendition groups present in the HLS manifest. If no unique
-- track is found, or multiple tracks match the properties provided, the
-- job fails. If no properties in hlsRenditionGroupSettings are specified,
-- the default audio track within the video segment is chosen. If there is
-- no audio within video segment, the alternative audio with DEFAULT=YES is
-- chosen instead.
--
-- 'selectorType', 'audioSelector_selectorType' - Specifies the type of the audio selector.
--
-- 'externalAudioFileInput', 'audioSelector_externalAudioFileInput' - Specifies audio data from an external file source.
--
-- 'remixSettings', 'audioSelector_remixSettings' - Use these settings to reorder the audio channels of one input to match
-- those of another input. This allows you to combine the two files into a
-- single output, one after the other.
newAudioSelector ::
  AudioSelector
newAudioSelector :: AudioSelector
newAudioSelector =
  AudioSelector' :: Maybe [Natural]
-> Maybe Text
-> Maybe Natural
-> Maybe LanguageCode
-> Maybe Int
-> Maybe AudioDefaultSelection
-> Maybe [Natural]
-> Maybe HlsRenditionGroupSettings
-> Maybe AudioSelectorType
-> Maybe Text
-> Maybe RemixSettings
-> AudioSelector
AudioSelector'
    { $sel:tracks:AudioSelector' :: Maybe [Natural]
tracks = Maybe [Natural]
forall a. Maybe a
Prelude.Nothing,
      $sel:customLanguageCode:AudioSelector' :: Maybe Text
customLanguageCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:programSelection:AudioSelector' :: Maybe Natural
programSelection = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:languageCode:AudioSelector' :: Maybe LanguageCode
languageCode = Maybe LanguageCode
forall a. Maybe a
Prelude.Nothing,
      $sel:offset:AudioSelector' :: Maybe Int
offset = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultSelection:AudioSelector' :: Maybe AudioDefaultSelection
defaultSelection = Maybe AudioDefaultSelection
forall a. Maybe a
Prelude.Nothing,
      $sel:pids:AudioSelector' :: Maybe [Natural]
pids = Maybe [Natural]
forall a. Maybe a
Prelude.Nothing,
      $sel:hlsRenditionGroupSettings:AudioSelector' :: Maybe HlsRenditionGroupSettings
hlsRenditionGroupSettings = Maybe HlsRenditionGroupSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:selectorType:AudioSelector' :: Maybe AudioSelectorType
selectorType = Maybe AudioSelectorType
forall a. Maybe a
Prelude.Nothing,
      $sel:externalAudioFileInput:AudioSelector' :: Maybe Text
externalAudioFileInput = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:remixSettings:AudioSelector' :: Maybe RemixSettings
remixSettings = Maybe RemixSettings
forall a. Maybe a
Prelude.Nothing
    }

-- | Identify a track from the input audio to include in this selector by
-- entering the track index number. To include several tracks in a single
-- audio selector, specify multiple tracks as follows. Using the console,
-- enter a comma-separated list. For examle, type \"1,2,3\" to include
-- tracks 1 through 3. Specifying directly in your JSON job file, provide
-- the track numbers in an array. For example, \"tracks\": [1,2,3].
audioSelector_tracks :: Lens.Lens' AudioSelector (Prelude.Maybe [Prelude.Natural])
audioSelector_tracks :: (Maybe [Natural] -> f (Maybe [Natural]))
-> AudioSelector -> f AudioSelector
audioSelector_tracks = (AudioSelector -> Maybe [Natural])
-> (AudioSelector -> Maybe [Natural] -> AudioSelector)
-> Lens
     AudioSelector AudioSelector (Maybe [Natural]) (Maybe [Natural])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSelector' {Maybe [Natural]
tracks :: Maybe [Natural]
$sel:tracks:AudioSelector' :: AudioSelector -> Maybe [Natural]
tracks} -> Maybe [Natural]
tracks) (\s :: AudioSelector
s@AudioSelector' {} Maybe [Natural]
a -> AudioSelector
s {$sel:tracks:AudioSelector' :: Maybe [Natural]
tracks = Maybe [Natural]
a} :: AudioSelector) ((Maybe [Natural] -> f (Maybe [Natural]))
 -> AudioSelector -> f AudioSelector)
-> ((Maybe [Natural] -> f (Maybe [Natural]))
    -> Maybe [Natural] -> f (Maybe [Natural]))
-> (Maybe [Natural] -> f (Maybe [Natural]))
-> AudioSelector
-> f AudioSelector
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Natural] [Natural] [Natural] [Natural]
-> Iso
     (Maybe [Natural])
     (Maybe [Natural])
     (Maybe [Natural])
     (Maybe [Natural])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Natural] [Natural] [Natural] [Natural]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Selects a specific language code from within an audio source, using the
-- ISO 639-2 or ISO 639-3 three-letter language code
audioSelector_customLanguageCode :: Lens.Lens' AudioSelector (Prelude.Maybe Prelude.Text)
audioSelector_customLanguageCode :: (Maybe Text -> f (Maybe Text)) -> AudioSelector -> f AudioSelector
audioSelector_customLanguageCode = (AudioSelector -> Maybe Text)
-> (AudioSelector -> Maybe Text -> AudioSelector)
-> Lens AudioSelector AudioSelector (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSelector' {Maybe Text
customLanguageCode :: Maybe Text
$sel:customLanguageCode:AudioSelector' :: AudioSelector -> Maybe Text
customLanguageCode} -> Maybe Text
customLanguageCode) (\s :: AudioSelector
s@AudioSelector' {} Maybe Text
a -> AudioSelector
s {$sel:customLanguageCode:AudioSelector' :: Maybe Text
customLanguageCode = Maybe Text
a} :: AudioSelector)

-- | Use this setting for input streams that contain Dolby E, to have the
-- service extract specific program data from the track. To select multiple
-- programs, create multiple selectors with the same Track and different
-- Program numbers. In the console, this setting is visible when you set
-- Selector type to Track. Choose the program number from the dropdown
-- list. If you are sending a JSON file, provide the program ID, which is
-- part of the audio metadata. If your input file has incorrect metadata,
-- you can choose All channels instead of a program number to have the
-- service ignore the program IDs and include all the programs in the
-- track.
audioSelector_programSelection :: Lens.Lens' AudioSelector (Prelude.Maybe Prelude.Natural)
audioSelector_programSelection :: (Maybe Natural -> f (Maybe Natural))
-> AudioSelector -> f AudioSelector
audioSelector_programSelection = (AudioSelector -> Maybe Natural)
-> (AudioSelector -> Maybe Natural -> AudioSelector)
-> Lens AudioSelector AudioSelector (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSelector' {Maybe Natural
programSelection :: Maybe Natural
$sel:programSelection:AudioSelector' :: AudioSelector -> Maybe Natural
programSelection} -> Maybe Natural
programSelection) (\s :: AudioSelector
s@AudioSelector' {} Maybe Natural
a -> AudioSelector
s {$sel:programSelection:AudioSelector' :: Maybe Natural
programSelection = Maybe Natural
a} :: AudioSelector)

-- | Selects a specific language code from within an audio source.
audioSelector_languageCode :: Lens.Lens' AudioSelector (Prelude.Maybe LanguageCode)
audioSelector_languageCode :: (Maybe LanguageCode -> f (Maybe LanguageCode))
-> AudioSelector -> f AudioSelector
audioSelector_languageCode = (AudioSelector -> Maybe LanguageCode)
-> (AudioSelector -> Maybe LanguageCode -> AudioSelector)
-> Lens
     AudioSelector
     AudioSelector
     (Maybe LanguageCode)
     (Maybe LanguageCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSelector' {Maybe LanguageCode
languageCode :: Maybe LanguageCode
$sel:languageCode:AudioSelector' :: AudioSelector -> Maybe LanguageCode
languageCode} -> Maybe LanguageCode
languageCode) (\s :: AudioSelector
s@AudioSelector' {} Maybe LanguageCode
a -> AudioSelector
s {$sel:languageCode:AudioSelector' :: Maybe LanguageCode
languageCode = Maybe LanguageCode
a} :: AudioSelector)

-- | Specifies a time delta in milliseconds to offset the audio from the
-- input video.
audioSelector_offset :: Lens.Lens' AudioSelector (Prelude.Maybe Prelude.Int)
audioSelector_offset :: (Maybe Int -> f (Maybe Int)) -> AudioSelector -> f AudioSelector
audioSelector_offset = (AudioSelector -> Maybe Int)
-> (AudioSelector -> Maybe Int -> AudioSelector)
-> Lens AudioSelector AudioSelector (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSelector' {Maybe Int
offset :: Maybe Int
$sel:offset:AudioSelector' :: AudioSelector -> Maybe Int
offset} -> Maybe Int
offset) (\s :: AudioSelector
s@AudioSelector' {} Maybe Int
a -> AudioSelector
s {$sel:offset:AudioSelector' :: Maybe Int
offset = Maybe Int
a} :: AudioSelector)

-- | Enable this setting on one audio selector to set it as the default for
-- the job. The service uses this default for outputs where it can\'t find
-- the specified input audio. If you don\'t set a default, those outputs
-- have no audio.
audioSelector_defaultSelection :: Lens.Lens' AudioSelector (Prelude.Maybe AudioDefaultSelection)
audioSelector_defaultSelection :: (Maybe AudioDefaultSelection -> f (Maybe AudioDefaultSelection))
-> AudioSelector -> f AudioSelector
audioSelector_defaultSelection = (AudioSelector -> Maybe AudioDefaultSelection)
-> (AudioSelector -> Maybe AudioDefaultSelection -> AudioSelector)
-> Lens
     AudioSelector
     AudioSelector
     (Maybe AudioDefaultSelection)
     (Maybe AudioDefaultSelection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSelector' {Maybe AudioDefaultSelection
defaultSelection :: Maybe AudioDefaultSelection
$sel:defaultSelection:AudioSelector' :: AudioSelector -> Maybe AudioDefaultSelection
defaultSelection} -> Maybe AudioDefaultSelection
defaultSelection) (\s :: AudioSelector
s@AudioSelector' {} Maybe AudioDefaultSelection
a -> AudioSelector
s {$sel:defaultSelection:AudioSelector' :: Maybe AudioDefaultSelection
defaultSelection = Maybe AudioDefaultSelection
a} :: AudioSelector)

-- | Selects a specific PID from within an audio source (e.g. 257 selects PID
-- 0x101).
audioSelector_pids :: Lens.Lens' AudioSelector (Prelude.Maybe [Prelude.Natural])
audioSelector_pids :: (Maybe [Natural] -> f (Maybe [Natural]))
-> AudioSelector -> f AudioSelector
audioSelector_pids = (AudioSelector -> Maybe [Natural])
-> (AudioSelector -> Maybe [Natural] -> AudioSelector)
-> Lens
     AudioSelector AudioSelector (Maybe [Natural]) (Maybe [Natural])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSelector' {Maybe [Natural]
pids :: Maybe [Natural]
$sel:pids:AudioSelector' :: AudioSelector -> Maybe [Natural]
pids} -> Maybe [Natural]
pids) (\s :: AudioSelector
s@AudioSelector' {} Maybe [Natural]
a -> AudioSelector
s {$sel:pids:AudioSelector' :: Maybe [Natural]
pids = Maybe [Natural]
a} :: AudioSelector) ((Maybe [Natural] -> f (Maybe [Natural]))
 -> AudioSelector -> f AudioSelector)
-> ((Maybe [Natural] -> f (Maybe [Natural]))
    -> Maybe [Natural] -> f (Maybe [Natural]))
-> (Maybe [Natural] -> f (Maybe [Natural]))
-> AudioSelector
-> f AudioSelector
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Natural] [Natural] [Natural] [Natural]
-> Iso
     (Maybe [Natural])
     (Maybe [Natural])
     (Maybe [Natural])
     (Maybe [Natural])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Natural] [Natural] [Natural] [Natural]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Settings specific to audio sources in an HLS alternate rendition group.
-- Specify the properties (renditionGroupId, renditionName or
-- renditionLanguageCode) to identify the unique audio track among the
-- alternative rendition groups present in the HLS manifest. If no unique
-- track is found, or multiple tracks match the properties provided, the
-- job fails. If no properties in hlsRenditionGroupSettings are specified,
-- the default audio track within the video segment is chosen. If there is
-- no audio within video segment, the alternative audio with DEFAULT=YES is
-- chosen instead.
audioSelector_hlsRenditionGroupSettings :: Lens.Lens' AudioSelector (Prelude.Maybe HlsRenditionGroupSettings)
audioSelector_hlsRenditionGroupSettings :: (Maybe HlsRenditionGroupSettings
 -> f (Maybe HlsRenditionGroupSettings))
-> AudioSelector -> f AudioSelector
audioSelector_hlsRenditionGroupSettings = (AudioSelector -> Maybe HlsRenditionGroupSettings)
-> (AudioSelector
    -> Maybe HlsRenditionGroupSettings -> AudioSelector)
-> Lens
     AudioSelector
     AudioSelector
     (Maybe HlsRenditionGroupSettings)
     (Maybe HlsRenditionGroupSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSelector' {Maybe HlsRenditionGroupSettings
hlsRenditionGroupSettings :: Maybe HlsRenditionGroupSettings
$sel:hlsRenditionGroupSettings:AudioSelector' :: AudioSelector -> Maybe HlsRenditionGroupSettings
hlsRenditionGroupSettings} -> Maybe HlsRenditionGroupSettings
hlsRenditionGroupSettings) (\s :: AudioSelector
s@AudioSelector' {} Maybe HlsRenditionGroupSettings
a -> AudioSelector
s {$sel:hlsRenditionGroupSettings:AudioSelector' :: Maybe HlsRenditionGroupSettings
hlsRenditionGroupSettings = Maybe HlsRenditionGroupSettings
a} :: AudioSelector)

-- | Specifies the type of the audio selector.
audioSelector_selectorType :: Lens.Lens' AudioSelector (Prelude.Maybe AudioSelectorType)
audioSelector_selectorType :: (Maybe AudioSelectorType -> f (Maybe AudioSelectorType))
-> AudioSelector -> f AudioSelector
audioSelector_selectorType = (AudioSelector -> Maybe AudioSelectorType)
-> (AudioSelector -> Maybe AudioSelectorType -> AudioSelector)
-> Lens
     AudioSelector
     AudioSelector
     (Maybe AudioSelectorType)
     (Maybe AudioSelectorType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSelector' {Maybe AudioSelectorType
selectorType :: Maybe AudioSelectorType
$sel:selectorType:AudioSelector' :: AudioSelector -> Maybe AudioSelectorType
selectorType} -> Maybe AudioSelectorType
selectorType) (\s :: AudioSelector
s@AudioSelector' {} Maybe AudioSelectorType
a -> AudioSelector
s {$sel:selectorType:AudioSelector' :: Maybe AudioSelectorType
selectorType = Maybe AudioSelectorType
a} :: AudioSelector)

-- | Specifies audio data from an external file source.
audioSelector_externalAudioFileInput :: Lens.Lens' AudioSelector (Prelude.Maybe Prelude.Text)
audioSelector_externalAudioFileInput :: (Maybe Text -> f (Maybe Text)) -> AudioSelector -> f AudioSelector
audioSelector_externalAudioFileInput = (AudioSelector -> Maybe Text)
-> (AudioSelector -> Maybe Text -> AudioSelector)
-> Lens AudioSelector AudioSelector (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSelector' {Maybe Text
externalAudioFileInput :: Maybe Text
$sel:externalAudioFileInput:AudioSelector' :: AudioSelector -> Maybe Text
externalAudioFileInput} -> Maybe Text
externalAudioFileInput) (\s :: AudioSelector
s@AudioSelector' {} Maybe Text
a -> AudioSelector
s {$sel:externalAudioFileInput:AudioSelector' :: Maybe Text
externalAudioFileInput = Maybe Text
a} :: AudioSelector)

-- | Use these settings to reorder the audio channels of one input to match
-- those of another input. This allows you to combine the two files into a
-- single output, one after the other.
audioSelector_remixSettings :: Lens.Lens' AudioSelector (Prelude.Maybe RemixSettings)
audioSelector_remixSettings :: (Maybe RemixSettings -> f (Maybe RemixSettings))
-> AudioSelector -> f AudioSelector
audioSelector_remixSettings = (AudioSelector -> Maybe RemixSettings)
-> (AudioSelector -> Maybe RemixSettings -> AudioSelector)
-> Lens
     AudioSelector
     AudioSelector
     (Maybe RemixSettings)
     (Maybe RemixSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSelector' {Maybe RemixSettings
remixSettings :: Maybe RemixSettings
$sel:remixSettings:AudioSelector' :: AudioSelector -> Maybe RemixSettings
remixSettings} -> Maybe RemixSettings
remixSettings) (\s :: AudioSelector
s@AudioSelector' {} Maybe RemixSettings
a -> AudioSelector
s {$sel:remixSettings:AudioSelector' :: Maybe RemixSettings
remixSettings = Maybe RemixSettings
a} :: AudioSelector)

instance Core.FromJSON AudioSelector where
  parseJSON :: Value -> Parser AudioSelector
parseJSON =
    String
-> (Object -> Parser AudioSelector)
-> Value
-> Parser AudioSelector
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AudioSelector"
      ( \Object
x ->
          Maybe [Natural]
-> Maybe Text
-> Maybe Natural
-> Maybe LanguageCode
-> Maybe Int
-> Maybe AudioDefaultSelection
-> Maybe [Natural]
-> Maybe HlsRenditionGroupSettings
-> Maybe AudioSelectorType
-> Maybe Text
-> Maybe RemixSettings
-> AudioSelector
AudioSelector'
            (Maybe [Natural]
 -> Maybe Text
 -> Maybe Natural
 -> Maybe LanguageCode
 -> Maybe Int
 -> Maybe AudioDefaultSelection
 -> Maybe [Natural]
 -> Maybe HlsRenditionGroupSettings
 -> Maybe AudioSelectorType
 -> Maybe Text
 -> Maybe RemixSettings
 -> AudioSelector)
-> Parser (Maybe [Natural])
-> Parser
     (Maybe Text
      -> Maybe Natural
      -> Maybe LanguageCode
      -> Maybe Int
      -> Maybe AudioDefaultSelection
      -> Maybe [Natural]
      -> Maybe HlsRenditionGroupSettings
      -> Maybe AudioSelectorType
      -> Maybe Text
      -> Maybe RemixSettings
      -> AudioSelector)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Natural]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tracks" Parser (Maybe (Maybe [Natural]))
-> Maybe [Natural] -> Parser (Maybe [Natural])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Natural]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Natural
   -> Maybe LanguageCode
   -> Maybe Int
   -> Maybe AudioDefaultSelection
   -> Maybe [Natural]
   -> Maybe HlsRenditionGroupSettings
   -> Maybe AudioSelectorType
   -> Maybe Text
   -> Maybe RemixSettings
   -> AudioSelector)
-> Parser (Maybe Text)
-> Parser
     (Maybe Natural
      -> Maybe LanguageCode
      -> Maybe Int
      -> Maybe AudioDefaultSelection
      -> Maybe [Natural]
      -> Maybe HlsRenditionGroupSettings
      -> Maybe AudioSelectorType
      -> Maybe Text
      -> Maybe RemixSettings
      -> AudioSelector)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"customLanguageCode")
            Parser
  (Maybe Natural
   -> Maybe LanguageCode
   -> Maybe Int
   -> Maybe AudioDefaultSelection
   -> Maybe [Natural]
   -> Maybe HlsRenditionGroupSettings
   -> Maybe AudioSelectorType
   -> Maybe Text
   -> Maybe RemixSettings
   -> AudioSelector)
-> Parser (Maybe Natural)
-> Parser
     (Maybe LanguageCode
      -> Maybe Int
      -> Maybe AudioDefaultSelection
      -> Maybe [Natural]
      -> Maybe HlsRenditionGroupSettings
      -> Maybe AudioSelectorType
      -> Maybe Text
      -> Maybe RemixSettings
      -> AudioSelector)
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
"programSelection")
            Parser
  (Maybe LanguageCode
   -> Maybe Int
   -> Maybe AudioDefaultSelection
   -> Maybe [Natural]
   -> Maybe HlsRenditionGroupSettings
   -> Maybe AudioSelectorType
   -> Maybe Text
   -> Maybe RemixSettings
   -> AudioSelector)
-> Parser (Maybe LanguageCode)
-> Parser
     (Maybe Int
      -> Maybe AudioDefaultSelection
      -> Maybe [Natural]
      -> Maybe HlsRenditionGroupSettings
      -> Maybe AudioSelectorType
      -> Maybe Text
      -> Maybe RemixSettings
      -> AudioSelector)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LanguageCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"languageCode")
            Parser
  (Maybe Int
   -> Maybe AudioDefaultSelection
   -> Maybe [Natural]
   -> Maybe HlsRenditionGroupSettings
   -> Maybe AudioSelectorType
   -> Maybe Text
   -> Maybe RemixSettings
   -> AudioSelector)
-> Parser (Maybe Int)
-> Parser
     (Maybe AudioDefaultSelection
      -> Maybe [Natural]
      -> Maybe HlsRenditionGroupSettings
      -> Maybe AudioSelectorType
      -> Maybe Text
      -> Maybe RemixSettings
      -> AudioSelector)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"offset")
            Parser
  (Maybe AudioDefaultSelection
   -> Maybe [Natural]
   -> Maybe HlsRenditionGroupSettings
   -> Maybe AudioSelectorType
   -> Maybe Text
   -> Maybe RemixSettings
   -> AudioSelector)
-> Parser (Maybe AudioDefaultSelection)
-> Parser
     (Maybe [Natural]
      -> Maybe HlsRenditionGroupSettings
      -> Maybe AudioSelectorType
      -> Maybe Text
      -> Maybe RemixSettings
      -> AudioSelector)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioDefaultSelection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"defaultSelection")
            Parser
  (Maybe [Natural]
   -> Maybe HlsRenditionGroupSettings
   -> Maybe AudioSelectorType
   -> Maybe Text
   -> Maybe RemixSettings
   -> AudioSelector)
-> Parser (Maybe [Natural])
-> Parser
     (Maybe HlsRenditionGroupSettings
      -> Maybe AudioSelectorType
      -> Maybe Text
      -> Maybe RemixSettings
      -> AudioSelector)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Natural]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"pids" Parser (Maybe (Maybe [Natural]))
-> Maybe [Natural] -> Parser (Maybe [Natural])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Natural]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe HlsRenditionGroupSettings
   -> Maybe AudioSelectorType
   -> Maybe Text
   -> Maybe RemixSettings
   -> AudioSelector)
-> Parser (Maybe HlsRenditionGroupSettings)
-> Parser
     (Maybe AudioSelectorType
      -> Maybe Text -> Maybe RemixSettings -> AudioSelector)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HlsRenditionGroupSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"hlsRenditionGroupSettings")
            Parser
  (Maybe AudioSelectorType
   -> Maybe Text -> Maybe RemixSettings -> AudioSelector)
-> Parser (Maybe AudioSelectorType)
-> Parser (Maybe Text -> Maybe RemixSettings -> AudioSelector)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioSelectorType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"selectorType")
            Parser (Maybe Text -> Maybe RemixSettings -> AudioSelector)
-> Parser (Maybe Text)
-> Parser (Maybe RemixSettings -> AudioSelector)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"externalAudioFileInput")
            Parser (Maybe RemixSettings -> AudioSelector)
-> Parser (Maybe RemixSettings) -> Parser AudioSelector
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RemixSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"remixSettings")
      )

instance Prelude.Hashable AudioSelector

instance Prelude.NFData AudioSelector

instance Core.ToJSON AudioSelector where
  toJSON :: AudioSelector -> Value
toJSON AudioSelector' {Maybe Int
Maybe Natural
Maybe [Natural]
Maybe Text
Maybe AudioDefaultSelection
Maybe AudioSelectorType
Maybe LanguageCode
Maybe HlsRenditionGroupSettings
Maybe RemixSettings
remixSettings :: Maybe RemixSettings
externalAudioFileInput :: Maybe Text
selectorType :: Maybe AudioSelectorType
hlsRenditionGroupSettings :: Maybe HlsRenditionGroupSettings
pids :: Maybe [Natural]
defaultSelection :: Maybe AudioDefaultSelection
offset :: Maybe Int
languageCode :: Maybe LanguageCode
programSelection :: Maybe Natural
customLanguageCode :: Maybe Text
tracks :: Maybe [Natural]
$sel:remixSettings:AudioSelector' :: AudioSelector -> Maybe RemixSettings
$sel:externalAudioFileInput:AudioSelector' :: AudioSelector -> Maybe Text
$sel:selectorType:AudioSelector' :: AudioSelector -> Maybe AudioSelectorType
$sel:hlsRenditionGroupSettings:AudioSelector' :: AudioSelector -> Maybe HlsRenditionGroupSettings
$sel:pids:AudioSelector' :: AudioSelector -> Maybe [Natural]
$sel:defaultSelection:AudioSelector' :: AudioSelector -> Maybe AudioDefaultSelection
$sel:offset:AudioSelector' :: AudioSelector -> Maybe Int
$sel:languageCode:AudioSelector' :: AudioSelector -> Maybe LanguageCode
$sel:programSelection:AudioSelector' :: AudioSelector -> Maybe Natural
$sel:customLanguageCode:AudioSelector' :: AudioSelector -> Maybe Text
$sel:tracks:AudioSelector' :: AudioSelector -> Maybe [Natural]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"tracks" 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]
tracks,
            (Text
"customLanguageCode" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
customLanguageCode,
            (Text
"programSelection" 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
programSelection,
            (Text
"languageCode" Text -> LanguageCode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LanguageCode -> Pair) -> Maybe LanguageCode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LanguageCode
languageCode,
            (Text
"offset" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
offset,
            (Text
"defaultSelection" Text -> AudioDefaultSelection -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AudioDefaultSelection -> Pair)
-> Maybe AudioDefaultSelection -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioDefaultSelection
defaultSelection,
            (Text
"pids" 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]
pids,
            (Text
"hlsRenditionGroupSettings" Text -> HlsRenditionGroupSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HlsRenditionGroupSettings -> Pair)
-> Maybe HlsRenditionGroupSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HlsRenditionGroupSettings
hlsRenditionGroupSettings,
            (Text
"selectorType" Text -> AudioSelectorType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AudioSelectorType -> Pair)
-> Maybe AudioSelectorType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioSelectorType
selectorType,
            (Text
"externalAudioFileInput" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
externalAudioFileInput,
            (Text
"remixSettings" Text -> RemixSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RemixSettings -> Pair) -> Maybe RemixSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RemixSettings
remixSettings
          ]
      )