Compare commits
4 Commits
c9c84de9f2
...
8deb166f31
Author | SHA1 | Date | |
---|---|---|---|
8deb166f31 | |||
ef30edcf2f | |||
903086d383 | |||
f7734e9511 |
@ -125,8 +125,10 @@ if edit_mode <= 0 then
|
||||
return
|
||||
elseif (edit_mode == 1 or edit_mode == 2 or edit_mode == 5) and (mark_srcin_pos >= mark_srcout_pos) then
|
||||
msg('SRC-IN Marker must be set left of SRC-OUT marker! Aborting.')
|
||||
return
|
||||
elseif (edit_mode == 3 or edit_mode == 4 or edit_mode == 5) and (mark_dstin_pos >= mark_dstout_pos) then
|
||||
msg('DST-IN Marker must be set left of DST-OUT marker! Aborting.')
|
||||
return
|
||||
end
|
||||
|
||||
-- Do stuff before actual edits...
|
||||
@ -154,6 +156,7 @@ if edit_mode == 1 then -- src-in, src-out and dst-in defined
|
||||
elseif edit_mode == 2 then -- src-in, src-out and dst-out defined
|
||||
reaper.GetSet_LoopTimeRange(true, false, mark_srcin_pos, mark_srcout_pos, false)
|
||||
mark_dstin_pos = mark_dstout_pos - (mark_srcout_pos - mark_srcin_pos) -- also set dst-in position, so we have a point to paste to
|
||||
mark_dstin_id = reaper.AddProjectMarker(0, false, mark_dstin_pos, 0, 'DST-IN_4Pcut', -1)
|
||||
elseif edit_mode == 3 then -- src-in, dst-in and dst-out defined
|
||||
reaper.GetSet_LoopTimeRange(true, false, mark_srcin_pos, mark_srcin_pos + (mark_dstout_pos - mark_dstin_pos), false)
|
||||
elseif edit_mode == 4 then -- src-out, dst-in and dst-out defined
|
||||
@ -171,10 +174,10 @@ reaper.Main_OnCommand(40718, 0) -- select items on selected tracks under time se
|
||||
reaper.Main_OnCommand(40060, 0) -- copy selected items under time selection 41383
|
||||
|
||||
-- Move edit cursor to Dest-In and Paste
|
||||
reaper.MoveEditCursor(mark_dstin_pos - reaper.GetCursorPosition(), false)
|
||||
reaper.GoToMarker(0, mark_dstin_id, false)
|
||||
select_dst_track_only()
|
||||
reaper.Main_OnCommand(40058, 0) -- paste item
|
||||
--reaper.Main_OnCommand( reaper.NamedCommandLookup('_SWS_AWPASTE'), 0 ) -- SWS Paste
|
||||
--reaper.Main_OnCommand(40058, 0) -- paste item
|
||||
reaper.Main_OnCommand( reaper.NamedCommandLookup('_SWS_AWPASTE'), 0 ) -- SWS Paste
|
||||
-- Crossfade (only with SWS extensions, "fill gaps")
|
||||
if sws_present then
|
||||
-- select track with selected items
|
||||
@ -188,13 +191,14 @@ if sws_present then
|
||||
reaper.Main_OnCommand( 40320, 0 ) -- nudge left edge of time selection left
|
||||
reaper.Main_OnCommand( 40323, 0 ) -- nudge right edge of time selection right
|
||||
reaper.Main_OnCommand( 40718, 0 ) -- select items on selected tracks and in time selection
|
||||
reaper.Main_OnCommand( reaper.NamedCommandLookup('_SWS_AWFILLGAPSQUICKXFADE'), 0 ) -- fill gaps between selected items and crossfade
|
||||
reaper.Main_OnCommand( reaper.NamedCommandLookup('_SWS_CROSSFADE'), 0 ) -- fill gaps between selected items and crossfade
|
||||
end
|
||||
-- Move dstin marker according to edit mode
|
||||
if edit_mode == 1 then
|
||||
reaper.SetProjectMarker(mark_dstin_id, false, mark_dstin_pos + (mark_srcout_pos - mark_srcin_pos), 0, 'DST-IN_4Pcut')
|
||||
elseif edit_mode == 2 then
|
||||
reaper.SetProjectMarker(mark_dstout_id, false, mark_dstout_pos + (mark_srcout_pos - mark_srcin_pos), 0, 'DST-OUT_4Pcut')
|
||||
reaper.DeleteProjectMarker(0, mark_dstin_id, false) -- remove dst-in marker, this was set just for the pasting!
|
||||
elseif edit_mode == 3 or edit_mode == 4 then
|
||||
reaper.SetProjectMarker(mark_dstin_id, false, mark_dstin_pos + (mark_dstout_pos - mark_dstin_pos), 0, 'DST-IN_4Pcut')
|
||||
reaper.SetProjectMarker(mark_dstout_id, false, mark_dstout_pos + (mark_dstout_pos - mark_dstin_pos), 0, 'DST-OUT_4Pcut')
|
||||
|
Loading…
x
Reference in New Issue
Block a user