Skip to content

Commit

Permalink
Update amagalma_Smart Crossfade.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
amagalma committed Sep 22, 2024
1 parent 118abce commit ae5efc8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Items Editing/amagalma_Smart Crossfade.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- @description Smart Crossfade
-- @author amagalma
-- @version 1.70
-- @version 1.71
-- @changelog
-- - support for fixed item lanes
-- - fixed bug with Razor Area and enabled option "Trim content behind media items when editing"
-- @link https://forum.cockos.com/showthread.php?t=195490
-- @donation https://www.paypal.me/amagalma
-- @about
Expand Down Expand Up @@ -65,6 +65,7 @@ if track_cnt == 0 then return reaper.defer(function() end) end
local tracks_with_RE, tr = {}, 0

local began_block = false
local reenableTrim = false

for t = 0, track_cnt - 1 do
local track = reaper.GetTrack(0, t)
Expand Down Expand Up @@ -101,6 +102,10 @@ for t = 0, track_cnt - 1 do
reaper.Undo_BeginBlock()
reaper.PreventUIRefresh( 1 )
began_block = true
if reaper.GetToggleCommandState( 41117 ) == 1 then
reaper.Main_OnCommand(41117, 0) -- Trim content behind media items when editing
reenableTrim = true
end
end
tr = tr + 1
tracks_with_RE[tr] = track
Expand All @@ -126,6 +131,9 @@ if began_block then
reaper.PreventUIRefresh( -1 )
reaper.UpdateArrange()
reaper.Undo_EndBlock( "Smart crossfade items in RE area", (remove_RE_area and 1 or 0)|4 )
if reenableTrim then
reaper.Main_OnCommand(41117, 0) -- Trim content behind media items when editing
end
return
end

Expand Down

0 comments on commit ae5efc8

Please sign in to comment.