Skip to content

Commit

Permalink
Update amagalma_Select next item with take FX.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
amagalma authored Apr 26, 2024
1 parent 86310b5 commit db418ae
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Items Properties/amagalma_Select next item with take FX.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-- @description Select next item with take FX
-- @author amagalma
-- @version 1.00
-- @version 1.01
-- @changelog Scroll to item if needed
-- @donation https://www.paypal.me/amagalma


Expand Down Expand Up @@ -48,6 +49,15 @@ if change then
reaper.SetMediaItemSelected( item, i == info[1] )
end
end

-- Scroll arrange
local item = reaper.GetSelectedMediaItem( 0, 0 )
local ar_st, ar_en = reaper.GetSet_ArrangeView2( 0, false, 0, 0, 0, 0 )
local it_st = reaper.GetMediaItemInfo_Value( item, "D_POSITION" )
if it_st >= ar_en then
reaper.GetSet_ArrangeView2( 0, true, 0, 0, it_st, it_st+(ar_en-ar_st) )
end

reaper.UpdateArrange()
reaper.PreventUIRefresh( -1 )
reaper.Undo_EndBlock( "Select next Item with TakeFX", 4 )
Expand Down

0 comments on commit db418ae

Please sign in to comment.