mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 00:34:59 +01:00
Cleaup meter-tap: reduce nesting and remove code-dup
This commit is contained in:
parent
3ec261ae5d
commit
57616fdb11
1 changed files with 18 additions and 26 deletions
|
|
@ -17,34 +17,26 @@ function factory () return function ()
|
||||||
}
|
}
|
||||||
|
|
||||||
local rv = LuaDialog.Dialog("Change all Meter Taps:", dialog_options):run()
|
local rv = LuaDialog.Dialog("Change all Meter Taps:", dialog_options):run()
|
||||||
if rv then
|
if not rv then return end -- user cancelled
|
||||||
meter_point = rv['select']
|
|
||||||
|
local rl;
|
||||||
if rv['select-tracks'] then
|
if rv['select-tracks'] then
|
||||||
local sel = Editor:get_selection ()
|
rl = Editor:get_selection ()
|
||||||
for route in sel.tracks:routelist():iter() do
|
|
||||||
if not(route:to_track():isnil()) then
|
|
||||||
if rv['rec-tracks'] then
|
|
||||||
if route:rec_enable_control():get_value() == 1.0 then
|
|
||||||
route:to_track():set_meter_point(meter_point, false)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
route:to_track():set_meter_point(meter_point, false)
|
rl = Session:get_routes()
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
for route in Session:get_routes():iter() do
|
|
||||||
if not(route:to_track():isnil()) then
|
|
||||||
if rv['rec-tracks'] then
|
|
||||||
if route:rec_enable_control():get_value() == 1.0 then
|
|
||||||
route:to_track():set_meter_point(meter_point, false)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
route:to_track():set_meter_point(meter_point, false)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local meter_point = rv['select']
|
||||||
|
|
||||||
|
for route in rl:iter() do
|
||||||
|
if not(route:to_track():isnil()) then
|
||||||
|
if rv['rec-tracks'] then
|
||||||
|
if route:rec_enable_control():get_value() == 1.0 then
|
||||||
|
route:to_track():set_meter_point(meter_point, false)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
route:to_track():set_meter_point(meter_point, false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end end
|
end end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue