From 99ef3632a99b26cd92ea142c4b51f16e88253599 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sun, 7 Jun 2020 19:10:21 +0200 Subject: Set all attributes to home values at the start --- guile/nanolight/fixture.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/guile/nanolight/fixture.scm b/guile/nanolight/fixture.scm index b532e8b..ff45c22 100644 --- a/guile/nanolight/fixture.scm +++ b/guile/nanolight/fixture.scm @@ -104,12 +104,24 @@ (fixture-address-string fix))) +(define (home-attribute attr) + (let ((attr-home-value (home-value attr))) + (set-value-func! attr (lambda () attr-home-value)))) + + +(define (home-all-attributes fix) + (for-each + home-attribute + (attributes fix))) + + (define (patch-fixture output attributes universe start-addr friendly-name) (let ((new-fixture (make #:attributes (copy-tree attributes) #:uni universe #:sa start-addr #:friendly-name friendly-name))) + (home-all-attributes new-fixture) (output 'add-fixture new-fixture) new-fixture)) -- cgit v1.2.3