Lua Script Example to toggle monitor section
authorRobin Gareus <robin@gareus.org>
Thu, 24 Aug 2017 00:56:33 +0000 (02:56 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 24 Aug 2017 00:56:33 +0000 (02:56 +0200)
scripts/_toggle_monitor_section.lua [new file with mode: 0644]

diff --git a/scripts/_toggle_monitor_section.lua b/scripts/_toggle_monitor_section.lua
new file mode 100644 (file)
index 0000000..f8f32c6
--- /dev/null
@@ -0,0 +1,12 @@
+ardour { ["type"] = "Snippet", name = "Toggle Monitor Section" }
+
+function factory () return function () 
+       if Session:monitor_out():isnil() then
+               Session:add_monitor_section ()
+               ARDOUR.config():set_use_monitor_bus (true)
+       else
+               Session:remove_monitor_section ()
+               ARDOUR.config():set_use_monitor_bus (false)
+               collectgarbage ()
+       end
+end end