Skip to content

Commit b460023

Browse files
committed
Only triggers when recording
1 parent f6cc196 commit b460023

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

.DS_Store

2 KB
Binary file not shown.

Markers/Create marker with name via OSC.lua

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
@link
55
Author https://www.bensmithsound.uk
66
Repository https://github.com/bsmith96/Reaper-Scripts
7-
@version 1.5
7+
@version 1.6
88
@changelog
9-
+ Tidied up script documentation
9+
+ Only triggers when recording, regardless of "/ignore" messages being sent to QLab 5
1010
@metapackage
1111
@provides
1212
[main] . > bsmith96_Create marker with name via OSC.lua
@@ -122,12 +122,16 @@ end
122122
-- =================== MAIN ROUTINE ======================
123123
-- =========================================================
124124

125-
r.Undo_BeginBlock()
125+
if r.GetAllProjectPlayStates() == 5 then -- only runs when project is recording
126126

127-
-- get OSC message
128-
local msg = osc.get()
127+
r.Undo_BeginBlock()
129128

130-
-- Create a marker at the current position, with the args of OSC message as the marker name
131-
r.AddProjectMarker(0,0,r.GetPlayPosition(),0,msg.arg,-1)
129+
-- get OSC message
130+
local msg = osc.get()
132131

133-
r.Undo_EndBlock(scriptName, -1)
132+
-- Create a marker at the current position, with the args of OSC message as the marker name
133+
r.AddProjectMarker(0,0,r.GetPlayPosition(),0,msg.arg,-1)
134+
135+
r.Undo_EndBlock(scriptName, -1)
136+
137+
end

0 commit comments

Comments
 (0)