Contributing example LUA scripts

This commit is contained in:
tassyv 2022-01-29 14:05:46 +01:00 committed by Robin Gareus
parent 97fe05e4de
commit dab85fd309
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
9 changed files with 280 additions and 0 deletions

View file

@ -0,0 +1,21 @@
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