-
Notifications
You must be signed in to change notification settings - Fork 25
/
server-options.lisp
58 lines (55 loc) · 1.76 KB
/
server-options.lisp
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
50
51
52
53
54
55
56
57
58
(in-package :sc)
(defvar *sc-plugin-paths*)
(defstruct server-options
(num-control-bus 16384)
(num-audio-bus 1024)
(num-input-bus 8)
(num-output-bus 8)
(block-size 64)
(hardware-buffer-size 0)
(hardware-samplerate 0)
(num-sample-buffers 1024)
(max-num-nodes 1024)
(max-num-synthdefs 1024)
(realtime-mem-size 8192)
(num-wire-buffers 64)
(num-random-seeds 64)
(load-synthdefs-p 1)
(publish-to-rendezvous-p 1)
(max-logins 64)
(verbosity 0)
(ugen-plugins-path (mapcar #'full-pathname *sc-plugin-paths*))
(device nil))
(defun build-server-options (server-options)
(reduce #'append
(mapcar (lambda (pair)
(let ((param-name (first pair))
(param-value (funcall (second pair) server-options)))
(when param-value
(list param-name
(if (stringp param-value)
param-value
(write-to-string param-value))))))
(list '("-c" server-options-num-control-bus)
'("-a" server-options-num-audio-bus)
'("-i" server-options-num-input-bus)
'("-o" server-options-num-output-bus)
'("-z" server-options-block-size)
'("-S" server-options-hardware-samplerate)
'("-b" server-options-num-sample-buffers)
'("-n" server-options-max-num-nodes)
'("-d" server-options-max-num-synthdefs)
'("-m" server-options-realtime-mem-size)
'("-w" server-options-num-wire-buffers)
'("-r" server-options-num-random-seeds)
'("-D" server-options-load-synthdefs-p)
'("-R" server-options-publish-to-rendezvous-p)
'("-l" server-options-max-logins)
'("-V" server-options-verbosity)
'("-H" server-options-device)))
:initial-value (let* ((paths (server-options-ugen-plugins-path server-options)))
(when paths
(list "-U" (format nil
#-windows "~{~a~^:~}"
#+windows "~{~a~^;~}"
paths))))))