+-- Make all possible combinations of side-by-side chains.
+local sbs_chains = {}
+for input0_type, input0_deint in pairs({live = false, livedeint = true}) do
+ sbs_chains[input0_type] = {}
+ for input1_type, input1_deint in pairs({live = false, livedeint = true}) do
+ sbs_chains[input0_type][input1_type] = {}
+ for _, hq in pairs({true, false}) do
+ sbs_chains[input0_type][input1_type][hq] =
+ make_sbs_chain(input0_deint, input1_deint, hq)
+ end
+ end
+end
+
+function make_fade_input(chain, signal, live, deint)
+ local input, wb_effect, last
+ if live then
+ input = chain:add_live_input(false, deint)
+ wb_effect = chain:add_effect(WhiteBalanceEffect.new())
+ input:connect_signal(signal)
+ last = wb_effect
+ else
+ input = chain:add_effect(ImageInput.new("bg.jpeg"))
+ last = input
+ end
+
+ return {
+ input = input,
+ wb_effect = wb_effect,
+ last = last
+ }
+end