mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 16:24:57 +01:00
Update mixer Store/Recall to work with new published bus controls
This commit is contained in:
parent
6069c870f8
commit
327cd513d3
2 changed files with 80 additions and 29 deletions
|
|
@ -159,7 +159,8 @@ function factory ()
|
||||||
local group = instance["group"]
|
local group = instance["group"]
|
||||||
local group_name = instance["group_name"]
|
local group_name = instance["group_name"]
|
||||||
local name = instance["route_name"]
|
local name = instance["route_name"]
|
||||||
local gc, tc, pc = instance["gain_control"], instance["trim_control"], instance["pan_control"]
|
local gc, tc, pc = instance["gain_control"], instance["trim_control"], instance["pan_control"]
|
||||||
|
local sends = instance["sends"]
|
||||||
|
|
||||||
if not(substitution == instance["route_id"]) then
|
if not(substitution == instance["route_id"]) then
|
||||||
print('SUBSTITUTION FOR: ', name, substitution, Session:route_by_id(PBD.ID(substitution)):name())
|
print('SUBSTITUTION FOR: ', name, substitution, Session:route_by_id(PBD.ID(substitution)):name())
|
||||||
|
|
@ -170,7 +171,29 @@ function factory ()
|
||||||
|
|
||||||
local rt = Session:route_by_id(r_id)
|
local rt = Session:route_by_id(r_id)
|
||||||
if rt:isnil() then rt = Session:route_by_name(name) end
|
if rt:isnil() then rt = Session:route_by_name(name) end
|
||||||
if rt:isnil() then goto nextline end
|
if rt:isnil() then goto nextline end
|
||||||
|
|
||||||
|
if sends then
|
||||||
|
for i, data in pairs(sends) do
|
||||||
|
i = i-1
|
||||||
|
for j, ctrl in pairs({
|
||||||
|
rt:send_level_controllable(i),
|
||||||
|
rt:send_enable_controllable(i),
|
||||||
|
rt:send_pan_azimuth_controllable(i),
|
||||||
|
rt:send_pan_azimuth_enable_controllable(i),
|
||||||
|
}) do
|
||||||
|
if not(ctrl:isnil()) then
|
||||||
|
local value = data[j]
|
||||||
|
if value then
|
||||||
|
if debug then
|
||||||
|
print("Setting " .. ctrl:name() .. " to value " .. value)
|
||||||
|
end
|
||||||
|
ctrl:set_value(value, PBD.GroupControlDisposition.NoGroup)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local cur_group_id = route_groupid_interrogate(rt)
|
local cur_group_id = route_groupid_interrogate(rt)
|
||||||
if not(group) and (cur_group_id) then
|
if not(group) and (cur_group_id) then
|
||||||
|
|
|
||||||
|
|
@ -125,34 +125,35 @@ function factory () return function ()
|
||||||
empty_last_store(path)
|
empty_last_store(path)
|
||||||
|
|
||||||
local route_string = [[instance = {
|
local route_string = [[instance = {
|
||||||
route_id = %d,
|
route_id = %d,
|
||||||
route_name = '%s',
|
route_name = '%s',
|
||||||
gain_control = %s,
|
gain_control = %s,
|
||||||
trim_control = %s,
|
trim_control = %s,
|
||||||
pan_control = %s,
|
pan_control = %s,
|
||||||
muted = %s,
|
sends = {%s},
|
||||||
soloed = %s,
|
muted = %s,
|
||||||
order = {%s},
|
soloed = %s,
|
||||||
cache = {%s},
|
order = {%s},
|
||||||
group = %s,
|
cache = {%s},
|
||||||
group_name = '%s',
|
group = %s,
|
||||||
pi_order = %d
|
group_name = '%s',
|
||||||
|
pi_order = %d
|
||||||
}]]
|
}]]
|
||||||
|
|
||||||
local group_string = [[instance = {
|
local group_string = [[instance = {
|
||||||
group_id = %s,
|
group_id = %s,
|
||||||
name = '%s',
|
name = '%s',
|
||||||
routes = {%s},
|
routes = {%s},
|
||||||
}]]
|
}]]
|
||||||
|
|
||||||
local processor_string = [[instance = {
|
local processor_string = [[instance = {
|
||||||
plugin_id = %d,
|
plugin_id = %d,
|
||||||
type = %d,
|
type = %d,
|
||||||
display_name = '%s',
|
display_name = '%s',
|
||||||
owned_by_route_name = '%s',
|
owned_by_route_name = '%s',
|
||||||
owned_by_route_id = %d,
|
owned_by_route_id = %d,
|
||||||
parameters = {%s},
|
parameters = {%s},
|
||||||
active = %s,
|
active = %s,
|
||||||
}]]
|
}]]
|
||||||
|
|
||||||
local group_route_string = " [%d] = %s,"
|
local group_route_string = " [%d] = %s,"
|
||||||
|
|
@ -161,9 +162,9 @@ function factory () return function ()
|
||||||
local params_string = " [%d] = %s,"
|
local params_string = " [%d] = %s,"
|
||||||
|
|
||||||
--ensure easy-to-read formatting doesn't make it through
|
--ensure easy-to-read formatting doesn't make it through
|
||||||
local route_string = string.gsub(route_string, "[\n\t]", "")
|
local route_string = string.gsub(route_string, "[\n\t%s]", "")
|
||||||
local group_string = string.gsub(group_string, "[\n\t]", "")
|
local group_string = string.gsub(group_string, "[\n\t%s]", "")
|
||||||
local processor_string = string.gsub(processor_string, "[\n\t]", "")
|
local processor_string = string.gsub(processor_string, "[\n\t%s]", "")
|
||||||
|
|
||||||
local sel = Editor:get_selection ()
|
local sel = Editor:get_selection ()
|
||||||
local groups_to_write = {}
|
local groups_to_write = {}
|
||||||
|
|
@ -225,7 +226,33 @@ function factory () return function ()
|
||||||
if route_group then route_group = route_group:name() else route_group = "" end
|
if route_group then route_group = route_group:name() else route_group = "" end
|
||||||
local rid = r:to_stateful():id():to_s()
|
local rid = r:to_stateful():id():to_s()
|
||||||
local pan = r:pan_azimuth_control()
|
local pan = r:pan_azimuth_control()
|
||||||
if pan:isnil() then pan = false else pan = pan:get_value() end --sometimes a route doesn't have pan, like the master.
|
if pan:isnil() then pan = false else pan = pan:get_value() end --sometimes a route doesn't have pan, like the master.
|
||||||
|
|
||||||
|
-- Get send information, if any.
|
||||||
|
local send_string = ""
|
||||||
|
local i = 0
|
||||||
|
repeat
|
||||||
|
local fmt = "{%s, %s, %s, %s}"
|
||||||
|
string.gsub(fmt, "[\n\t]", "")
|
||||||
|
local values = {}
|
||||||
|
for j, ctrl in pairs({
|
||||||
|
r:send_level_controllable(i),
|
||||||
|
r:send_enable_controllable(i),
|
||||||
|
r:send_pan_azimuth_controllable(i),
|
||||||
|
r:send_pan_azimuth_enable_controllable(i),
|
||||||
|
}) do
|
||||||
|
if not(ctrl:isnil()) then
|
||||||
|
values[#values + 1] = ctrl:get_value()
|
||||||
|
else
|
||||||
|
values[#values + 1] = "nil"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
send_string = send_string .. string.format(fmt, table.unpack(values))
|
||||||
|
send_string = send_string .. ","
|
||||||
|
i = i + 1
|
||||||
|
until r:send_enable_controllable(i):isnil()
|
||||||
|
|
||||||
|
print(send_string)
|
||||||
|
|
||||||
local order_nmbr = 0
|
local order_nmbr = 0
|
||||||
local tmp_order_str, tmp_cache_str = "", ""
|
local tmp_order_str, tmp_cache_str = "", ""
|
||||||
|
|
@ -250,7 +277,8 @@ function factory () return function ()
|
||||||
r:name(),
|
r:name(),
|
||||||
ARDOUR.LuaAPI.ascii_dtostr(r:gain_control():get_value()),
|
ARDOUR.LuaAPI.ascii_dtostr(r:gain_control():get_value()),
|
||||||
ARDOUR.LuaAPI.ascii_dtostr(r:trim_control():get_value()),
|
ARDOUR.LuaAPI.ascii_dtostr(r:trim_control():get_value()),
|
||||||
tostring(pan),
|
tostring(pan),
|
||||||
|
send_string,
|
||||||
r:muted(),
|
r:muted(),
|
||||||
r:soloed(),
|
r:soloed(),
|
||||||
tmp_order_str,
|
tmp_order_str,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue