Second round of Lua script API updates

This commit is contained in:
Robin Gareus 2022-09-27 18:58:53 +02:00
parent 1abf6a77d6
commit 76c0f42ecb
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
23 changed files with 76 additions and 112 deletions

View file

@ -3,13 +3,11 @@ ardour { ["type"] = "Snippet", name = "Region Transient List" }
function factory () return function ()
local sel = Editor:get_selection ()
for r in sel.regions:regionlist ():iter () do
local region_pos = r:position()
local region_off = r:start()
print (r:name(), r:position(), r:start())
local trans = r:transients()
local ref = r:position() - r:start()
print (r:name(), r:position(), r:start(), r:position():samples(), r:start():samples())
local trans = r:transients() -- list of samplepos_t
for t in trans:iter() do
-- print absolute timeline position of transients
print (t + region_pos - region_off)
print (ref + Temporal.timecnt_t(t), ref:samples () + t)
end
print ("----")
end