+ return {
+ input = input,
+ wb_effect = wb_effect,
+ last = last
+ }
+end
+
+-- A chain to fade between two inputs, of which either can be a picture
+-- or a live input. In practice only used live, but we still support the
+-- hq parameter.
+function make_fade_chain(input0_live, input0_deint, input1_live, input1_deint, hq)
+ local chain = EffectChain.new(16, 9)
+
+ local input0 = make_fade_input(chain, INPUT0_SIGNAL_NUM, input0_live, input0_deint)
+ local input1 = make_fade_input(chain, INPUT1_SIGNAL_NUM, input1_live, input1_deint)
+
+ local mix_effect = chain:add_effect(MixEffect.new(), input0.last, input1.last)
+ chain:finalize(hq)
+
+ return {
+ chain = chain,
+ input0 = input0,
+ input1 = input1,
+ mix_effect = mix_effect
+ }
+end
+
+-- Chains to fade between two inputs, in various configurations.
+local fade_chains = {}
+for input0_type, input0_live in pairs({static = false, live = true, livedeint = true}) do
+ local input0_deint = (input0_live == "livedeint")
+ fade_chains[input0_type] = {}
+ for input1_type, input1_live in pairs({static = false, live = true, livedeint = true}) do
+ local input1_deint = (input1_live == "livedeint")
+ fade_chains[input0_type][input1_type] = {}
+ for _, hq in pairs({true, false}) do
+ fade_chains[input0_type][input1_type][hq] =
+ make_fade_chain(input0_live, input0_deint, input1_live, input1_deint, hq)
+ end
+ end
+end
+
+-- A chain to show a single input on screen.
+function make_simple_chain(input_deint, hq)
+ local chain = EffectChain.new(16, 9)
+
+ local input = chain:add_live_input(false, input_deint)
+ input:connect_signal(0) -- First input card. Can be changed whenever you want.
+ local wb_effect = chain:add_effect(WhiteBalanceEffect.new())