-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release Remove hardware outputs of selected tracks v1.0.1 (#1381)
Optimize processing in projects with high track counts
- Loading branch information
Showing
1 changed file
with
11 additions
and
8 deletions.
There are no files selected for viewing
19 changes: 11 additions & 8 deletions
19
Tracks Properties/cfillion_Remove hardware outputs of selected tracks.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
-- @description Remove hardware outputs of selected tracks | ||
-- @version 1.0 | ||
-- @author cfillion | ||
-- @website http://forum.cockos.com/showthread.php?t=189761 | ||
-- @donation https://www.paypal.me/cfillion | ||
-- @version 1.0.1 | ||
-- @changelog Optimize processing in projects with high track counts | ||
-- @link http://forum.cockos.com/showthread.php?t=189761 | ||
-- @donation https://reapack.com/donate | ||
|
||
local self = ({reaper.get_action_context()})[2]:match('([^/\\_]+).lua$') | ||
local SCRIPT_NAME = select(2, reaper.get_action_context()):match('([^/\\_]+).lua$') | ||
local UNDO_STATE_TRACKCFG = 1 | ||
local HARDWARE_OUT = 1 -- > 0 | ||
|
||
local seltracks = reaper.CountSelectedTracks() | ||
if seltracks < 1 then return reaper.defer(function() end) end | ||
|
||
reaper.PreventUIRefresh(1) | ||
reaper.Undo_BeginBlock() | ||
|
||
for ti=0, seltracks-1 do | ||
local track = reaper.GetSelectedTrack(0, ti) | ||
for si=0, reaper.GetTrackNumSends(track, HARDWARE_OUT)-1 do | ||
for ti = 0, seltracks - 1 do | ||
local track = reaper.GetSelectedTrack(nil, ti) | ||
for si = 0, reaper.GetTrackNumSends(track, HARDWARE_OUT) - 1 do | ||
reaper.RemoveTrackSend(track, HARDWARE_OUT, 0) | ||
end | ||
end | ||
|
||
reaper.Undo_EndBlock(self, UNDO_STATE_TRACKCFG) | ||
reaper.Undo_EndBlock(SCRIPT_NAME, UNDO_STATE_TRACKCFG) | ||
reaper.PreventUIRefresh(-1) |