aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/demo.scm55
-rw-r--r--guile/starlet/base.scm14
-rw-r--r--guile/starlet/playback.scm26
3 files changed, 53 insertions, 42 deletions
diff --git a/examples/demo.scm b/examples/demo.scm
index dd959d3..0bf14c1 100644
--- a/examples/demo.scm
+++ b/examples/demo.scm
@@ -76,37 +76,38 @@
(at dim7 'intensity (flash 5))))
-(define cue-list
- (list (cue 0
- (cue-state)
- #:fade-up 1
- #:fade-down 1)
-
- (cue 1
- (cue-state (apply-state example-state-1))
- #:fade-up 3
- #:fade-down 5)
-
- (cue 2
- (cue-state (apply-state example-state-2))
- #:fade-up 3
- #:fade-down 1
- #:down-delay 3)
-
- (cue 2.5
- (cue-state (apply-state example-state-2)
- (at dim1 'intensity 100))
- #:fade-up 1
- #:fade-down 1)
-
- (cue 3 (cue-state)
- #:fade-up 0
- #:fade-down 2)))
+(define my-cue-list
+ (cue-list
+ (cue 0
+ (cue-state)
+ #:fade-up 1
+ #:fade-down 1)
+
+ (cue 1
+ (cue-state (apply-state example-state-1))
+ #:fade-up 3
+ #:fade-down 5)
+
+ (cue 2
+ (cue-state (apply-state example-state-2))
+ #:fade-up 3
+ #:fade-down 1
+ #:down-delay 3)
+
+ (cue 2.5
+ (track-state (at dim1 'intensity 100))
+ #:fade-up 1
+ #:fade-down 1)
+
+ (cue 3
+ (cue-state)
+ #:fade-up 0
+ #:fade-down 2)))
;; Create a playback for the cue list, and register it for output
(define pb
- (make-playback cue-list))
+ (make-playback my-cue-list))
(register-state! pb)
;; Jump to zero (blackout) cue
diff --git a/guile/starlet/base.scm b/guile/starlet/base.scm
index 1e6e44a..fd4f9f7 100644
--- a/guile/starlet/base.scm
+++ b/guile/starlet/base.scm
@@ -29,7 +29,6 @@
attr-list
current-state
lighting-state
- cue-state
apply-state
at))
@@ -419,19 +418,6 @@
(current-state)))))
-(define-syntax cue-state
- (syntax-rules ()
-
- ((_)
- make-empty-state)
-
- ((_ body ...)
- (lambda ()
- (parameterize ((current-state (make-empty-state)))
- body ...
- (current-state))))))
-
-
(define-syntax at
(syntax-rules ()
diff --git a/guile/starlet/playback.scm b/guile/starlet/playback.scm
index 51eb999..3cbcd61 100644
--- a/guile/starlet/playback.scm
+++ b/guile/starlet/playback.scm
@@ -7,7 +7,10 @@
cue
cut-to-cue-number!
run-cue-number!
- go!))
+ go!
+ cue-list
+ cue-state
+ track-state))
;; A "playback" is a state which knows how to run cues
@@ -233,3 +236,24 @@
(down-time cue)
(down-delay cue))
(add-fade! pb (make-fade-from-cue cue tnow))))
+
+
+(define-syntax cue-state
+ (syntax-rules ()
+
+ ((_)
+ make-empty-state)
+
+ ((_ body ...)
+ (lambda ()
+ (parameterize ((current-state (make-empty-state)))
+ body ...
+ (current-state))))))
+
+
+(define-syntax cue-list
+ (identifier-syntax list))
+
+
+(define-syntax track-state
+ (identifier-syntax cue-state))