aboutsummaryrefslogtreecommitdiff
path: root/guile
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2022-06-26 11:44:14 +0200
committerThomas White <taw@physics.org>2022-06-26 11:44:14 +0200
commit7f792b7bf4294091578db766cb2217572f34d02a (patch)
tree8a176b510aad11e15bdbe9f6d62066ff32791f74 /guile
parentc0205cee7d3f7caafc84661948d3c5b2cc854751 (diff)
cue-proc: Allow a cue made up only of cue parts
Diffstat (limited to 'guile')
-rw-r--r--guile/starlet/cue-list.scm39
1 files changed, 26 insertions, 13 deletions
diff --git a/guile/starlet/cue-list.scm b/guile/starlet/cue-list.scm
index dd3edbd..a2361b0 100644
--- a/guile/starlet/cue-list.scm
+++ b/guile/starlet/cue-list.scm
@@ -116,27 +116,40 @@
(receive
(states transition-effects cue-parts rest)
(categorize args lighting-state? transition-effect? cue-part?)
+
(let-keywords
rest
#f ;; allow-other-keys?
((track-intensities #f))
- (when (> (length states) 1)
- (error "A cue can only contain one state"))
+ (let ((n-tr-effs (length transition-effects))
+ (n-states (length states)))
+
+ (make-cue (qnum number)
+ #f ;; preset state, to be filled later
+ track-intensities
+
+ ;; Create the list of cue parts
+ (cond
+
+ ;; Only explicitly-stated cue parts
+ [(= 0 n-tr-effs n-states)
+ cue-parts]
- (when (> (length transition-effects) 1)
- (error "A cue can only contain one transition effect"))
+ ;; Implicit first cue part
+ [(= 1 n-tr-effs n-states)
+ (cons
+ (cue-part (car states)
+ (car transition-effects))
+ cue-parts)]
- (let ((the-cue (make-cue (qnum number)
- #f ;; preset state, to be filled later
- track-intensities
- (cons
- (cue-part (car states)
- (car transition-effects))
- cue-parts)
- (current-cue-clock))))
+ ;; Wrong number of states or transition effects
+ [(not (= n-states 1))
+ (error "A cue can only contain one state")]
+ [(not (= n-tr-effs 1))
+ (error "A cue can only contain one transition effect")])
- the-cue))))
+ (current-cue-clock))))))
(define current-cue-clock (make-parameter #f))