summaryrefslogtreecommitdiff
path: root/share/scripts/mute_all_tracks.lua
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-02-23 20:48:02 +0100
committerRobin Gareus <robin@gareus.org>2020-02-23 20:48:02 +0100
commit180843f9bd28b191c7404245ba0a121107992511 (patch)
treec60312dc09f76c2f55ba2383245c427e15c38dea /share/scripts/mute_all_tracks.lua
parentbf649cd68ad46c34a656700aa6cb89416d648c64 (diff)
Also move Lua scripts to share subfolder
Diffstat (limited to 'share/scripts/mute_all_tracks.lua')
-rw-r--r--share/scripts/mute_all_tracks.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/share/scripts/mute_all_tracks.lua b/share/scripts/mute_all_tracks.lua
new file mode 100644
index 0000000000..e15c0530c0
--- /dev/null
+++ b/share/scripts/mute_all_tracks.lua
@@ -0,0 +1,21 @@
+ardour {
+ ["type"] = "EditorAction",
+ name = "Mute All Tracks",
+ license = "MIT",
+ author = "Ardour Team",
+ description = [[Mute All Tracks in the Session]]
+}
+
+function factory () return function ()
+ local ctrls = ARDOUR.ControlListPtr () -- create a list of controls to change
+
+ for r in Session:get_tracks ():iter () do -- iterate over all tracks in the session
+ ctrls:push_back (r:mute_control()) -- add the track's mute-control to the list of of controls to be changed
+ end
+
+ -- of more than one control is to be changed..
+ if ctrls:size() > 0 then
+ -- do it (queue change in realtime-context) set to "1" ; here 'muted'
+ Session:set_controls (ctrls, 1, PBD.GroupControlDisposition.NoGroup)
+ end
+end end