Browse Source

4PointCutting: Changed to "GoToMarker()" from "MoveEditCursor()" to prevent from occasionaly audio playback during execution

master
Ludwig Frühschütz 4 years ago
parent
commit
8deb166f31
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      4PointCutting/4Pcut_execute.lua

+ 3
- 1
4PointCutting/4Pcut_execute.lua View File

@ -156,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
@ -173,7 +174,7 @@ 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
@ -197,6 +198,7 @@ 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…
Cancel
Save