From 29f797a94191cc22cafe24b1f4dd61c306e1bf8e Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 8 Mar 2021 17:42:08 +0100 Subject: Remove home state and abolish fixture-attribute use in states The "home state" has no reason to exist. The home values are already stored perfectly well in the attribute lists of the fixtures. Any time we need to look up a home value, we already have the fixture itself available. This also gets rid of any use of in states. This was confusing me. Better to just pass symbols around and only get the real attribute objects when needed (which isn't very often). --- guile/starlet/midi-control/faders.scm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'guile/starlet/midi-control/faders.scm') diff --git a/guile/starlet/midi-control/faders.scm b/guile/starlet/midi-control/faders.scm index 97ed1ff..ae8162a 100644 --- a/guile/starlet/midi-control/faders.scm +++ b/guile/starlet/midi-control/faders.scm @@ -80,10 +80,10 @@ #:func (lambda (prev-cc-val new-cc-value) (set! offset (+ offset (ccval->offset new-cc-value))) (for-each (lambda (fix old-val) - (set-attr! programmer-state - fix - attr - (+ old-val offset))) + (set-in-state! programmer-state + fix + attr + (+ old-val offset))) fixtures old-vals))))))) @@ -129,11 +129,11 @@ initial-vals fixtures) (for-each (lambda (fix initial-val gradient) - (set-attr! programmer-state - fix - attr-name - (+ initial-val - (* gradient cc-offset)))) + (set-in-state! programmer-state + fix + attr-name + (+ initial-val + (* gradient cc-offset)))) fixtures initial-vals gradients)) -- cgit v1.2.3