summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.me.uk>2020-03-10 23:30:11 +0100
committerThomas White <taw@bitwiz.me.uk>2020-03-10 23:30:11 +0100
commit8c8f06702306eb5079d823577e240629384408d1 (patch)
tree45c8c7ddbc69304b50871c78f4d53a62315716ae /src
parent3a7a1693de38a88e0fda7439669db4eda2eee7f2 (diff)
Store states as functions
Diffstat (limited to 'src')
-rw-r--r--src/init.scm34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/init.scm b/src/init.scm
index ce75282..a7eafc1 100644
--- a/src/init.scm
+++ b/src/init.scm
@@ -43,25 +43,29 @@
(cons fixname (cons 'intensity level))))
-(define show-state-absolute
+(define show-state
(lambda (state)
(set-level fixtures 0)
- (for-each (lambda (q)
- (set-level
- (car q)
- (cddr q)))
- state)))
-
+ (let ([qv (state)])
+ (for-each (lambda (q)
+ (set-level (car q) (cddr q)))
+ qv))))
(patch-many (find-fixture-class fixture-class-library "Robe Robin DL7S Profile Mode 1") 'mh 4 0 51)
(patch-many (find-fixture-class fixture-class-library "Generic dimmer") 'dim 6 0 1)
-(define home (list
- (at 'mh1 0)
- (at 'mh2 0)
- (at 'mh3 (+ 30 30))
- (at 'mh4 0)
- (at 'dim1 0)
- (at 'dim2 0)))
+(define example
+ (lambda ()
+ (list
+ (at 'mh1 85)
+ (at 'mh2 0)
+ (at 'mh3 (+ 30 30))
+ (at 'mh4 32)
+ (at 'dim1 100)
+ (at 'dim2 12))))
+
+(define home
+ (lambda ()
+ (list)))
-(show-state-absolute home)
+(show-state home)