mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 08:14:58 +01:00
NO-OP; clean up script spacing and remove goto
This commit is contained in:
parent
44852aa529
commit
8d8666d041
1 changed files with 9 additions and 11 deletions
|
|
@ -7,34 +7,32 @@ ardour { ["type"] = "EditorAction", name = "Send Tracks to Bus",
|
||||||
function factory () return function ()
|
function factory () return function ()
|
||||||
-- find number of channels to use for the new bus, follow master-bus' inputs
|
-- find number of channels to use for the new bus, follow master-bus' inputs
|
||||||
local chn = 2
|
local chn = 2
|
||||||
local mst = Session:master_out();
|
local mst = Session:master_out ();
|
||||||
if not mst:isnil() then
|
if not mst:isnil () then
|
||||||
chn = mst:n_inputs():n_audio()
|
chn = mst:n_inputs ():n_audio ()
|
||||||
end
|
end
|
||||||
mst = nil -- explicitly drop reference
|
mst = nil -- explicitly drop reference
|
||||||
|
|
||||||
local sel = Editor:get_selection () -- get selection
|
local sel = Editor:get_selection () -- get selection
|
||||||
local tracks = ARDOUR.RouteListPtr() -- create a new list
|
local tracks = ARDOUR.RouteListPtr () -- create a new list
|
||||||
|
|
||||||
-- find selected *tracks*, add to tracks list
|
-- find selected *tracks*, add to tracks list
|
||||||
for r in sel.tracks:routelist ():iter () do
|
for r in sel.tracks:routelist ():iter () do
|
||||||
if r:to_track():isnil() then
|
if not r:to_track ():isnil () then
|
||||||
goto next
|
tracks:push_back (r)
|
||||||
end
|
end
|
||||||
tracks:push_back (r)
|
|
||||||
::next::
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if tracks:size() > 0 then
|
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, nil, 1, "", ARDOUR.PresentationInfo.Flag.AudioBus, ARDOUR.PresentationInfo.max_order)
|
||||||
if bus:size () > 0 then
|
if bus:size () > 0 then
|
||||||
Session:add_internal_sends (bus:front(), ARDOUR.Placement.PostFader, tracks);
|
Session:add_internal_sends (bus:front (), ARDOUR.Placement.PostFader, tracks);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end end
|
end end
|
||||||
|
|
||||||
function icon (params) return function (ctx, width, height, fg)
|
function icon (params) return function (ctx, width, height, fg)
|
||||||
local txt = Cairo.PangoLayout (ctx, "ArdourMono ".. math.ceil(math.min (width, height) * .5) .. "px")
|
local txt = Cairo.PangoLayout (ctx, "ArdourMono ".. math.ceil (math.min (width, height) * .5) .. "px")
|
||||||
txt:set_text ("\u{2192}B") -- "->B"
|
txt:set_text ("\u{2192}B") -- "->B"
|
||||||
local tw, th = txt:get_pixel_size ()
|
local tw, th = txt:get_pixel_size ()
|
||||||
ctx:move_to (.5 * (width - tw), .5 * (height - th))
|
ctx:move_to (.5 * (width - tw), .5 * (height - th))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue