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

@ -11,6 +11,12 @@ function factory (params) return function ()
-- (regions, tracks, ranges, markers, automation, midi-notes etc)
local sel = Editor:get_selection ()
-- default track output channel count (= master bus input count)
local n_chan_out = 2
if not Session:master_out():isnil() then
n_chan_out = Session:master_out():n_inputs ():n_audio ()
end
-- for each track..
for t in sel.tracks:routelist ():iter () do
local track = t:to_track ()
@ -30,7 +36,7 @@ function factory (params) return function ()
if channels ~= 2 then goto next end
-- create 2 new tracks (using the name of the original track)(
local newtracks = Session:new_audio_track (2, 2, nil, 2, t:name(), ARDOUR.PresentationInfo.max_order, ARDOUR.TrackMode.Normal, true)
local newtracks = Session:new_audio_track (1, n_chan_out, nil, 2, t:name(), ARDOUR.PresentationInfo.max_order, ARDOUR.TrackMode.Normal, true)
assert (newtracks:size() == 2)
for r in playlist:region_list ():iter () do