Reaper-Scripts/4PointCutting/4Pcut_reset_markers.lua

33 lines
1.1 KiB
Lua

-- Reaper Script for 4 point editing. This script deletes all the special markers that are
-- used to define source and destination areas.
-- Author: Ludwig Frühschütz
-- Source: https://www.eleton-audio.de
-- Git: https://files.eleton-audio.de/gitea/Ludwig/Reaper-Scripts.git
-- License: GPL v3.0
-- Requires: Reaper 5 or 6
-- Requires: This script goes with several other scripts that work closely together.
local nof_markers = 0
local nof_regions = 0
local id = -1
local name = ''
local isregion = false
local ids = {}
-- check if markers exist
_, nof_markers, nof_regions = reaper.CountProjectMarkers(0)
nof_markers = nof_markers + nof_regions -- adapt count of 'CountProjectMarkers()' to 'EnumProjectMarkers()'
for i = 0, nof_markers - 1 do
_, isregion, _, _, name, id = reaper.EnumProjectMarkers(i)
if not isregion and
(name == 'SRC-IN_4Pcut' or
name == 'SRC-OUT_4Pcut' or
name == 'DST-IN_4Pcut' or
name == 'DST-OUT_4Pcut') then
table.insert(ids, id)
end
end
-- delete markers
for _, id in ipairs(ids) do
reaper.DeleteProjectMarker(0, id, false)
end