diff options
Diffstat (limited to 'guile/starlet')
-rw-r--r-- | guile/starlet/cue-list.scm | 39 |
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)) |