diff options
Diffstat (limited to 'dalos-buffer.lua')
-rw-r--r-- | dalos-buffer.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/dalos-buffer.lua b/dalos-buffer.lua new file mode 100644 index 0000000..3743f46 --- /dev/null +++ b/dalos-buffer.lua @@ -0,0 +1,30 @@ +dalosp.buffer = { + input_change = function (self, ind) + local h = self:get_linked_input(1) + if h then + self.color = cd.GREEN + local b = Buffer(true) + b:copyfrom(self:get_linked_input(1)) + self:set_houtput(b) + else + self:set_houtput(nil) + self.color = cd.YELLOW + end + self.dcanvas:draw() + end, + + create = function (d, tab, settings) + tab.ninputs = 1 + tab.noutputs = 1 + tab.otype = dalos.objtype.LUA_FILTER + tab.default_name = "Buffer" + tab.input_change = dalosp.buffer.input_change + tab.ntype = "Buffer" + local obj = dalos.object(d, tab, extra) + + return obj + end, +} + +dalos.buffer = dalosp.buffer.create +dalos:register_obj("Buffer", dalos.buffer, "Basic Filters") |