X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=theme.lua;h=c7ce264017cfd9bde2572bf74e9c9e8096898ecf;hb=92d7d0f49eca3378714670843f244a8d7ae8b05d;hp=67c80a32a9166ea49d3cdeacea1ba9aaad0f2cba;hpb=2a7cf4b5d75c7c6f5c6cc4df1ab80978f2f94d9c;p=nageru diff --git a/theme.lua b/theme.lua index 67c80a3..c7ce264 100644 --- a/theme.lua +++ b/theme.lua @@ -90,8 +90,38 @@ function num_channels() end -- Called every frame. -function get_transitions() - return {"Cut", "Fade", "Zoom!"} +function get_transitions(t) + -- If live is 2 (SBS) but de-facto single, make it so. + if live_signal_num == 2 and t >= zoom_end and zoom_dst == 1.0 then + live_signal_num = 0 + end + + if live_signal_num == preview_signal_num then + return {} + end + + if live_signal_num == 2 and t >= zoom_start and t <= zoom_end then + -- Zoom in progress. + return {"Cut"} + end + + if (live_signal_num == 0 and preview_signal_num == 1) or + (live_signal_num == 1 and preview_signal_num == 0) then + return {"Cut"} + end + + if live_signal_num == 2 and preview_signal_num == 1 then + -- Zoom-out not supported here yet. + return {"Cut"} + end + + if live_signal_num == 2 and preview_signal_num == 0 then + return {"Cut", "Zoom in"} + elseif live_signal_num == 0 and preview_signal_num == 2 then + return {"Cut", "Zoom out"} + end + + return {"Cut"} end function transition_clicked(num, t)