aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/demo.scm52
-rw-r--r--guile/starlet/base.scm13
2 files changed, 33 insertions, 32 deletions
diff --git a/examples/demo.scm b/examples/demo.scm
index 06ebcd0..359b99b 100644
--- a/examples/demo.scm
+++ b/examples/demo.scm
@@ -18,14 +18,14 @@
(make-midi-controller! #:channel 14
#:cc-number 19))
-(define-state worklight
+(register-state!
+ (lighting-state
(let ((fader-pos (lambda (time)
(get-controller-value working-light-fader))))
(at dim11 'intensity fader-pos)
(at dim12 'intensity fader-pos)
- (at dim13 'intensity fader-pos)))
+ (at dim13 'intensity fader-pos))))
-(register-state! worklight)
;; Same, for some different fixtures
@@ -34,44 +34,46 @@
(make-midi-controller! #:channel 14
#:cc-number 18))
-(define-state movers
+(register-state!
+ (lighting-state
(let ((fader-pos (lambda (time)
(get-controller-value movers-fader))))
(at mh1 'intensity fader-pos)
- (at mh2 'intensity fader-pos)))
-
-(register-state! movers)
+ (at mh2 'intensity fader-pos))))
(define pot1
(make-midi-controller! #:channel 14
#:cc-number 7))
-(define-state example-state-1
- ;; Front wash
- (at dim11 'intensity 50)
- (at dim12 'intensity 50)
- (at dim13 'intensity 50)
+(define example-state-1
+ (lighting-state
+
+ ;; Front wash
+ (at dim11 'intensity 50)
+ (at dim12 'intensity 50)
+ (at dim13 'intensity 50)
- ;; Sidelight
- (at dim7 'intensity (flash 2))
- (at dim8 'intensity 50)
+ ;; Sidelight
+ (at dim7 'intensity (flash 2))
+ (at dim8 'intensity 50)
- (at dim48 'intensity
- (lambda (a)
- (get-controller-value pot1))))
+ (at dim48 'intensity
+ (lambda (a)
+ (get-controller-value pot1)))))
-(define-state example-state-2
+(define example-state-2
+ (lighting-state
- ;; Front wash
- (at dim1 'intensity 10)
- (at dim2 'intensity 10)
- (at dim3 'intensity 10)
+ ;; Front wash
+ (at dim1 'intensity 10)
+ (at dim2 'intensity 10)
+ (at dim3 'intensity 10)
- ;; Sidelight
- (at dim7 'intensity (flash 5)))
+ ;; Sidelight
+ (at dim7 'intensity (flash 5))))
(define cue-list
diff --git a/guile/starlet/base.scm b/guile/starlet/base.scm
index 9caba9e..f0dead1 100644
--- a/guile/starlet/base.scm
+++ b/guile/starlet/base.scm
@@ -28,7 +28,7 @@
attr-boolean
attr-list
current-state
- define-state
+ lighting-state
at))
(define-class <fixture-attribute> (<object>)
@@ -405,13 +405,12 @@
(register-state! (current-state))
-(define-syntax define-state
+(define-syntax lighting-state
(syntax-rules ()
- ((_ state-name body ...)
- (define state-name
- (parameterize ((current-state (make-empty-state)))
- body ...
- (current-state))))))
+ ((_ body ...)
+ (parameterize ((current-state (make-empty-state)))
+ body ...
+ (current-state)))))
(define-syntax at