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 uniq = params["unique"] or "yes"
24 local pos = params["position"] or 0
26 -- loop over all tracks
27 for t in Session:get_tracks():iter() do
30 -- check if a scope is already present
35 -- get Nth Ardour::Processor
36 proc = t:nth_plugin (i)
37 -- check if it's a scope
38 if (not proc:isnil() and proc:display_name () == "Inline Scope") then
42 until proc:isnil() or insert == false
45 -- create a new processor and insert it
47 local a = ARDOUR.LuaAPI.new_luaproc(Session, "Inline Scope");
48 if (not a:isnil()) then
49 t:add_processor_by_index(a, pos, nil, true)
50 ARDOUR.LuaAPI.set_processor_param (a, 0, 5) -- timescale 5sec
51 -- ARDOUR.LuaAPI.set_processor_param (a, 1, 1) -- logscale on
52 -- ARDOUR.LuaAPI.set_processor_param (a, 2, 3) -- "Max" height
53 a = nil -- explicitly drop shared-ptr reference