2 ["type"] = "SessionInit",
3 name = "Advanced Session",
4 description = [[Allows to configure master-bus and autoconnect]],
8 function factory () return function ()
10 local auto_connect_in = {
12 [1] = "automatically to physical inputs",
15 local auto_connect_out = {
17 [1] = "automatically to physical outputs",
18 [2] = "automatically to master bus",
21 local dialog_options = {
22 { type = "heading", title = "Customize Session: " .. Session:name () },
23 { type = "number", key = "master", title = "Master bus channels", min = 0, max = 24, step = 1, digits = 0, default = 2 },
24 { type = "checkbox", key = "monitor", title = "Add monitor section", default = ARDOUR.config():get_use_monitor_bus () },
25 { type = "dropdown", key = "ac_input", title = "Autoconnect Inputs",
27 [auto_connect_in[0]] = 0,
28 [auto_connect_in[1]] = 1,
30 default = auto_connect_in[ARDOUR.config():get_input_auto_connect ()]
32 { type = "dropdown", key = "ac_output", title = "Autoconnect Outputs",
34 [auto_connect_out[0]] = 0,
35 [auto_connect_out[1]] = 1,
36 [auto_connect_out[2]] = 2,
38 default = auto_connect_out[ARDOUR.config():get_output_auto_connect ()]
42 local dlg = LuaDialog.Dialog ("Template Setup", dialog_options)
44 if (not rv) then return end
46 if rv['master'] > 0 then
47 local count = ARDOUR.ChanCount ( ARDOUR.DataType("audio"), rv['master'])
48 Session:add_master_bus (count)
52 Session:add_monitor_section ()
55 ARDOUR.config():set_input_auto_connect (rv['ac_input'])
56 ARDOUR.config():set_output_auto_connect (rv['ac_output'])
58 Session:save_state("");