-local main_chain_hq = make_sbs_chain(true)
-local main_chain_lq = make_sbs_chain(false)
-
--- A chain to fade between two inputs (live chain only)
-local fade_vtv_chain_hq = EffectChain.new(16, 9)
-local fade_vtv_chain_hq_input0 = fade_vtv_chain_hq:add_live_input(true)
-local fade_vtv_chain_hq_wb0_effect = fade_vtv_chain_hq:add_effect(WhiteBalanceEffect.new())
-local fade_vtv_chain_hq_input1 = fade_vtv_chain_hq:add_live_input(true)
-local fade_vtv_chain_hq_wb1_effect = fade_vtv_chain_hq:add_effect(WhiteBalanceEffect.new())
-fade_vtv_chain_hq_input0:connect_signal(0)
-fade_vtv_chain_hq_input1:connect_signal(1)
-local fade_vtv_chain_mix_effect = fade_vtv_chain_hq:add_effect(MixEffect.new(), fade_vtv_chain_hq_wb0_effect, fade_vtv_chain_hq_wb1_effect)
-fade_vtv_chain_hq:finalize(true)
-
--- A chain to fade between an inputs and a picture (live chain only)
-local fade_vtp_chain_hq = EffectChain.new(16, 9)
-local fade_vtp_chain_hq_input0 = fade_vtp_chain_hq:add_live_input(true)
-local fade_vtp_chain_hq_wb0_effect = fade_vtp_chain_hq:add_effect(WhiteBalanceEffect.new())
-local fade_vtp_chain_hq_input1 = fade_vtp_chain_hq:add_effect(ImageInput.new("bg.jpeg"))
-fade_vtp_chain_hq_input0:connect_signal(0)
-local fade_vtp_chain_mix_effect = fade_vtp_chain_hq:add_effect(MixEffect.new(), fade_vtp_chain_hq_wb0_effect, fade_vtp_chain_hq_input1)
-fade_vtp_chain_hq:finalize(true)
-
--- A chain to show a single input on screen (HQ version).
-local simple_chain_hq = EffectChain.new(16, 9)
-local simple_chain_hq_input = simple_chain_hq:add_live_input(true)
-simple_chain_hq_input:connect_signal(0) -- First input card. Can be changed whenever you want.
-local simple_chain_hq_wb_effect = simple_chain_hq:add_effect(WhiteBalanceEffect.new())
-simple_chain_hq:finalize(true)
-
--- A chain to show a single input on screen (LQ version).
-local simple_chain_lq = EffectChain.new(16, 9)
-local simple_chain_lq_input = simple_chain_lq:add_live_input(true)
-simple_chain_lq_input:connect_signal(0) -- First input card. Can be changed whenever you want.
-local simple_chain_lq_wb_effect = simple_chain_lq:add_effect(WhiteBalanceEffect.new())
-simple_chain_lq:finalize(false)
+-- Make all possible combinations of single-input chains.
+local simple_chains = make_cartesian_product({
+ {"live", "livedeint"}, -- input_type
+ {true, false}, -- input_scale
+ {true, false} -- hq
+}, function(input_type, input_scale, hq)
+ local input_deint = (input_type == "livedeint")
+ return make_simple_chain(input_deint, input_scale, hq)
+end)