summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-06-16 22:44:51 +0200
committerThomas White <taw@physics.org>2020-06-16 22:44:51 +0200
commitb8fa20d37144dac18174e45aeeffd203f921e1e3 (patch)
tree87b1306cc35b428e7affa8c6fedd5060e623f845
parentec502e06c5a0d6df91ee9b44f3694a9a5ecd0643 (diff)
Formatting
-rw-r--r--guile/nanolight/fixture.scm57
1 files changed, 26 insertions, 31 deletions
diff --git a/guile/nanolight/fixture.scm b/guile/nanolight/fixture.scm
index 226c106..81dabcc 100644
--- a/guile/nanolight/fixture.scm
+++ b/guile/nanolight/fixture.scm
@@ -110,9 +110,8 @@
(define (home-all-attributes fix)
- (for-each
- home-attribute
- (attributes fix)))
+ (for-each home-attribute
+ (attributes fix)))
(define (patch-fixture output attributes universe start-addr friendly-name)
@@ -157,25 +156,22 @@
#:port ola-socket
#:keep-alive? #t
#:headers (acons 'content-type
- (parse-header
- 'content-type
- "application/x-www-form-urlencoded")
- '())
- #:body (string-append
- "u="
- (number->string (car universe))
- "&d="
- (bytevec->string (cdr universe)))))
+ (parse-header 'content-type
+ "application/x-www-form-urlencoded")
+ '())
+ #:body (string-append "u="
+ (number->string (car universe))
+ "&d="
+ (bytevec->string (cdr universe)))))
(define (make-output)
(letrec* (
(fixtures '())
- (ola-uri (build-uri
- 'http
- #:host "127.0.0.1"
- #:port 9090
- #:path "/set_dmx"))
+ (ola-uri (build-uri 'http
+ #:host "127.0.0.1"
+ #:port 9090
+ #:path "/set_dmx"))
(ola-socket (open-socket-for-uri ola-uri)))
(define (run-scanout)
@@ -187,16 +183,14 @@
;; Create DMX array for universe if it doesn't exist already
(unless (assq universe universes)
- (set! universes (acons
- universe
- (make-u8vector 512 0)
- universes)))
+ (set! universes (acons universe
+ (make-u8vector 512 0)
+ universes)))
;; Set the value in the DMX array
- (u8vector-set!
- (assq-ref universes universe)
- (- addr 1) ; u8vector-set indexing starts from zero
- (round-dmx value)))
+ (u8vector-set! (assq-ref universes universe)
+ (- addr 1) ; u8vector-set indexing starts from zero
+ (round-dmx value)))
;; Scan out all fixtures
(for-each (lambda (fix)
@@ -204,18 +198,19 @@
;; Scan out one fixture
(for-each (lambda (attr)
(let ((trans (translator attr)))
- (trans
- (universe fix)
- (start-addr fix)
- ((value-func attr))
- set-dmx)))
+ (trans (universe fix)
+ (start-addr fix)
+ ((value-func attr))
+ set-dmx)))
(attributes fix)))
fixtures)
;; Send everything to OLA
(for-each (lambda (a)
- (send-to-ola ola-uri ola-socket a))
+ (send-to-ola ola-uri
+ ola-socket
+ a))
universes))
(yield)