-put method print_help() inside factory() (!) -nop / add comments

Signed-off-by: Thomas Brand <tom@trellis.ch>
This commit is contained in:
Thomas Brand 2016-08-30 21:55:15 +02:00 committed by Robin Gareus
parent 557bbcbfe7
commit f4751f1018

View file

@ -4,10 +4,14 @@ ardour { ["type"] = "EditorAction", name = "Tom's Loop",
description = [[Bounce the loop-range of all non muted audio tracks, paste N times at playhead]]
}
-- for minimal configuration in dialogue
-- ============================================================================
function action_params ()
return { ["times"] = { title = "Number of copies to add", default = "1"}, }
end
-- main method, every custom (i.e. non-ardour) method must be defined *inside* factory()
-- ============================================================================
function factory (params) return function ()
-- get options
local p = params or {}
@ -106,7 +110,7 @@ function factory (params) return function ()
end
::continue::
end
end -- for all routes
--advance playhead so it's just after the newly added regions
if n_regions_created > 0 then
@ -123,10 +127,9 @@ function factory (params) return function ()
print ("bounced " .. n_regions_created .. " regions from loop range (" .. loop:length() .. " frames) to playhead @ frame # " .. playhead)
::errorout::
end end
function print_help()
-- when this script is called as an action, the output will be printed to the ardour log window
-- ============================================================================
function print_help()
print("")
print("---------------------------------------------------------------------")
print("")
@ -175,6 +178,8 @@ function print_help()
print("")
print("-Close dialog \"Key Bindings\"")
print("")
print("An alternative way to quickly access a scripted action is to enable")
print("\"Action Script Button Visibility\" in \"Preferences/GUI\".")
print("")
print("---------------------------------------------------------------------")
print("")
@ -270,4 +275,7 @@ function print_help()
print("")
print("See also: Lua Action Bounce+Replace Regions")
print("")
end
end -- print_help()
::errorout::
end -- factory()
end -- end of lua script