Skip to content

Commit

Permalink
Update amagalma_Split item at mouse cursor position ( use defined cro…
Browse files Browse the repository at this point in the history
…ssfade and selection settings ).lua
  • Loading branch information
amagalma authored Apr 22, 2024
1 parent 4e23c7f commit 0f714d5
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
-- @description Split item at mouse cursor position ( use defined crossfade and selection settings )
-- @author amagalma
-- @version 1.02
-- @version 1.03
-- @changelog
-- - Added setting to respect or not the Snapping setting
-- - Fixed code for getting expected crossfade length
-- - Crossfades are not applicable to empty/midi/dedicated video processor items
-- @provides [main] amagalma_Split item at mouse cursor position ( use defined crossfade and selection settings )/amagalma_Split item at mouse cursor position ( Define crossfade and selection settings ).lua > amagalma_Split item at mouse cursor position ( Define crossfade and selection settings ).lua
-- @donation https://www.paypal.me/amagalma
-- @about
Expand Down Expand Up @@ -59,6 +58,17 @@ local mousepos = reaper.GetSet_ArrangeView2( 0, false, left, right ) +


local function GetExpectedXFadeLength()

local take = reaper.GetActiveTake( item_mouse )
if not take then -- empty item
return 0
else
local source_type = reaper.GetMediaSourceType( reaper.GetMediaItemTake_Source( take ), "" )
if source_type == "MIDI" or source_type == "VIDEOEFFECT" then
return 0
end
end

local xfadetime = tonumber(({reaper.get_config_var_string( "defsplitxfadelen" )})[2])
if not xfadetime then
error('Could not retrieve "defsplitxfadelen" from reaper.ini')
Expand Down

0 comments on commit 0f714d5

Please sign in to comment.