-
Notifications
You must be signed in to change notification settings - Fork 29
/
scnvim.lua
49 lines (40 loc) · 1.09 KB
/
scnvim.lua
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--- scnvim public interface.
-- @module scnvim
-- @author David Granström
-- @license GPLv3
local sclang = require('scnvim.sclang')
local scnvim = {}
--- Evalute a SuperCollider expression.
-- @param expr Any valid SuperCollider expression.
function scnvim.send(expr)
sclang.send(expr, false)
end
--- Evalute a SuperCollider expression without feedback from the post window.
-- @param expr Any valid SuperCollider expression.
function scnvim.send_silent(expr)
sclang.send(expr, true)
end
--- Evalute a SuperCollider expression and get the result in a callback.
-- @param expr Any valid SuperCollider expression.
-- @param cb A callback with a result argument.
function scnvim.eval(expr, cb)
sclang.eval(expr, cb)
end
--- Start sclang.
function scnvim.start()
sclang.start()
end
--- Stop sclang.
function scnvim.stop()
sclang.stop()
end
--- Recompile class library.
function scnvim.recompile()
sclang.recompile()
end
--- Determine if a sclang process is active.
-- @returns True if sclang is running otherwise false.
function scnvim.is_running()
return sclang.is_running()
end
return scnvim