Clean up create drum-tracks script (no global variables)
This commit is contained in:
parent
0653766f79
commit
13b1b607b5
@ -1,4 +1,3 @@
|
||||
|
||||
ardour {
|
||||
["type"] = "EditorAction",
|
||||
name = "Create Drum Tracks",
|
||||
@ -6,7 +5,9 @@ ardour {
|
||||
description = [[Creates 8 new tracks with representative names and colors.]]
|
||||
}
|
||||
|
||||
names = {
|
||||
function factory () return function ()
|
||||
|
||||
local names = {
|
||||
"Kick",
|
||||
"Snare",
|
||||
"Hat",
|
||||
@ -17,25 +18,19 @@ names = {
|
||||
"Room 2"
|
||||
}
|
||||
|
||||
color = 0xff8800ff --orange
|
||||
|
||||
|
||||
function factory (params)
|
||||
return function ()
|
||||
local color = 0xff8800ff --orange
|
||||
|
||||
local i = 1
|
||||
while names[i] do
|
||||
Session:new_audio_track(1,2,RouteGroup,1,names[i],i,ARDOUR.TrackMode.Normal)
|
||||
local tl = Session:new_audio_track (1, 2, nil, 1, names[i],
|
||||
ARDOUR.PresentationInfo.max_order,
|
||||
ARDOUR.TrackMode.Normal)
|
||||
|
||||
track = Session:route_by_name(names[i])
|
||||
if (not track:isnil()) then
|
||||
trkinfo = track:presentation_info_ptr ()
|
||||
trkinfo:set_color (color)
|
||||
for track in tl:iter () do
|
||||
track:presentation_info_ptr ():set_color (color)
|
||||
end
|
||||
|
||||
i = i + 1
|
||||
end --foreach track
|
||||
|
||||
end --function
|
||||
|
||||
end --factory
|
||||
end end -- function factory
|
||||
|
Loading…
Reference in New Issue
Block a user