mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 16:46:35 +01:00
Update Route-template example script & documentation
This commit is contained in:
parent
be6abce398
commit
6edb3f8f9e
1 changed files with 21 additions and 5 deletions
|
|
@ -14,15 +14,17 @@ function route_setup ()
|
||||||
return
|
return
|
||||||
{
|
{
|
||||||
-- keys control which AddRouteDialog controls are made sensitive.
|
-- keys control which AddRouteDialog controls are made sensitive.
|
||||||
-- The following keys accept a default value to pre-seed the dialog
|
-- The following keys accept a default value to pre-seed the dialog.
|
||||||
['how_many'] = t[4]:size(),
|
['how_many'] = t[4]:size(),
|
||||||
['name'] = 'Audio',
|
['name'] = 'Audio',
|
||||||
['channels'] = 2,
|
['channels'] = 2,
|
||||||
-- these keys just need to be set (to something other than nil)
|
|
||||||
['insert_at'] = ARDOUR.PresentationInfo.max_order,
|
|
||||||
['group'] = false,
|
|
||||||
['track_mode'] = ARDOUR.TrackMode.Normal,
|
['track_mode'] = ARDOUR.TrackMode.Normal,
|
||||||
['strict_io'] = true,
|
['strict_io'] = true,
|
||||||
|
-- these keys just need to be set (to something other than nil)
|
||||||
|
-- in order to set the control sensitives
|
||||||
|
['insert_at'] = ARDOUR.PresentationInfo.max_order,
|
||||||
|
['group'] = false, -- return value will be a RouteGroup*
|
||||||
|
['instrument'] = nil, -- return value will be a PluginInfoPtr
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -38,6 +40,9 @@ end
|
||||||
|
|
||||||
|
|
||||||
function factory (params) return function ()
|
function factory (params) return function ()
|
||||||
|
-- When called from the AddRouteDialog, 'params' will be a table with
|
||||||
|
-- keys as described in route_setup() above.
|
||||||
|
|
||||||
local p = params or route_setup ()
|
local p = params or route_setup ()
|
||||||
local name = p["name"] or 'Audio'
|
local name = p["name"] or 'Audio'
|
||||||
local how_many = p["how_many"] or 1
|
local how_many = p["how_many"] or 1
|
||||||
|
|
@ -46,8 +51,19 @@ function factory (params) return function ()
|
||||||
local group = p["group"] or nil
|
local group = p["group"] or nil
|
||||||
local mode = p["track_mode"] or ARDOUR.TrackMode.Normal
|
local mode = p["track_mode"] or ARDOUR.TrackMode.Normal
|
||||||
local strict_io = p["strict_io"] or false
|
local strict_io = p["strict_io"] or false
|
||||||
|
local chan_out = 0
|
||||||
|
|
||||||
local tl = Session:new_audio_track (channels, channels, group, how_many, name, insert_at, mode)
|
if ARDOUR.config():get_output_auto_connect() == ARDOUR.AutoConnectOption.AutoConnectMaster then
|
||||||
|
if not Session:master_out():isnil() then
|
||||||
|
chan_out = Session:master_out():n_inputs ():n_audio ()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if chan_out == 0 then
|
||||||
|
chan_out = channels;
|
||||||
|
end
|
||||||
|
|
||||||
|
local tl = Session:new_audio_track (channels, chan_out, group, how_many, name, insert_at, mode)
|
||||||
|
|
||||||
if strict_io then
|
if strict_io then
|
||||||
for t in tl:iter() do
|
for t in tl:iter() do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue