diff options
author | Thomas White <taw@physics.org> | 2022-01-25 17:19:51 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2022-01-25 23:23:01 +0100 |
commit | bd8cf7df1c51230cf19f42408eb2dd79048774ce (patch) | |
tree | e0b07ec16b23d38627b9ce697aede693e314f9ba | |
parent | 57ff1a0051266ffaa242d01b383e4f97f62fb06f (diff) |
Restore update-state for playback
-rw-r--r-- | guile/starlet/playback.scm | 16 |
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>" |