From bd8cf7df1c51230cf19f42408eb2dd79048774ce Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 25 Jan 2022 17:19:51 +0100 Subject: Restore update-state for playback --- guile/starlet/playback.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 )) + (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 ) port) (format port "#< state: ~a current-cue-number: ~a next-cue-index: ~a of ~a>" -- cgit v1.2.3