2 ["type"] = "EditorAction",
5 author = "Robin Gareus",
6 email = "robin@gareus.org",
7 site = "http://gareus.org",
8 description = [[Add 'Inline Scope' Lua Processor to all Tracks]]
11 function action_params ()
14 ["unique"] = { title = "Only add Scope if non is present already (yes/no)", default = "yes"},
15 ["position"] = { title = "Insert Position from top (0,..)", default = "0"},
20 function factory (params)
23 local p = params or {}
24 local uniq = p["unique"] or "yes"
25 local pos = p["position"] or 0
27 -- loop over all tracks
28 for t in Session:get_tracks():iter() do
31 -- check if a scope is already present
36 -- get Nth Ardour::Processor
37 proc = t:nth_plugin (i)
38 -- check if it's a scope
39 if (not proc:isnil() and proc:display_name () == "Inline Scope") then
43 until proc:isnil() or insert == false
46 -- create a new processor and insert it
48 local a = ARDOUR.LuaAPI.new_luaproc(Session, "Inline Scope");
49 if (not a:isnil()) then
50 t:add_processor_by_index(a, pos, nil, true)
51 ARDOUR.LuaAPI.set_processor_param (a, 0, 5) -- timescale 5sec
52 -- ARDOUR.LuaAPI.set_processor_param (a, 1, 1) -- logscale on
53 -- ARDOUR.LuaAPI.set_processor_param (a, 2, 3) -- "Max" height
54 a = nil -- explicitly drop shared-ptr reference