13
0
livetrax/share/scripts/_add_gx_tuner.lua
2022-01-30 13:15:19 +01:00

22 lines
785 B
Lua

ardour {
["type"] = "EditorAction",
name = "Add Guitarix Instrument Tuner",
license = "GPL",
author = "Vincent Tassy",
description = [[Adds a tuner on the current track]]
}
function factory () return function ()
local sel = Editor:get_selection ()
if not Editor:get_selection ():empty () and not Editor:get_selection ().tracks:routelist ():empty () then
-- for each selected track
for r in sel.tracks:routelist ():iter () do
if not r:to_track ():isnil () and not r:to_track ():to_audio_track ():isnil () then
local proc = ARDOUR.LuaAPI.new_plugin(Session, "http://guitarix.sourceforge.net/plugins/gxtuner#tuner", ARDOUR.PluginType.LV2, "");
assert (not proc:isnil())
r:add_processor_by_index(proc, 0, nil, true)
end
end
end
end end