mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-01 03:17:39 +01:00
Update Lua script to use new RouteGroup API
This commit is contained in:
parent
5abfc59dc1
commit
6eeed82fb3
11 changed files with 15 additions and 15 deletions
|
|
@ -45,7 +45,7 @@ function factory () return function ()
|
|||
for t,c in pairs (targets) do
|
||||
local rt = Session:route_by_name (t)
|
||||
if rt:isnil () then
|
||||
Session:new_audio_route (c, outputs, nil, 1, t, ARDOUR.PresentationInfo.Flag.AudioBus, ARDOUR.PresentationInfo.max_order)
|
||||
Session:new_audio_route (c, outputs, ARDOUR.RouteGroup(), 1, t, ARDOUR.PresentationInfo.Flag.AudioBus, ARDOUR.PresentationInfo.max_order)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ end
|
|||
function factory (p) return function ()
|
||||
local name = "Sweet16"
|
||||
local insert_at = ARDOUR.PresentationInfo.max_order
|
||||
local group = nil
|
||||
local group = ARDOUR.RouteGroup()
|
||||
|
||||
-- check for "MIDI Channel Map" LV2 from x42 midifilters.lv2
|
||||
if ARDOUR.LuaAPI.new_plugin_info ("http://gareus.org/oss/lv2/midifilter#channelmap", ARDOUR.PluginType.LV2):isnil () then
|
||||
|
|
@ -27,7 +27,7 @@ function factory (p) return function ()
|
|||
-- used from the AddRouteDialog (or w/action_params)
|
||||
name = p["name"] or 'Sweet16'
|
||||
insert_at = p["insert_at"] or ARDOUR.PresentationInfo.max_order;
|
||||
group = p["group"] or nil
|
||||
group = p["group"] or ARDOUR.RouteGroup()
|
||||
else
|
||||
-- used standalone, prompt for name and insert position
|
||||
local dialog_options = {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ function factory (p)
|
|||
local how_many = p["how_many"] or 1
|
||||
local channels = p["channels"] or 1
|
||||
local insert_at = p["insert_at"] or ARDOUR.PresentationInfo.max_order;
|
||||
local group = p["group"] or nil
|
||||
local group = p["group"] or ARDOUR.RouteGroup()
|
||||
local mode = p["track_mode"] or ARDOUR.TrackMode.Normal
|
||||
local strict_io = p["strict_io"] or false
|
||||
local chan_out = 0
|
||||
|
|
@ -108,7 +108,7 @@ function factory (p)
|
|||
end
|
||||
|
||||
-- create tracks
|
||||
local tl = Session:new_audio_track (chan_in, chan_out, nil, rv['tracks'], "", ARDOUR.PresentationInfo.max_order, ARDOUR.TrackMode.Normal)
|
||||
local tl = Session:new_audio_track (chan_in, chan_out, ARDOUR.RouteGroup(), rv['tracks'], "", ARDOUR.PresentationInfo.max_order, ARDOUR.TrackMode.Normal)
|
||||
-- and optionally record-arm them
|
||||
if rv['recarm'] then
|
||||
for track in tl:iter() do
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ function factory (params) return function ()
|
|||
local name = p["name"] or 'Audio'
|
||||
local how_many = p["how_many"] or 1
|
||||
local insert_at = p["insert_at"] or ARDOUR.PresentationInfo.max_order;
|
||||
local group = p["group"] or nil
|
||||
local group = p["group"] or ARDOUR.RouteGroup()
|
||||
local strict_io = p["strict_io"] or false
|
||||
local instrument = p["instrument"] or nil
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ function factory (params) return function ()
|
|||
if channels ~= 2 then goto next end
|
||||
|
||||
-- create 2 new tracks (using the name of the original track)(
|
||||
local newtracks = Session:new_audio_track (1, n_chan_out, nil, 2, t:name(), ARDOUR.PresentationInfo.max_order, ARDOUR.TrackMode.Normal, true)
|
||||
local newtracks = Session:new_audio_track (1, n_chan_out, ARDOUR.RouteGroup(), 2, t:name(), ARDOUR.PresentationInfo.max_order, ARDOUR.TrackMode.Normal, true)
|
||||
assert (newtracks:size() == 2)
|
||||
|
||||
for r in playlist:region_list ():iter () do
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ ardour {
|
|||
function factory () return function ()
|
||||
local sel = Editor:get_selection ()
|
||||
if not Editor:get_selection ():empty () and not Editor:get_selection ().tracks:routelist ():empty () then
|
||||
tr = Session:new_audio_track (1, 2, nil, 1, "Audio", Editor:get_selection ().tracks:routelist ():front():presentation_info_ptr ():order () + 1, ARDOUR.TrackMode.Normal, true)
|
||||
tr = Session:new_audio_track (1, 2, ARDOUR.RouteGroup(), 1, "Audio", Editor:get_selection ().tracks:routelist ():front():presentation_info_ptr ():order () + 1, ARDOUR.TrackMode.Normal, true)
|
||||
else
|
||||
tr = Session:new_audio_track (1, 2, nil, 1, "Audio", -1, ARDOUR.TrackMode.Normal, true)
|
||||
tr = Session:new_audio_track (1, 2, ARDOUR.RouteGroup(), 1, "Audio", -1, ARDOUR.TrackMode.Normal, true)
|
||||
end
|
||||
tr:front ():peak_meter ():set_meter_type (ARDOUR.MeterType.MeterKrms)
|
||||
|
||||
|
|
@ -63,4 +63,4 @@ end
|
|||
-- r: the route in question.
|
||||
function routePosition(r)
|
||||
return r:presentation_info_ptr():order()
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ function factory () return function ()
|
|||
|
||||
local i = 1
|
||||
while names[i] do
|
||||
local tl = Session:new_audio_track (1, 2, nil, 1, names[i],
|
||||
local tl = Session:new_audio_track (1, 2, ARDOUR.RouteGroup(), 1, names[i],
|
||||
ARDOUR.PresentationInfo.max_order,
|
||||
ARDOUR.TrackMode.Normal, true)
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ function factory () return function ()
|
|||
end
|
||||
|
||||
-- create a stereo track
|
||||
local newtracks = Session:new_audio_track (2, n_chan_out, nil, 1, "All Audio Sources", ARDOUR.PresentationInfo.max_order, ARDOUR.TrackMode.Normal, true)
|
||||
local newtracks = Session:new_audio_track (2, n_chan_out, ARDOUR.RouteGroup(), 1, "All Audio Sources", ARDOUR.PresentationInfo.max_order, ARDOUR.TrackMode.Normal, true)
|
||||
-- and get playlist of the new track
|
||||
-- https://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:Playlist
|
||||
local playlist = newtracks:front():playlist()
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ function factory (params) return function ()
|
|||
end
|
||||
|
||||
-- create two mono tracks
|
||||
local tl = Session:new_audio_track (1, chan_out, nil, 2, "Ducks", ARDOUR.PresentationInfo.max_order, ARDOUR.TrackMode.Normal, true)
|
||||
local tl = Session:new_audio_track (1, chan_out, ARDOUR.RouteGroup(), 2, "Ducks", ARDOUR.PresentationInfo.max_order, ARDOUR.TrackMode.Normal, true)
|
||||
for t in tl:iter() do
|
||||
t:set_strict_io (true)
|
||||
-- switch tracks to monitor input
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ function factory () return function ()
|
|||
end
|
||||
|
||||
if tracks:size () > 0 then
|
||||
local bus = Session:new_audio_route (chn, chn, nil, 1, "", ARDOUR.PresentationInfo.Flag.AudioBus, ARDOUR.PresentationInfo.max_order)
|
||||
local bus = Session:new_audio_route (chn, chn, ARDOUR.RouteGroup(), 1, "", ARDOUR.PresentationInfo.Flag.AudioBus, ARDOUR.PresentationInfo.max_order)
|
||||
if bus:size () > 0 then
|
||||
Session:add_internal_sends (bus:front (), ARDOUR.Placement.PostFader, tracks);
|
||||
end
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ function factory () return function ()
|
|||
end
|
||||
|
||||
-- create tracks
|
||||
local tl = Session:new_audio_track (1, 2, nil, rv['tracks'], "", ARDOUR.PresentationInfo.max_order, ARDOUR.TrackMode.Normal, true)
|
||||
local tl = Session:new_audio_track (1, 2, ARDOUR.RouteGroup(), rv['tracks'], "", ARDOUR.PresentationInfo.max_order, ARDOUR.TrackMode.Normal, true)
|
||||
-- and optionally record-arm them
|
||||
if rv['recarm'] then
|
||||
for track in tl:iter() do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue