diff options
author | Thomas White <taw@physics.org> | 2022-04-24 18:21:15 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2022-04-24 18:21:15 +0200 |
commit | ce607588e8ccf2257fc7f1863f967e52a565ce7a (patch) | |
tree | f8656aba352a285005cde59938419ae07e39df9f /guile/starlet/fixture-library/adj | |
parent | 9411275e9f6dcee09923329d54fd6e6e439a497d (diff) |
Convert some fixtures to use define-fixture
Also fixes an obvious bug in <adj-mega-tripar-profile-4ch>
Diffstat (limited to 'guile/starlet/fixture-library/adj')
-rw-r--r-- | guile/starlet/fixture-library/adj/mega-tripar-profile.scm | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/guile/starlet/fixture-library/adj/mega-tripar-profile.scm b/guile/starlet/fixture-library/adj/mega-tripar-profile.scm index 1e0579e..cec35a6 100644 --- a/guile/starlet/fixture-library/adj/mega-tripar-profile.scm +++ b/guile/starlet/fixture-library/adj/mega-tripar-profile.scm @@ -19,7 +19,6 @@ ;; along with this program. If not, see <http://www.gnu.org/licenses/>. ;; (define-module (starlet fixture-library adj mega-tripar-profile) - #:use-module (oop goops) #:use-module (starlet fixture) #:use-module (starlet colours) #:export (<adj-mega-tripar-profile-3ch> @@ -28,14 +27,16 @@ ;; 3 channel mode (RGB direct control) -(define-class <adj-mega-tripar-profile-3ch> (<fixture>) - (attributes - #:init-form (list - (attr-continuous 'intensity '(0 100) 0) - (attr-colour 'colour white)))) +(define-fixture + + <adj-mega-tripar-profile-3ch> + + (list + (attr-continuous 'intensity '(0 100) 0) + (attr-colour 'colour white)) + + (get-attr set-chan8) -(define-method (scanout-fixture (fixture <adj-mega-tripar-profile-3ch>) - get-attr set-chan8 set-chan16) (let ((intensity (/ (get-attr 'intensity) 100)) (rgb (colour-as-rgb (get-attr 'colour)))) (set-chan8 1 (percent->dmxval8 (* intensity (car rgb)))) @@ -45,17 +46,18 @@ ;; 4 channel mode (RGB + separate intensity) -(define-class <adj-mega-tripar-profile-4ch> (<fixture>) - (attributes - #:init-form (list - (attr-continuous 'intensity '(0 100) 0) - (attr-colour 'colour white)))) +(define-fixture -(define-method (scanout-fixture (fixture <adj-mega-tripar-profile-4ch>) - get-attr set-chan8 set-chan16) - (let ((intensity (/ (get-attr 'intensity) 100)) - (rgb (colour-as-rgb (get-attr 'colour)))) - (set-chan8 1 (percent->dmxval8 intensity)) + <adj-mega-tripar-profile-4ch> + + (list + (attr-continuous 'intensity '(0 100) 0) + (attr-colour 'colour white)) + + (get-attr set-chan8) + + (let ((rgb (colour-as-rgb (get-attr 'colour)))) + (set-chan8 1 (percent->dmxval8 (get-attr 'intensity))) (set-chan8 2 (percent->dmxval8 (car rgb))) (set-chan8 3 (percent->dmxval8 (cadr rgb))) (set-chan8 4 (percent->dmxval8 (caddr rgb))))) |