diff options
author | Nikolaus Gullotta <nikolaus.gullotta@gmail.com> | 2018-06-01 09:51:52 -0500 |
---|---|---|
committer | Nikolaus Gullotta <nikolaus.gullotta@gmail.com> | 2018-06-01 09:52:53 -0500 |
commit | 37fe6b8ba1f0714d362f337b2fd3a63739d41fc1 (patch) | |
tree | 8fba77ad6b0878e50bb71f288a7fe6f329bf9d9d /scripts | |
parent | 523f8b4ba41a9bc225ab0051e92158984f774853 (diff) |
Check-in of set_meter_point() utility/example
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/meter_tap.lua | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/scripts/meter_tap.lua b/scripts/meter_tap.lua new file mode 100644 index 0000000000..925fe373af --- /dev/null +++ b/scripts/meter_tap.lua @@ -0,0 +1,48 @@ +ardour { + ["type"] = "EditorAction", + name = "Meter Tap", + author = "Ardour Lua Taskforce", + description = [[Change Metering Point for tracks in your session.]] +} + +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() + + meter_point = rv['select'] + if rv['select-tracks'] then + local sel = 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 + route:to_track():set_meter_point(meter_point, false) + end + end + end + end + + 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 |