aboutsummaryrefslogtreecommitdiff
path: root/guile
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2022-01-25 17:19:51 +0100
committerThomas White <taw@physics.org>2022-01-25 23:23:01 +0100
commitbd8cf7df1c51230cf19f42408eb2dd79048774ce (patch)
treee0b07ec16b23d38627b9ce697aede693e314f9ba /guile
parent57ff1a0051266ffaa242d01b383e4f97f62fb06f (diff)
Restore update-state for playback
Diffstat (limited to 'guile')
-rw-r--r--guile/starlet/playback.scm16
1 files changed, 16 insertions, 0 deletions
diff --git a/guile/starlet/playback.scm b/guile/starlet/playback.scm
index f8daa7c..5052ad0 100644
--- a/guile/starlet/playback.scm
+++ b/guile/starlet/playback.scm
@@ -269,6 +269,22 @@
(set-playback-state! pb 'running)))
+(define-method (update-state! (pb <starlet-playback>))
+ (when (and (get-pb-cue-clock pb)
+ (clock-expired? (get-pb-cue-clock pb))
+ (eq? 'running (atomic-box-ref (state-box pb))))
+ (when (eq? 'running (atomic-box-compare-and-swap! (state-box pb)
+ 'running
+ '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-method (write (pb <starlet-playback>) port)
(format port
"#<<starlet-playback> state: ~a current-cue-number: ~a next-cue-index: ~a of ~a>"