aboutsummaryrefslogtreecommitdiffhomepage
path: root/applause.lua
diff options
context:
space:
mode:
Diffstat (limited to 'applause.lua')
-rw-r--r--applause.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/applause.lua b/applause.lua
index 5d19ad8..e5a9b42 100644
--- a/applause.lua
+++ b/applause.lua
@@ -884,6 +884,27 @@ function NoiseStream:tick()
end
end
+MIDICCStream = DeriveClass(Stream, function(self, control, channel)
+ self.control = control
+ self.channel = channel or 0
+end)
+
+-- implemented in applause.c, private!
+function MIDICCStream.getValue(control, channel)
+ error("C function not registered!")
+end
+
+-- FIXME: Perhaps implement tick() directly in C?
+function MIDICCStream:tick()
+ local control = self.control
+ local channel = self.channel
+ local getValue = self.getValue
+
+ return function()
+ return getValue(control, channel)
+ end
+end
+
-- primitives
function tostream(v)