This is a bit more convenient than the export option, as one does not
have to wait for the export.
]],
- license = "GPLv2"
+ license = "GPLv2"
}
function factory (unused_params) return function ()
- fr = Session:frame_rate()
+ fr = Session:frame_rate()
chaps = {}
- for l in Session:locations():list():iter() do
- name = l:name()
- if not l:is_mark() or string.find(name, "^xrun%d*$") then
+ for l in Session:locations():list():iter() do
+ name = l:name()
+ if not l:is_mark() or string.find(name, "^xrun%d*$") then
goto next end
t = l:start()
ms = math.floor(r*1000/fr)
table.insert(chaps, string.format("%02d:%02d:%02d.%03d %s\n", h, m, s, ms, name))
::next::
- end
+ end
if next(chaps) == nil then
goto out end
table.insert(chaps, "00:00:00.000 Intro\n")
table.sort(chaps)
- file = io.open(string.format("%s/export/mp4chaps.txt", Session:path()), "w")
+ file = io.open(ARDOUR.LuaAPI.build_filename (Session:path(), "export", "mp4chaps.txt"), "w")
for i, line in ipairs(chaps) do
file:write(line)
end
- file:close()
+ file:close()
::out::
end end