diff options
author | Robin Gareus <robin@gareus.org> | 2017-08-11 14:29:08 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-08-11 15:24:05 +0200 |
commit | f27e53f48543f364bd37764018b4710b465f0369 (patch) | |
tree | 2156debc0aa59480d0693fa21cdc43c42fdf9754 /scripts | |
parent | 62ce5465cadaa6cf7e315cb1dc2e61444bc19e01 (diff) |
Add support for scripted meta-templates.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/_template_example.lua | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/scripts/_template_example.lua b/scripts/_template_example.lua index e219cb209e..bf895dccf2 100644 --- a/scripts/_template_example.lua +++ b/scripts/_template_example.lua @@ -1,14 +1,27 @@ --- --- Session Template setup-hook +ardour { + ["type"] = "SessionSetup", + name = "Recording Session", + description = [[Add as many mono tracks to the new session as there are physical audio inputs and optionally record-arm them.]] +} + +---- For use with templates: Session Template setup-hook -- -- If a script named 'template.lua' exists in a session-template folder --- the `template_load` function of the script is called after +-- the `session_setup` function of the script is called after -- creating the session from the template. -- --- (e.g. ~/.config/ardour5/templates/Template-Name/template.lua +-- (e.g. ~/.config/ardour5/templates/Template-Name/template.lua) +-- +-- +---- For use as meta-session +-- +-- Every Lua script in the script-folder of type "SessionSetup" +-- is listed as implicit template in the new-session dialog. +-- The scripts 'session_setup' function is called once after +-- creating a new, empty session. -- -function template_load () +function session_setup () local e = Session:engine() -- from the engine's POV readable/capture ports are "outputs" local _, t = e:get_backend_ports ("", ARDOUR.DataType("audio"), ARDOUR.PortFlags.IsOutput | ARDOUR.PortFlags.IsPhysical, C.StringVector()) @@ -17,7 +30,7 @@ function template_load () local dialog_options = { { type = "heading", title = "Customize Session: " .. Session:name () }, - { type = "number", key = "tracks", title = "Create Tracks", min = 0, max = 128, step = 1, digits = 0, default = tracks }, + { type = "number", key = "tracks", title = "Create Tracks", min = 1, max = 128, step = 1, digits = 0, default = tracks }, { type = "checkbox", key = "recarm", default = false, title = "Record Arm Tracks" }, } |