2018-06-01 10:51:52 -04:00
|
|
|
ardour {
|
|
|
|
["type"] = "EditorAction",
|
2020-04-23 23:47:02 -04:00
|
|
|
name = "Meter Point",
|
2018-06-01 10:51:52 -04:00
|
|
|
author = "Ardour Lua Taskforce",
|
2020-04-23 23:47:02 -04:00
|
|
|
description = [[Batch change metering point for selected or tracks in the given session.]]
|
2018-06-01 10:51:52 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
function factory () return function ()
|
|
|
|
|
|
|
|
local dialog_options = {
|
|
|
|
{ type = "label", colspan = 5, title = "" },
|
|
|
|
{ type = "radio", col = 1, colspan = 7, key = "select", title = "", values ={ ["Set All: Input"] = ARDOUR.MeterPoint.MeterInput, ["Set All: Pre Fader"] = ARDOUR.MeterPoint.MeterPreFader, ["Set All: Post Fader"] = ARDOUR.MeterPoint.MeterPostFader, ["Set All: Output"] = ARDOUR.MeterPoint.MeterOutput, ["Set All: Custom"] = ARDOUR.MeterPoint.MeterCustom}, default = "Set All: Input"},
|
|
|
|
{ type = "label", colspan = 5, title = "" },
|
|
|
|
{ type = "checkbox", col=1, colspan = 1, key = "select-tracks", default = true, title = "Selected tracks only"},
|
|
|
|
{ type = "checkbox", col=2, colspan = 1, key = "rec-tracks", default = true, title = "Record Enabled tracks only"},
|
|
|
|
{ type = "label", colspan = 5, title = "" },
|
|
|
|
}
|
|
|
|
|
|
|
|
local rv = LuaDialog.Dialog("Change all Meter Taps:", dialog_options):run()
|
2019-04-08 10:12:19 -04:00
|
|
|
if not rv then return end -- user cancelled
|
|
|
|
|
|
|
|
local rl;
|
|
|
|
if rv['select-tracks'] then
|
2020-07-21 21:54:27 -04:00
|
|
|
rl = Editor:get_selection ().tracks:routelist ()
|
2019-04-08 10:12:19 -04:00
|
|
|
else
|
|
|
|
rl = Session:get_routes()
|
|
|
|
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)
|
2018-06-01 10:51:52 -04:00
|
|
|
end
|
2019-04-08 10:12:19 -04:00
|
|
|
else
|
|
|
|
route:to_track():set_meter_point(meter_point, false)
|
2018-06-01 10:51:52 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end end
|