Video-Frame (not sample)
[ardour.git] / scripts / _calc_dsp_statistics.lua
1 ardour { ["type"] = "Snippet", name = "Calculate DSP stats",
2         license     = "MIT",
3         author      = "Ardour Team",
4 }
5
6 function factory () return function ()
7
8         for t in Session:get_routes ():iter () do
9                 local i = 0
10                 while true do
11                         local rv, stats
12                         local proc = t:nth_processor (i)
13                         if proc:isnil () then break end
14                         if proc:to_plugininsert():isnil() then goto continue end
15
16                         rv, stats = proc:to_plugininsert():get_stats (0, 0, 0, 0)
17                         if not rv then goto continue end
18
19                         print (string.format (" * %-28s | min: %.2f max: %.2f avg: %.3f std-dev: %.3f [ms]",
20                                 string.sub (proc:name() .. '  (' .. t:name() .. ')', 0, 28),
21                                 stats[1] / 1000.0, stats[2] / 1000.0, stats[3] / 1000.0, stats[4] / 1000.0))
22
23                         ::continue::
24                         i = i + 1
25                 end
26         end
27 end end