mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
Example lua script to re-order/reverse plugins
This commit is contained in:
parent
1f4d16fe0f
commit
61ae00ed23
1 changed files with 23 additions and 0 deletions
23
scripts/s_plugin_reorder.lua
Normal file
23
scripts/s_plugin_reorder.lua
Normal file
|
|
@ -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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue