mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 08:14:58 +01:00
Second round of Lua script API updates
This commit is contained in:
parent
1abf6a77d6
commit
76c0f42ecb
23 changed files with 76 additions and 112 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue