Clean up create drum-tracks script (no global variables)
This commit is contained in:
parent
0653766f79
commit
13b1b607b5
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
ardour {
|
ardour {
|
||||||
["type"] = "EditorAction",
|
["type"] = "EditorAction",
|
||||||
name = "Create Drum Tracks",
|
name = "Create Drum Tracks",
|
||||||
@ -6,36 +5,32 @@ ardour {
|
|||||||
description = [[Creates 8 new tracks with representative names and colors.]]
|
description = [[Creates 8 new tracks with representative names and colors.]]
|
||||||
}
|
}
|
||||||
|
|
||||||
names = {
|
function factory () return function ()
|
||||||
"Kick",
|
|
||||||
"Snare",
|
|
||||||
"Hat",
|
|
||||||
"Fl Tom",
|
|
||||||
"OH L",
|
|
||||||
"OH R",
|
|
||||||
"Room 1",
|
|
||||||
"Room 2"
|
|
||||||
}
|
|
||||||
|
|
||||||
color = 0xff8800ff --orange
|
local names = {
|
||||||
|
"Kick",
|
||||||
|
"Snare",
|
||||||
|
"Hat",
|
||||||
|
"Fl Tom",
|
||||||
|
"OH L",
|
||||||
|
"OH R",
|
||||||
|
"Room 1",
|
||||||
|
"Room 2"
|
||||||
|
}
|
||||||
|
|
||||||
|
local color = 0xff8800ff --orange
|
||||||
function factory (params)
|
|
||||||
return function ()
|
|
||||||
|
|
||||||
local i = 1
|
local i = 1
|
||||||
while names[i] do
|
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])
|
for track in tl:iter () do
|
||||||
if (not track:isnil()) then
|
track:presentation_info_ptr ():set_color (color)
|
||||||
trkinfo = track:presentation_info_ptr ()
|
|
||||||
trkinfo:set_color (color)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
i = i + 1
|
i = i + 1
|
||||||
end --foreach track
|
end --foreach track
|
||||||
|
|
||||||
end --function
|
end end -- function factory
|
||||||
|
|
||||||
end --factory
|
|
||||||
|
Loading…
Reference in New Issue
Block a user