From 842faa5b6ea56456b6740fe4f06173b914b55db8 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 19 Mar 2019 05:32:12 +0100 Subject: [PATCH] Add example script to list Playlists --- scripts/_dump_playlists.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 scripts/_dump_playlists.lua diff --git a/scripts/_dump_playlists.lua b/scripts/_dump_playlists.lua new file mode 100644 index 0000000000..a6bc23661a --- /dev/null +++ b/scripts/_dump_playlists.lua @@ -0,0 +1,27 @@ +ardour { ["type"] = "Snippet", name = "Dump Playlists" } + +function factory () return function () + + print ("Number of playlists:", Session:playlists():n_playlists()) + + print () + print ("Used playlists:") + for p in Session:playlists():get_used():iter() do + print ("-", p:name(), p:n_regions()) + end + + print () + print ("Unused playlists:") + for p in Session:playlists():get_unused():iter() do + print ("-", p:name(), p:n_regions()) + end + + print () + print ("Playlists by Track:") + for r in Session:get_tracks():iter() do + print ("*", r:name()) + for p in Session:playlists():playlists_for_track (r:to_track()):iter() do + print (" -", p:name(), p:n_regions()) + end + end +end end