summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-02-15 18:12:51 +0100
committerRobin Gareus <robin@gareus.org>2017-02-15 18:12:51 +0100
commit61ae00ed237adb043821622171f6b09f23f1c82d (patch)
tree98aea781192a901353819720a9e21656a883fa16 /scripts
parent1f4d16fe0ff1251c7494cbc830fa71935e20d905 (diff)
Example lua script to re-order/reverse plugins
Diffstat (limited to 'scripts')
-rw-r--r--scripts/s_plugin_reorder.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/s_plugin_reorder.lua b/scripts/s_plugin_reorder.lua
new file mode 100644
index 0000000000..11fb0e056a
--- /dev/null
+++ b/scripts/s_plugin_reorder.lua
@@ -0,0 +1,23 @@
+ardour { ["type"] = "Snippet", name = "Plugin Order Reverse" }
+
+function factory () return function ()
+ local sel = Editor:get_selection ()
+ -- for each selected track/bus
+ for r in sel.tracks:routelist ():iter () do
+ print ("Route:", r:name ())
+ local neworder = ARDOUR.ProcessorList(); -- create a PluginList
+ local i = 0;
+ repeat -- iterate over all plugins/processors
+ local proc = r:nth_processor (i)
+ if not proc:isnil () then
+ -- append plugin to list
+ neworder:push_back(proc)
+ end
+ i = i + 1
+ until proc:isnil ()
+ -- reverse list
+ neworder:reverse()
+ -- and set new order
+ r:reorder_processors (neworder, nil)
+ end
+end end