Now also works if project contains regions - closes #1

This commit is contained in:
Ludwig Frühschütz 2020-01-31 22:08:08 +01:00
parent 4238d6a104
commit d2b992f1f0
6 changed files with 18 additions and 6 deletions

View File

@ -77,7 +77,9 @@ end
-- START HERE vvvvvvvvvvvvvvvvvvvvvvvvvv
-- run through all markers and get position of the 4 points
local nof_markers = 0
_, nof_markers, _ = reaper.CountProjectMarkers(0)
local nof_regions = 0
_, 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
local name = ''
local pos = 0

View File

@ -8,13 +8,15 @@
-- 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, _ = reaper.CountProjectMarkers(0)
_, 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

View File

@ -7,10 +7,12 @@
-- Requires: This script goes with several other scripts that work closely together.
local nof_markers = 0
local nof_regions = 0
local id = -1
-- check if marker already exists
_, nof_markers, _ = reaper.CountProjectMarkers(0)
_, 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
local name_tmp = ''
local isregion_tmp = false

View File

@ -7,10 +7,12 @@
-- Requires: This script goes with several other scripts that work closely together.
local nof_markers = 0
local nof_regions = 0
local id = -1
-- check if marker already exists
_, nof_markers, _ = reaper.CountProjectMarkers(0)
_, 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
local name_tmp = ''
local isregion_tmp = false

View File

@ -7,10 +7,12 @@
-- Requires: This script goes with several other scripts that work closely together.
local nof_markers = 0
local nof_regions = 0
local id = -1
-- check if marker already exists
_, nof_markers, _ = reaper.CountProjectMarkers(0)
_, 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
local name_tmp = ''
local isregion_tmp = false

View File

@ -7,10 +7,12 @@
-- Requires: This script goes with several other scripts that work closely together.
local nof_markers = 0
local nof_regions = 0
local id = -1
-- check if marker already exists
_, nof_markers, _ = reaper.CountProjectMarkers(0)
_, 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
local name_tmp = ''
local isregion_tmp = false