X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fsimple.lua;h=5444a200be9787c0e8c1f62269dcf6f0d7ccfe45;hb=c109bb45b840bc48d265dd4bb03a3a27061b7eb7;hp=3960505175e9637d1a2f627e1586c83691c59d41;hpb=337e2d06624b4b46eb2e7e5365e2ece219f9f100;p=nageru diff --git a/nageru/simple.lua b/nageru/simple.lua index 3960505..5444a20 100644 --- a/nageru/simple.lua +++ b/nageru/simple.lua @@ -25,24 +25,10 @@ local input = scene:add_input() local wb_effect = scene:add_effect(WhiteBalanceEffect.new()) scene:finalize() --- API ENTRY POINT --- Returns the number of outputs in addition to the live (0) and preview (1). --- Called only once, at the start of the program. -function num_channels() - return 2 -end - --- API ENTRY POINT --- Returns the name for each additional channel (starting from 2). --- Called at the start of the program, and then each frame for live --- channels in case they change resolution. -function channel_name(channel) - if channel == 2 then - return "First input" - elseif channel == 3 then - return "Second input" - end -end +-- Set some global state. +Nageru.set_num_channels(2) -- Can only be called at the start of the program. +Nageru.set_channel_name(2, "First input") +Nageru.set_channel_name(3, "Second input") -- API ENTRY POINT -- Returns, given a channel number, which signal it corresponds to (starting from 0).