diff options
author | Pixel <pixel@nobis-crew.org> | 2009-12-23 00:11:30 +0100 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2009-12-23 00:11:30 +0100 |
commit | f6ac50837aabd69c6ea5892a858359f51f40ee03 (patch) | |
tree | fd6f7007d543de2cca7a813e8efbf156089aa0eb /dalos-tee.lua | |
parent | 95b71cfc474f247e7e1081ea67c7a2166ddd3805 (diff) |
Mbmbmlmlm \r is evil.
Diffstat (limited to 'dalos-tee.lua')
-rw-r--r-- | dalos-tee.lua | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/dalos-tee.lua b/dalos-tee.lua index 5c9b26a..1d75fb2 100644 --- a/dalos-tee.lua +++ b/dalos-tee.lua @@ -1,50 +1,50 @@ -dalosp.tee = {
- NTEE = 16,
-
- set_out = function (self, h, ind)
- local name = h:getname()
- local obj = {
- h = h,
- size = h:getsize(),
- getname = function () return name end,
- do_read = function (self, count, userdata)
- self.h:seek(self.offset, SEEK_SET)
- return self.h:read(count, userdata)
- end,
- }
- self:set_houtput(dalos.luahandle(obj), ind)
- end,
-
- input_change = function (self, ind)
- local h = self:get_linked_input(1)
- if h then
- self.color = cd.GREEN
- for ind = 1, 16 do self:set_out(h, ind) end
- self.dcanvas:draw()
- else
- self.color = cd.YELLOW
- for i = 1, dalosp.tee.NTEE do
- self:set_houtput(nil, i)
- end
- self.dcanvas:draw()
- end
- end,
-
- create = function (d, tab, settings)
- tab.ninputs = 1
- tab.noutputs = dalosp.tee.NTEE
- tab.otype = dalos.objtype.LUA_FILTER
- tab.input_change = dalosp.tee.input_change
- tab.default_name = "Tee"
- tab.ntype = "Tee"
-
- local obj = dalos.object(d, tab)
-
- obj.set_out = dalosp.tee.set_out
-
- return obj
- end,
-}
-
-dalos.tee = dalosp.tee.create
-dalos:register_obj("Tee", dalos.tee)
+dalosp.tee = { + NTEE = 16, + + set_out = function (self, h, ind) + local name = h:getname() + local obj = { + h = h, + size = h:getsize(), + getname = function () return name end, + do_read = function (self, count, userdata) + self.h:seek(self.offset, SEEK_SET) + return self.h:read(count, userdata) + end, + } + self:set_houtput(dalos.luahandle(obj), ind) + end, + + input_change = function (self, ind) + local h = self:get_linked_input(1) + if h then + self.color = cd.GREEN + for ind = 1, 16 do self:set_out(h, ind) end + self.dcanvas:draw() + else + self.color = cd.YELLOW + for i = 1, dalosp.tee.NTEE do + self:set_houtput(nil, i) + end + self.dcanvas:draw() + end + end, + + create = function (d, tab, settings) + tab.ninputs = 1 + tab.noutputs = dalosp.tee.NTEE + tab.otype = dalos.objtype.LUA_FILTER + tab.input_change = dalosp.tee.input_change + tab.default_name = "Tee" + tab.ntype = "Tee" + + local obj = dalos.object(d, tab) + + obj.set_out = dalosp.tee.set_out + + return obj + end, +} + +dalos.tee = dalosp.tee.create +dalos:register_obj("Tee", dalos.tee) |