remove long-lived bug that tried to make a non-existent action insensitive
[ardour.git] / scripts / mute_all_tracks.lua
1 ardour {
2         ["type"]    = "EditorAction",
3         name        = "Mute All Tracks",
4         license     = "MIT",
5         author      = "Ardour Team",
6         description = [[Mute All Tracks in the Session]]
7 }
8
9 function factory () return function ()
10         local ctrls = ARDOUR.ControlListPtr () -- create a list of controls to change
11
12         for r in Session:get_tracks ():iter () do -- iterate over all tracks in the session
13                 ctrls:push_back (r:mute_control()) -- add the track's mute-control to the list of of controls to be changed
14         end
15
16         -- of more than one control is to be changed..
17         if ctrls:size() > 0 then
18                 -- do it (queue change in realtime-context) set to "1" ; here 'muted'
19                 Session:set_controls (ctrls, 1, PBD.GroupControlDisposition.NoGroup)
20         end
21 end end