aboutsummaryrefslogtreecommitdiff
path: root/guile/starlet/state.scm
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-05-20 21:00:44 +0200
committerThomas White <taw@physics.org>2021-05-22 12:11:26 +0200
commit0447be4186ef500a439293442519f32ee9282da8 (patch)
tree3404db19df07ffcce2827caaacc13769171c0299 /guile/starlet/state.scm
parent84a2c09c909b2dd249873d199cc9ea83e59f60fe (diff)
Add home-fixture!/blackout!
Diffstat (limited to 'guile/starlet/state.scm')
-rw-r--r--guile/starlet/state.scm28
1 files changed, 15 insertions, 13 deletions
diff --git a/guile/starlet/state.scm b/guile/starlet/state.scm
index 83dace5..35db6bd 100644
--- a/guile/starlet/state.scm
+++ b/guile/starlet/state.scm
@@ -45,7 +45,8 @@
show-state
lighting-state
programmer-state
- blackout
+ home-fixture!
+ blackout!
sel
selection-hook
value->number
@@ -151,20 +152,21 @@
(set-in-state! state fix attr)))) ;; Try again
-(define (blackout state)
- (state-for-each
- (lambda (fix attr val)
- (when (intensity? attr)
- (set-in-state! state fix attr 0.0)))
- state))
+;; Set any intensity attributes in the current state to zero
+(define (blackout!)
+ (let ((state (current-state)))
+ (state-for-each
+ (lambda (fix attr val)
+ (when (intensity? attr)
+ (set-in-state! state fix attr 0.0)))
+ state)))
-;; Set a single attribute to home position
-(define (home-attr! state fix attr)
- (set-in-state! state
- fix
- attr
- (get-attr-home-val fix attr)))
+;; Set all attributes of the fixture to their home values
+(define (home-fixture! fix)
+ (for-each (lambda (attr)
+ (at fix attr (get-attr-home-val fix attr)))
+ (get-fixture-attrs fix)))
(define (copy-state state)