X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=scripts%2Faddscopes.lua;h=5ff40a7da81b2aeffb0070622cceb42d55fccb5d;hb=a9d2955f833fc568733d11561ec1156ae3f9a1da;hp=8ac1519ee41ab6076ed9b1e215526afd07708578;hpb=9ed7793326e658af2edc6db059f6137713d8aa82;p=ardour.git diff --git a/scripts/addscopes.lua b/scripts/addscopes.lua index 8ac1519ee4..5ff40a7da8 100644 --- a/scripts/addscopes.lua +++ b/scripts/addscopes.lua @@ -2,9 +2,7 @@ ardour { ["type"] = "EditorAction", name = "Add Scopes", license = "MIT", - author = "Robin Gareus", - email = "robin@gareus.org", - site = "http://gareus.org", + author = "Ardour Team", description = [[Add 'Inline Scope' Lua Processor to all Tracks]] } @@ -36,7 +34,7 @@ function factory (params) -- get Nth Ardour::Processor proc = t:nth_plugin (i) -- check if it's a scope - if (not proc:isnil() and proc:display_name () == "Inline Scope") then + if (not proc:isnil() and proc:display_name () == "a-Inline Scope") then insert = false; end i = i + 1 @@ -45,7 +43,7 @@ function factory (params) -- create a new processor and insert it if insert then - local a = ARDOUR.LuaAPI.new_luaproc(Session, "Inline Scope"); + local a = ARDOUR.LuaAPI.new_luaproc(Session, "a-Inline Scope"); if (not a:isnil()) then t:add_processor_by_index(a, pos, nil, true) ARDOUR.LuaAPI.set_processor_param (a, 0, 5) -- timescale 5sec @@ -57,3 +55,20 @@ function factory (params) end end end + + +function icon (params) return function (ctx, width, height) + local wh = math.min (width, height) * .5 + local x0 = math.ceil (wh * .4) + local x1 = math.floor (wh * 1.6) + ctx:rectangle (wh * .4, wh * .4, wh * 1.2, wh * 1.2) + ctx:set_source_rgba (.7, .7, .7, 1) + ctx:fill () + ctx:set_line_width (1) + ctx:set_source_rgba (.0, .0, .0, 1) + ctx:move_to (x0, wh) + for x = x0, x1 do + ctx:line_to (x, wh - math.sin (2 * math.pi * (x-x0) / (x1-x0)) * wh * .5) + end + ctx:stroke () +end end