aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2022-06-06 18:44:10 +0200
committerThomas White <taw@physics.org>2022-06-06 18:44:10 +0200
commitf1906c3e41a66e89b51d5c3947790bef030a3476 (patch)
tree0abf486a9af3bb4a964587327c36837e106fe2df
parentb3d3bc0dff448514d172020e25227f5a1c1ef14e (diff)
run-cue-index!: Add an implicit transitiom to 0/no-value for values in playback
-rw-r--r--guile/starlet/crossfade.scm18
-rw-r--r--guile/starlet/playback.scm24
2 files changed, 25 insertions, 17 deletions
diff --git a/guile/starlet/crossfade.scm b/guile/starlet/crossfade.scm
index a301270..e92e9e6 100644
--- a/guile/starlet/crossfade.scm
+++ b/guile/starlet/crossfade.scm
@@ -191,22 +191,6 @@
(< a 1))))
-(define (blank-everything in-state down-clock)
- (let ((out-state (make-empty-state)))
- (state-for-each
- (lambda (fix attr val)
- (when (intensity? attr)
- (set-in-state! out-state
- fix
- attr
- (lambda ()
- (simple-fade (val)
- 0.0
- down-clock)))))
- in-state)
- out-state))
-
-
(define (make-fade-for-attribute-type type)
(cond
((eq? type 'continuous) (cut make-general-fade simple-fade <...>))
@@ -235,7 +219,7 @@
(let ((up-clock (make-delayed-clock clock up-delay up-time))
(down-clock (make-delayed-clock clock down-delay down-time))
(attribute-clock (make-delayed-clock clock attr-delay attr-time)))
- (let ((overlay-state (blank-everything current-state down-clock)))
+ (let ((overlay-state (make-empty-state)))
(state-for-each
(lambda (fixture attr target-val)
diff --git a/guile/starlet/playback.scm b/guile/starlet/playback.scm
index f9ed25d..732be51 100644
--- a/guile/starlet/playback.scm
+++ b/guile/starlet/playback.scm
@@ -243,12 +243,36 @@
'next-cue-unspecified))
+(define (blank-everything state)
+ (state-map
+ (lambda (fix attr val)
+ (if (intensity? attr)
+ 0.0
+ 'no-value))
+ state))
+
+
(define (run-cue-index! pb cue-index)
(let* ((the-cue (vector-ref (get-playback-cue-list pb) cue-index))
(overlay-state (make-empty-state))
(cue-clock (get-cue-clock the-cue))
(fade-time 0))
+ ;; Start by fading the previous contents of the playback down, using the
+ ;; "main" transition effect
+ (receive
+ (overlay-part transition-time)
+ ((transition-func (get-cue-part-transition
+ (car (get-cue-parts the-cue))))
+ (blank-everything pb)
+ pb
+ cue-clock)
+ (atomically-overlay-state!
+ overlay-state
+ overlay-part)
+ (set! fade-time transition-time))
+
+ ;; Stack all the cue parts on top
(for-each
(lambda (part)
(receive