summaryrefslogtreecommitdiff
path: root/scripts/stop_at_marker.lua
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-11-26 17:02:41 +0100
committerRobin Gareus <robin@gareus.org>2019-11-26 17:02:41 +0100
commit7d8918034a77168abcb0ee750762d2ed55646fae (patch)
treebaa88384d19c92a21bc22a1b200e718d313294f3 /scripts/stop_at_marker.lua
parentc10df23a0f58ab22fb4ced922557cda532f32cf3 (diff)
Update Lua scripts to use new transport request API
Diffstat (limited to 'scripts/stop_at_marker.lua')
-rw-r--r--scripts/stop_at_marker.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/stop_at_marker.lua b/scripts/stop_at_marker.lua
index 32205432f9..5b4b8d5109 100644
--- a/scripts/stop_at_marker.lua
+++ b/scripts/stop_at_marker.lua
@@ -26,15 +26,14 @@ function factory ()
return
end
- -- since ardour may split the process cycle for events,
- -- n_samples may be smaller.
- local blk = Session:get_block_size ()
-- transport stop can only happen on a process-cycle boundary.
-- This callback happens from within the process callback,
-- so we need to queue it ahead of time.
- if (pos + n_samples + blk >= m and pos + n_samples < m) then
- Session:request_transport_speed (0.0, true)
+ local blk = Session:get_block_size ()
+ if (pos + blk<= m and pos + blk + n_samples > m ) then
+ -- TODO use session event API, schedule stop at marker's time
+ Session:request_transport_speed (0.0, true, ARDOUR.TransportRequestSource.TRS_Engine)
end
end
end