]> git.sesse.net Git - ultimatescore/commitdiff
Update ultimate.lua to work without CasparCG.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 26 Feb 2018 23:54:25 +0000 (00:54 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 26 Feb 2018 23:54:58 +0000 (00:54 +0100)
The README still needs updating.

nageru/ultimate.lua

index 9bd4e17325bd2bd50548f90e601307fa170c9109..32b17137b0b805d851b0aef89aae0350840d1a98 100644 (file)
@@ -45,8 +45,14 @@ local FADE_TRANSITION = 2
 -- frame and not per field, since we deinterlace.
 local last_resolution = {}
 
-local caspar_input = VideoInput.new("unix:///tmp/caspar.sock", Nageru.VIDEO_FORMAT_BGRA)
-caspar_input:change_rate(2.0)
+local cef_input = HTMLInput.new("file:///home/sesse/dev/ultimatescore/score.html")
+cef_input:set_url("file:///home/sesse/dev/ultimatescore/score.html");
+cef_input:execute_javascript_async("play()")
+
+function reload_cef()
+       cef_input:reload()
+       cef_input:execute_javascript_async("play()")
+end
 
 -- Utility function to help creating many similar chains that can differ
 -- in a free set of chosen parameters.
@@ -68,7 +74,7 @@ end
 
 -- An overlay with variable alpha.
 function make_overlay(chain, base)
-       local image = chain:add_video_input(caspar_input, false)
+       local image = chain:add_html_input(cef_input)
        local multiply_effect = chain:add_effect(MultiplyEffect.new())
        local overlay_effect = chain:add_effect(OverlayEffect.new(), base, multiply_effect)
        return {
@@ -233,7 +239,7 @@ end)
 -- A chain to show the overlay and nothing more. LQ only,
 -- since it is not a valid live signal.
 local overlay_chain_lq = EffectChain.new(16, 9)
-local overlay_chain_lq_input = overlay_chain_lq:add_video_input(caspar_input, false)
+local overlay_chain_lq_input = overlay_chain_lq:add_html_input(cef_input)
 overlay_chain_lq:finalize(false)
 
 -- Used for indexing into the tables of chains.
@@ -760,3 +766,7 @@ function calc_fade_progress(t, transition_start, transition_end)
 
        return tt
 end
+
+ThemeMenu.set(
+       { "Reload overlay", reload_cef }
+)