Initial check in of EditorHook script transparent_regions.lua
authorNikolaus Gullotta <nikolaus.gullotta@gmail.com>
Tue, 6 Mar 2018 16:45:55 +0000 (10:45 -0600)
committerNikolaus Gullotta <nikolaus.gullotta@gmail.com>
Tue, 6 Mar 2018 16:45:55 +0000 (10:45 -0600)
scripts/transparent_regions.lua [new file with mode: 0644]

diff --git a/scripts/transparent_regions.lua b/scripts/transparent_regions.lua
new file mode 100644 (file)
index 0000000..7db81fb
--- /dev/null
@@ -0,0 +1,28 @@
+ardour {
+       ["type"]    = "EditorHook",
+       name        = "Make all Regions Transparent",
+       author      = "Ardour Lua Task Force",
+       description = "While the transport is looping, all regions become transparent.",
+}
+
+function signals ()
+       return LuaSignal.Set():add (
+               {
+                       [LuaSignal.TransportStateChange] = true,
+                       [LuaSignal.TransportLooped] = true,
+               }
+       )
+end
+
+function factory ()
+       return function (signal, ref, ...)
+       local all_regions = ARDOUR.RegionFactory.regions()
+       for _, r in all_regions:iter() do
+               local ar = r:to_audioregion ();
+               if ar:isnil () then goto next end
+               if ar:opaque () then 
+                       ar:set_opaque (false)
+               end
+               ::next::
+       end
+end end
\ No newline at end of file