aboutsummaryrefslogtreecommitdiffstats
path: root/alv/base
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-05-12 14:20:52 +0000
committers-ol <s+removethis@s-ol.nu>2025-03-02 14:23:21 +0000
commitb41a406ab7f56cc33aca594fb38b60c67d4130ce (patch)
treefaf683fef2ee2b700b3f0d688e0f4727fc64ab0e /alv/base
parentmake EvtStreams carry a single value (diff)
downloadalive-b41a406ab7f56cc33aca594fb38b60c67d4130ce.tar.gz
alive-b41a406ab7f56cc33aca594fb38b60c67d4130ce.zip
RTNode constifies constant SigStreams
Diffstat (limited to 'alv/base')
-rw-r--r--alv/base/input.moon19
1 files changed, 15 insertions, 4 deletions
diff --git a/alv/base/input.moon b/alv/base/input.moon
index b73a476..f29bd10 100644
--- a/alv/base/input.moon
+++ b/alv/base/input.moon
@@ -76,8 +76,11 @@ class Input
metatype: => @result.metatype
--- the current value
- --
- -- @tfield SigStream result
+ -- @tfield Result result
+
+ --- the Input mode
+ -- @tfield string mode `'hot'`, `'cold'` or `'io'`.
+ mode: 'hot'
--- members
-- @section members
@@ -125,17 +128,25 @@ class Input
InputType value
class ColdInput extends Input
+ mode: 'cold'
dirty: => false
class ValueInput extends Input
- setup: (old) => @dirty_setup = not old or @result != old.result
+ new: (result) =>
+ super result
+ @mode = if @result.metatype == '=' then 'cold' else 'hot'
+
+ setup: (old) =>
+ @dirty_setup = not old or @result != old.result
+
finish_setup: => @dirty_setup = nil
+
dirty: =>
return @dirty_setup if @dirty_setup != nil
@result\dirty!
class IOInput extends Input
- io: true
+ mode: 'io'
mapping = {
[Constant]: ValueInput