diff options
author | Thomas White <taw@physics.org> | 2021-03-28 20:23:27 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-03-31 21:56:36 +0200 |
commit | 6f1fd2a3d2306c203a1ad90b65502b08e003bb9a (patch) | |
tree | 4c1dcb6b6bc71ade50d4f9da0e51aef2d74e7274 /guile/starlet/base.scm | |
parent | cf7c0dae74b6a2b722f599cfbbd7fe659f7cf5cd (diff) |
Replace playback implementation
The old version was getting too complex. As it turns out, it can be
done without duplicating information in the fade-record structure. This
way also allows much more flexiblity and is a more clear abstraction.
Diffstat (limited to 'guile/starlet/base.scm')
-rw-r--r-- | guile/starlet/base.scm | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/guile/starlet/base.scm b/guile/starlet/base.scm index 54252e2..8b5c035 100644 --- a/guile/starlet/base.scm +++ b/guile/starlet/base.scm @@ -143,6 +143,7 @@ (cons fix attr) value)) + ;; List of fixtures and home state (must remain consistent) (define fixtures (make-atomic-box '())) @@ -271,12 +272,12 @@ (define (have-value val) - (not (eq? val 'attribute-not-in-state))) + (not (eq? val 'no-value))) (define (state-find fix attr state) (hash-ref (get-state-hash-table state) (cons fix attr) - 'attribute-not-in-state)) + 'no-value)) (define (state-map func state) (hash-map->list (lambda (key value) @@ -316,9 +317,10 @@ pre-existing contents." (add-state-to-state! merge-rule-ltp state (current-state))) +;; Coerce something from a state object into a number for scanout (define (value->number val time) (if (procedure? val) - (val time) + (value->number (val time) time) val)) @@ -326,9 +328,7 @@ pre-existing contents." (set-state-hash-table! state (make-hash-table))) -(define (merge-rule-ltp attr a b) - (lambda (time) - (value->number b time))) +(define (merge-rule-ltp attr a b) b) (define (merge-rule-htp attr a b) (if (intensity? attr) @@ -339,8 +339,7 @@ pre-existing contents." (value->number b time))) ;; LTP for all non-intensity attributes - (lambda (time) - (value->number b time)))) + b)) (define (merge-states-htp list-of-states) (merge-states merge-rule-htp |