aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-05-28 17:14:02 +0200
committerThomas White <taw@physics.org>2021-05-28 17:14:02 +0200
commit07c3820a7d5585e8943751ae447ac59074f7b8dd (patch)
tree7ca4098922c078267daa3893703919fbd97c37eb
parentbfa806b989cce6dc2030a02fb14a303d8068dd0a (diff)
Apply preset for running cue when the playback reverts to ready state
-rw-r--r--guile/starlet/playback.scm15
1 files changed, 14 insertions, 1 deletions
diff --git a/guile/starlet/playback.scm b/guile/starlet/playback.scm
index cdb4274..65f808b 100644
--- a/guile/starlet/playback.scm
+++ b/guile/starlet/playback.scm
@@ -66,6 +66,11 @@
#:getter get-cue-clock
#:setter set-cue-clock!)
+ (running-cue
+ #:init-value #f
+ #:getter get-running-cue
+ #:setter set-running-cue!)
+
(current-state
#:init-form (make-atomic-box 'ready)
#:getter state-box)
@@ -156,6 +161,7 @@
(clear-state! pb)
(set-next-cue-index! pb (+ cue-index 1))
(set-cue-clock! pb #f)
+ (set-running-cue! pb #f)
(set-playback-state! pb 'ready)
;; Set the actual state
@@ -530,6 +536,7 @@
(atomically-overlay-state! pb overlay-state)
(set-cue-clock! pb cue-clock)
+ (set-running-cue! pb the-cue)
(set-playback-state! pb 'running)))
@@ -650,7 +657,13 @@
(when (eq? 'running (atomic-box-compare-and-swap! (state-box pb)
'running
'ready))
- (run-hook (state-change-hook pb) 'ready))))
+ (run-hook (state-change-hook pb) 'ready)
+ (let ((st (get-preset-state (get-running-cue pb))))
+ (state-for-each
+ (lambda (fix attr val)
+ (set-in-state! pb fix attr (lambda () val)))
+ st))
+ (set-running-cue! pb #f))))
(define-syntax cue-list