Add method to query sections

This commit is contained in:
Robin Gareus 2023-08-12 02:30:43 +02:00
parent 6cf2659f8b
commit 46a916f0b4
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
4 changed files with 87 additions and 0 deletions

View file

@ -0,0 +1,18 @@
ardour { ["type"] = "Snippet", name = "List Sections" }
function factory () return function ()
local s = Temporal.timepos_t(0)
local e = Temporal.timepos_t(0)
local loc = Session:locations ()
local l = nil
local cnt = 0
repeat
l, rv = loc:next_section (l, s, e)
if l ~= nil then
print (l:name (), rv[2], rv[3]);
end
cnt = cnt + 1
until (l == nil or cnt > 10)
end end