summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNikolaus Gullotta <nik@harrisonconsoles.com>2020-02-03 16:07:13 -0600
committerNikolaus Gullotta <nik@harrisonconsoles.com>2020-02-03 16:07:13 -0600
commit00d1a0ed4d85ce72cf4efc30c30c54d38bb36fc5 (patch)
tree22c6a3628d6315cfb853fd8e98f4080714d72c84 /scripts
parenta655997749dcff0163c1fc4fc7702463662d1b07 (diff)
Mixer Reset now resets automation state of all plugin inserts
Diffstat (limited to 'scripts')
-rw-r--r--scripts/reset_mixer.lua23
1 files changed, 20 insertions, 3 deletions
diff --git a/scripts/reset_mixer.lua b/scripts/reset_mixer.lua
index 12b4881061..faf7aad477 100644
--- a/scripts/reset_mixer.lua
+++ b/scripts/reset_mixer.lua
@@ -8,7 +8,6 @@ ardour {
function factory() return function()
local sp_radio_buttons = {Bypass="bypass", Remove="remove", Nothing=false}
- local am_radio_buttons = {}
local dlg = {
{type="label", align="left", colspan="3", title="Please select below the items you want to reset:" },
{type="label", align="left", colspan="3", title="(Warning: this cannot be undone!)\n" },
@@ -111,7 +110,22 @@ function factory() return function()
until route:send_enable_controllable(i):isnil()
end
- function reset_plugins(route, prefs)
+ function reset_plugin_automation(plugin, state)
+ if plugin:to_insert():isnil() then
+ return
+ end
+
+ local plugin = plugin:to_insert()
+ local pc = plugin:plugin(0):parameter_count()
+ for c = 0, pc do
+ local ac = plugin:to_automatable():automation_control(Evoral.Parameter(ARDOUR.AutomationType.PluginAutomation, 0, c), false)
+ if not(ac:isnil()) then
+ ac:set_automation_state(state)
+ end
+ end
+ end
+
+ function reset_plugins(route, prefs, auto)
if route:isnil() then
return
end
@@ -122,6 +136,9 @@ function factory() return function()
-- Plugins are queued to not invalidate this loop
local proc = route:nth_processor(i)
if not(proc:isnil()) then
+ if prefs["auto"] then
+ reset_plugin_automation(proc, auto)
+ end
if prefs["plugins"] then
local insert = proc:to_insert()
if not(insert:isnil()) then
@@ -177,7 +194,7 @@ function factory() return function()
if pref["eq"] then reset_eq_controls(route, disp, auto) end
if pref["comp"] then reset_comp_controls(route, disp, auto) end
if pref["sends"] then reset_send_controls(route, disp, auto) end
- reset_plugins(route, pref)
+ reset_plugins(route, pref, auto)
if pref["rec"] then
reset(route:rec_enable_control(), disp, auto)