summaryrefslogtreecommitdiff
path: root/scripts/mixer_settings_recall.lua
diff options
context:
space:
mode:
authorNikolaus Gullotta <nikolaus.gullotta@gmail.com>2018-08-17 08:47:51 -0500
committerNikolaus Gullotta <nikolaus.gullotta@gmail.com>2018-08-17 08:47:51 -0500
commite2e560ef06b4be7ac400d99fe1c6e45513db4bc0 (patch)
tree0cb24819d2ad0c041776f5408659f0487a23310e /scripts/mixer_settings_recall.lua
parent904d594712c158d4b90421fa0c479a2c36dbe67c (diff)
stop trying to guess plugin type, just ask the plugin during store-time
Diffstat (limited to 'scripts/mixer_settings_recall.lua')
-rw-r--r--scripts/mixer_settings_recall.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/mixer_settings_recall.lua b/scripts/mixer_settings_recall.lua
index a15333b1b4..a299c63f6b 100644
--- a/scripts/mixer_settings_recall.lua
+++ b/scripts/mixer_settings_recall.lua
@@ -60,11 +60,9 @@ function factory () return function ()
until proc:isnil()
end
- function new_plugin(name)
- for x = 0, 6 do
- local plugin = ARDOUR.LuaAPI.new_plugin(Session, name, x, "")
- if not(plugin:isnil()) then return plugin end
- end
+ function new_plugin(name, type)
+ local plugin = ARDOUR.LuaAPI.new_plugin(Session, name, type, "")
+ if not(plugin:isnil()) then return plugin end
end
function group_by_id(id)
@@ -187,9 +185,11 @@ function factory () return function ()
proc = Session:processor_by_id(PBD.ID(v))
end
if proc:isnil() then
- for id, name in pairs(cache) do
+ for id, sub_tbl in pairs(cache) do
+ local name = sub_tbl[1]
+ local type = sub_tbl[2]
if v == id then
- proc = new_plugin(name)
+ proc = new_plugin(name, type)
for _, control in pairs(well_known) do
if name == control then
proc = get_processor_by_name(rt, control)
@@ -253,6 +253,7 @@ function factory () return function ()
if string.find(label, "Assign") or string.find(label, "Enable") then --@ToDo: Check Plugin type == LADSPA or VST?
enable[k] = v --queue any assignments/enables for after the initial parameter recalling to duck the 'in-on-change' feature
end
+ print(string.format("%s (Port: %s) -> %s", label, k, v))
ARDOUR.LuaAPI.set_processor_param(proc, k, v)
end