File: lpaths.pd_lua

package info (click to toggle)
pd-lua 0.12.23%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,912 kB
  • sloc: ansic: 3,733; lisp: 66; makefile: 64
file content (34 lines) | stat: -rw-r--r-- 740 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
local lpaths = pd.Class:new():register("lpaths")

function lpaths:initialize(name, atoms)
  self.inlets = 1
  self.outlets = 1
  return true
end

function lpaths:in_1_loadx(atoms)
  local fname = self._loadpath .. "hello.txt"
  local f = assert(io.open(fname, "rb"))
  local content = f:read("*all")
  f:close()
  pd.post(content)
  return true
end

function lpaths:in_1_load(atoms)
  local fname = self._canvaspath .. "hello.txt"
  local f = assert(io.open(fname, "rb"))
  local content = f:read("*all")
  f:close()
  pd.post(content)
  return true
end

function lpaths:in_1_postpath(atoms)
  pd.post("self._canvaspath: " .. self._canvaspath)
end

function lpaths:in_1_postpathx(atoms)
  pd.post("self._loadpath: " .. self._loadpath)
end