{-# 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-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.AudioSelector 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.AudioDefaultSelection
import Amazonka.MediaConvert.Types.AudioDurationCorrection
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'
  { -- | Apply audio timing corrections to help synchronize audio and video in
    -- your output. To apply timing corrections, your input must meet the
    -- following requirements: * Container: MP4, or MOV, with an accurate
    -- time-to-sample (STTS) table. * Audio track: AAC. Choose from the
    -- following audio timing correction settings: * Disabled (Default): Apply
    -- no correction. * Auto: Recommended for most inputs. MediaConvert
    -- analyzes the audio timing in your input and determines which correction
    -- setting to use, if needed. * Track: Adjust the duration of each audio
    -- frame by a constant amount to align the audio track length with STTS
    -- duration. Track-level correction does not affect pitch, and is
    -- recommended for tonal audio content such as music. * Frame: Adjust the
    -- duration of each audio frame by a variable amount to align audio frames
    -- with STTS timestamps. No corrections are made to already-aligned frames.
    -- Frame-level correction may affect the pitch of corrected frames, and is
    -- recommended for atonal audio content such as speech or percussion.
    AudioSelector -> Maybe AudioDurationCorrection
audioDurationCorrection :: Prelude.Maybe AudioDurationCorrection,
    -- | 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,
    -- | 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,
    -- | Specifies audio data from an external file source.
    AudioSelector -> Maybe Text
externalAudioFileInput :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | 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,
    -- | Selects a specific PID from within an audio source (e.g. 257 selects PID
    -- 0x101).
    AudioSelector -> Maybe [Natural]
pids :: Prelude.Maybe [Prelude.Natural],
    -- | 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,
    -- | 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,
    -- | Specifies the type of the audio selector.
    AudioSelector -> Maybe AudioSelectorType
selectorType :: Prelude.Maybe AudioSelectorType,
    -- | 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]
  }
  deriving (AudioSelector -> AudioSelector -> Bool
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]
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
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. 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:
--
-- 'audioDurationCorrection', 'audioSelector_audioDurationCorrection' - Apply audio timing corrections to help synchronize audio and video in
-- your output. To apply timing corrections, your input must meet the
-- following requirements: * Container: MP4, or MOV, with an accurate
-- time-to-sample (STTS) table. * Audio track: AAC. Choose from the
-- following audio timing correction settings: * Disabled (Default): Apply
-- no correction. * Auto: Recommended for most inputs. MediaConvert
-- analyzes the audio timing in your input and determines which correction
-- setting to use, if needed. * Track: Adjust the duration of each audio
-- frame by a constant amount to align the audio track length with STTS
-- duration. Track-level correction does not affect pitch, and is
-- recommended for tonal audio content such as music. * Frame: Adjust the
-- duration of each audio frame by a variable amount to align audio frames
-- with STTS timestamps. No corrections are made to already-aligned frames.
-- Frame-level correction may affect the pitch of corrected frames, and is
-- recommended for atonal audio content such as speech or percussion.
--
-- '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
--
-- '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.
--
-- 'externalAudioFileInput', 'audioSelector_externalAudioFileInput' - Specifies audio data from an external file source.
--
-- '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.
--
-- '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.
--
-- 'pids', 'audioSelector_pids' - Selects a specific PID from within an audio source (e.g. 257 selects PID
-- 0x101).
--
-- '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.
--
-- '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.
--
-- 'selectorType', 'audioSelector_selectorType' - Specifies the type of the audio selector.
--
-- '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].
newAudioSelector ::
  AudioSelector
newAudioSelector :: AudioSelector
newAudioSelector =
  AudioSelector'
    { $sel:audioDurationCorrection:AudioSelector' :: Maybe AudioDurationCorrection
audioDurationCorrection =
        forall a. Maybe a
Prelude.Nothing,
      $sel:customLanguageCode:AudioSelector' :: Maybe Text
customLanguageCode = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultSelection:AudioSelector' :: Maybe AudioDefaultSelection
defaultSelection = forall a. Maybe a
Prelude.Nothing,
      $sel:externalAudioFileInput:AudioSelector' :: Maybe Text
externalAudioFileInput = forall a. Maybe a
Prelude.Nothing,
      $sel:hlsRenditionGroupSettings:AudioSelector' :: Maybe HlsRenditionGroupSettings
hlsRenditionGroupSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:languageCode:AudioSelector' :: Maybe LanguageCode
languageCode = forall a. Maybe a
Prelude.Nothing,
      $sel:offset:AudioSelector' :: Maybe Int
offset = forall a. Maybe a
Prelude.Nothing,
      $sel:pids:AudioSelector' :: Maybe [Natural]
pids = forall a. Maybe a
Prelude.Nothing,
      $sel:programSelection:AudioSelector' :: Maybe Natural
programSelection = forall a. Maybe a
Prelude.Nothing,
      $sel:remixSettings:AudioSelector' :: Maybe RemixSettings
remixSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:selectorType:AudioSelector' :: Maybe AudioSelectorType
selectorType = forall a. Maybe a
Prelude.Nothing,
      $sel:tracks:AudioSelector' :: Maybe [Natural]
tracks = forall a. Maybe a
Prelude.Nothing
    }

-- | Apply audio timing corrections to help synchronize audio and video in
-- your output. To apply timing corrections, your input must meet the
-- following requirements: * Container: MP4, or MOV, with an accurate
-- time-to-sample (STTS) table. * Audio track: AAC. Choose from the
-- following audio timing correction settings: * Disabled (Default): Apply
-- no correction. * Auto: Recommended for most inputs. MediaConvert
-- analyzes the audio timing in your input and determines which correction
-- setting to use, if needed. * Track: Adjust the duration of each audio
-- frame by a constant amount to align the audio track length with STTS
-- duration. Track-level correction does not affect pitch, and is
-- recommended for tonal audio content such as music. * Frame: Adjust the
-- duration of each audio frame by a variable amount to align audio frames
-- with STTS timestamps. No corrections are made to already-aligned frames.
-- Frame-level correction may affect the pitch of corrected frames, and is
-- recommended for atonal audio content such as speech or percussion.
audioSelector_audioDurationCorrection :: Lens.Lens' AudioSelector (Prelude.Maybe AudioDurationCorrection)
audioSelector_audioDurationCorrection :: Lens' AudioSelector (Maybe AudioDurationCorrection)
audioSelector_audioDurationCorrection = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioSelector' {Maybe AudioDurationCorrection
audioDurationCorrection :: Maybe AudioDurationCorrection
$sel:audioDurationCorrection:AudioSelector' :: AudioSelector -> Maybe AudioDurationCorrection
audioDurationCorrection} -> Maybe AudioDurationCorrection
audioDurationCorrection) (\s :: AudioSelector
s@AudioSelector' {} Maybe AudioDurationCorrection
a -> AudioSelector
s {$sel:audioDurationCorrection:AudioSelector' :: Maybe AudioDurationCorrection
audioDurationCorrection = Maybe AudioDurationCorrection
a} :: AudioSelector)

-- | 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 :: Lens' AudioSelector (Maybe Text)
audioSelector_customLanguageCode = 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)

-- | 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 :: Lens' AudioSelector (Maybe AudioDefaultSelection)
audioSelector_defaultSelection = 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)

-- | Specifies audio data from an external file source.
audioSelector_externalAudioFileInput :: Lens.Lens' AudioSelector (Prelude.Maybe Prelude.Text)
audioSelector_externalAudioFileInput :: Lens' AudioSelector (Maybe Text)
audioSelector_externalAudioFileInput = 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)

-- | 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 :: Lens' AudioSelector (Maybe HlsRenditionGroupSettings)
audioSelector_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)

-- | Selects a specific language code from within an audio source.
audioSelector_languageCode :: Lens.Lens' AudioSelector (Prelude.Maybe LanguageCode)
audioSelector_languageCode :: Lens' AudioSelector (Maybe LanguageCode)
audioSelector_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 :: Lens' AudioSelector (Maybe Int)
audioSelector_offset = 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)

-- | 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 :: Lens' AudioSelector (Maybe [Natural])
audioSelector_pids = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: Lens' AudioSelector (Maybe Natural)
audioSelector_programSelection = 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)

-- | 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 :: Lens' AudioSelector (Maybe RemixSettings)
audioSelector_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)

-- | Specifies the type of the audio selector.
audioSelector_selectorType :: Lens.Lens' AudioSelector (Prelude.Maybe AudioSelectorType)
audioSelector_selectorType :: Lens' AudioSelector (Maybe AudioSelectorType)
audioSelector_selectorType = 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)

-- | 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 :: Lens' AudioSelector (Maybe [Natural])
audioSelector_tracks = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable AudioSelector where
  hashWithSalt :: Int -> AudioSelector -> Int
hashWithSalt Int
_salt AudioSelector' {Maybe Int
Maybe Natural
Maybe [Natural]
Maybe Text
Maybe AudioDefaultSelection
Maybe AudioDurationCorrection
Maybe AudioSelectorType
Maybe LanguageCode
Maybe HlsRenditionGroupSettings
Maybe RemixSettings
tracks :: Maybe [Natural]
selectorType :: Maybe AudioSelectorType
remixSettings :: Maybe RemixSettings
programSelection :: Maybe Natural
pids :: Maybe [Natural]
offset :: Maybe Int
languageCode :: Maybe LanguageCode
hlsRenditionGroupSettings :: Maybe HlsRenditionGroupSettings
externalAudioFileInput :: Maybe Text
defaultSelection :: Maybe AudioDefaultSelection
customLanguageCode :: Maybe Text
audioDurationCorrection :: Maybe AudioDurationCorrection
$sel:tracks:AudioSelector' :: AudioSelector -> Maybe [Natural]
$sel:selectorType:AudioSelector' :: AudioSelector -> Maybe AudioSelectorType
$sel:remixSettings:AudioSelector' :: AudioSelector -> Maybe RemixSettings
$sel:programSelection:AudioSelector' :: AudioSelector -> Maybe Natural
$sel:pids:AudioSelector' :: AudioSelector -> Maybe [Natural]
$sel:offset:AudioSelector' :: AudioSelector -> Maybe Int
$sel:languageCode:AudioSelector' :: AudioSelector -> Maybe LanguageCode
$sel:hlsRenditionGroupSettings:AudioSelector' :: AudioSelector -> Maybe HlsRenditionGroupSettings
$sel:externalAudioFileInput:AudioSelector' :: AudioSelector -> Maybe Text
$sel:defaultSelection:AudioSelector' :: AudioSelector -> Maybe AudioDefaultSelection
$sel:customLanguageCode:AudioSelector' :: AudioSelector -> Maybe Text
$sel:audioDurationCorrection:AudioSelector' :: AudioSelector -> Maybe AudioDurationCorrection
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AudioDurationCorrection
audioDurationCorrection
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customLanguageCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AudioDefaultSelection
defaultSelection
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
externalAudioFileInput
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HlsRenditionGroupSettings
hlsRenditionGroupSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LanguageCode
languageCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
offset
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Natural]
pids
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
programSelection
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RemixSettings
remixSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AudioSelectorType
selectorType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Natural]
tracks

instance Prelude.NFData AudioSelector where
  rnf :: AudioSelector -> ()
rnf AudioSelector' {Maybe Int
Maybe Natural
Maybe [Natural]
Maybe Text
Maybe AudioDefaultSelection
Maybe AudioDurationCorrection
Maybe AudioSelectorType
Maybe LanguageCode
Maybe HlsRenditionGroupSettings
Maybe RemixSettings
tracks :: Maybe [Natural]
selectorType :: Maybe AudioSelectorType
remixSettings :: Maybe RemixSettings
programSelection :: Maybe Natural
pids :: Maybe [Natural]
offset :: Maybe Int
languageCode :: Maybe LanguageCode
hlsRenditionGroupSettings :: Maybe HlsRenditionGroupSettings
externalAudioFileInput :: Maybe Text
defaultSelection :: Maybe AudioDefaultSelection
customLanguageCode :: Maybe Text
audioDurationCorrection :: Maybe AudioDurationCorrection
$sel:tracks:AudioSelector' :: AudioSelector -> Maybe [Natural]
$sel:selectorType:AudioSelector' :: AudioSelector -> Maybe AudioSelectorType
$sel:remixSettings:AudioSelector' :: AudioSelector -> Maybe RemixSettings
$sel:programSelection:AudioSelector' :: AudioSelector -> Maybe Natural
$sel:pids:AudioSelector' :: AudioSelector -> Maybe [Natural]
$sel:offset:AudioSelector' :: AudioSelector -> Maybe Int
$sel:languageCode:AudioSelector' :: AudioSelector -> Maybe LanguageCode
$sel:hlsRenditionGroupSettings:AudioSelector' :: AudioSelector -> Maybe HlsRenditionGroupSettings
$sel:externalAudioFileInput:AudioSelector' :: AudioSelector -> Maybe Text
$sel:defaultSelection:AudioSelector' :: AudioSelector -> Maybe AudioDefaultSelection
$sel:customLanguageCode:AudioSelector' :: AudioSelector -> Maybe Text
$sel:audioDurationCorrection:AudioSelector' :: AudioSelector -> Maybe AudioDurationCorrection
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AudioDurationCorrection
audioDurationCorrection
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customLanguageCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AudioDefaultSelection
defaultSelection
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
externalAudioFileInput
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HlsRenditionGroupSettings
hlsRenditionGroupSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LanguageCode
languageCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
offset
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Natural]
pids
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
programSelection
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RemixSettings
remixSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AudioSelectorType
selectorType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Natural]
tracks

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