NO-OP: documentation/comments
This commit is contained in:
parent
a3f8449595
commit
0bd6b0ee3d
@ -7,23 +7,30 @@ ardour {
|
|||||||
|
|
||||||
function factory () return function ()
|
function factory () return function ()
|
||||||
|
|
||||||
|
-- sort compare function
|
||||||
|
-- a,b here are http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:Route
|
||||||
|
-- return true if route "a" should be ordered before route "b"
|
||||||
function tsort (a, b)
|
function tsort (a, b)
|
||||||
return a:name() < b:name()
|
return a:name() < b:name()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- create a sortable list of tracks
|
||||||
local tracklist = {}
|
local tracklist = {}
|
||||||
for t in Session:get_tracks():iter() do
|
for t in Session:get_tracks():iter() do
|
||||||
table.insert(tracklist, t)
|
table.insert(tracklist, t)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- sort the list using the compare function
|
||||||
table.sort(tracklist, tsort)
|
table.sort(tracklist, tsort)
|
||||||
|
|
||||||
|
-- traverse the sorted list and assign "presentation-order" to each track
|
||||||
local pos = 1;
|
local pos = 1;
|
||||||
for _, t in ipairs(tracklist) do
|
for _, t in ipairs(tracklist) do
|
||||||
t:set_presentation_order(pos)
|
t:set_presentation_order(pos)
|
||||||
pos = pos + 1
|
pos = pos + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- drop all track references
|
||||||
tracklist = nil
|
tracklist = nil
|
||||||
collectgarbage ()
|
collectgarbage ()
|
||||||
end end
|
end end
|
||||||
|
Loading…
Reference in New Issue
Block a user