X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fultimate.lua;h=32b17137b0b805d851b0aef89aae0350840d1a98;hb=0b1a1382bcabcbc3f2c4287daf118f1e070d1ce5;hp=89d48de24f052969661a8650a13ad96b89304297;hpb=96d850024a757967056d0bba4ec9f16e07810a58;p=ultimatescore diff --git a/nageru/ultimate.lua b/nageru/ultimate.lua index 89d48de..32b1713 100644 --- a/nageru/ultimate.lua +++ b/nageru/ultimate.lua @@ -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. @@ -350,7 +356,7 @@ end -- Called once for each channel, at the start of the program. -- Will never be called for live (0) or preview (1). function channel_signal(channel) - if is_plain_signal(channel) then + if is_plain_signal(channel - 2) then return channel - 2 else return -1 @@ -760,3 +766,7 @@ function calc_fade_progress(t, transition_start, transition_end) return tt end + +ThemeMenu.set( + { "Reload overlay", reload_cef } +)