2 ["type"] = "EditorAction",
5 author = "Ardour Team",
6 description = [[Add 'Inline Scope' Lua Processor to all Tracks]]
9 function action_params ()
12 ["unique"] = { title = "Only add Scope if non is present already (yes/no)", default = "yes"},
13 ["position"] = { title = "Insert Position from top (0,..)", default = "0"},
18 function factory (params)
21 local p = params or {}
22 local uniq = p["unique"] or "yes"
23 local pos = p["position"] or 0
25 -- loop over all tracks
26 for t in Session:get_tracks():iter() do
29 -- check if a scope is already present
34 -- get Nth Ardour::Processor
35 proc = t:nth_plugin (i)
36 -- check if it's a scope
37 if (not proc:isnil() and proc:display_name () == "Inline Scope") then
41 until proc:isnil() or insert == false
44 -- create a new processor and insert it
46 local a = ARDOUR.LuaAPI.new_luaproc(Session, "Inline Scope");
47 if (not a:isnil()) then
48 t:add_processor_by_index(a, pos, nil, true)
49 ARDOUR.LuaAPI.set_processor_param (a, 0, 5) -- timescale 5sec
50 -- ARDOUR.LuaAPI.set_processor_param (a, 1, 1) -- logscale on
51 -- ARDOUR.LuaAPI.set_processor_param (a, 2, 3) -- "Max" height
52 a = nil -- explicitly drop shared-ptr reference