2 ["type"] = "EditorHook",
3 name = "Timed Event Example",
4 author = "Ardour Lua Task Force",
5 description = "Perform actions at specific wallclock time, example record",
9 return LuaSignal.Set():add ({[LuaSignal.LuaTimerDS] = true})
14 return function (signal, ref, ...)
16 -- calculate seconds since midnight
17 function hhmmss (hh, mm, ss) return hh * 3600 + mm * 60 + ss end
19 -- current seconds since midnight UTC
20 -- (unix-time is UTC, no leap seconds, a day always has 86400 sec)
21 local now = os.time () % 86400
23 -- event at 09:30:00 UTC (here: rec-arm + roll)
24 if (now >= hhmmss (09, 30, 00) and _last_time < hhmmss (09, 30, 00)) then
25 Session:maybe_enable_record (false)
26 Session:request_transport_speed (1.0, true)
29 -- event at 09:32:00 UTC (here: rec-stop)
30 if (now >= hhmmss (09, 32, 00) and _last_time < hhmmss (09, 32, 00)) then
31 Session:disable_record (false, false)
32 Session:request_transport_speed (0.0, true)