summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-02-19 16:03:17 +0100
committerRobin Gareus <robin@gareus.org>2017-02-19 16:03:17 +0100
commit13b1b607b56b556a036b6ca8ba8d080b7a7afc77 (patch)
treeef31ba2e798527e2119c8efc5267bb6e89bf7b5e /scripts
parent0653766f790fc17afe323e616c10bcc21efe4915 (diff)
Clean up create drum-tracks script (no global variables)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/create_drum_tracks.lua41
1 files changed, 18 insertions, 23 deletions
diff --git a/scripts/create_drum_tracks.lua b/scripts/create_drum_tracks.lua
index 0ade66a60d..57c484a61e 100644
--- a/scripts/create_drum_tracks.lua
+++ b/scripts/create_drum_tracks.lua
@@ -1,4 +1,3 @@
-
ardour {
["type"] = "EditorAction",
name = "Create Drum Tracks",
@@ -6,36 +5,32 @@ ardour {
description = [[Creates 8 new tracks with representative names and colors.]]
}
-names = {
-"Kick",
-"Snare",
-"Hat",
-"Fl Tom",
-"OH L",
-"OH R",
-"Room 1",
-"Room 2"
-}
+function factory () return function ()
-color = 0xff8800ff --orange
+ local names = {
+ "Kick",
+ "Snare",
+ "Hat",
+ "Fl Tom",
+ "OH L",
+ "OH R",
+ "Room 1",
+ "Room 2"
+ }
-
-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