source: project/wiki/eggref/4/ola @ 33284

Last change on this file since 33284 was 33284, checked in by John Foerch, 5 years ago

eggref/4/ola: fix typo

File size: 4.8 KB
Line 
1== ola
2
3[[toc:]]
4
5== Description
6
7Basic bindings for libola, Open Lighting Architecture.  Classes covered so
8far are DmxBuffer and StreamingClient.
9
10For bug reports, feature requests, and development versions, visit the
11[[https://github.com/retroj/ola-egg/|github project page]].
12
13== Authors
14
15* John J Foerch
16
17
18== Requirements
19=== Chicken Eggs
20
21* [[r7rs]]
22* [[srfi-99]]
23* [[foreigners]]
24* [[list-utils]]
25* [[matchable]]
26
27=== C Headers
28
29* ola (libola-dev)
30
31
32== API
33=== Version
34
35<procedure>(ola-version) => (major minor revision)</procedure>
36
37Return ola's version as a list.
38
39<procedure>(ola-version-string) => string</procedure>
40
41Return ola's version as a string.
42
43=== Logging
44
45<procedure>(init-logging [level] [output]) => bool</procedure>
46
47Level may be one of the following symbols:
48
49* log-level/none
50* log-level/fatal
51* log-level/warn
52* log-level/info
53* log-level/debug
54* log-level/max
55
56Output may be one of the following symbols:
57
58* log-output/stderr
59* log-output/syslog
60* log-output/null
61
62=== DmxBuffer
63
64<procedure>(dmxbuffer) => dmxbuffer</procedure>
65
66Construct a new empty dmxbuffer.
67
68<procedure>(dmxbuffer other-dmxbuffer) => dmxbuffer</procedure>
69
70Construct a new dmxbuffer with the same contents as other-dmxbuffer.
71
72<procedure>(dmxbuffer blob) => dmxbuffer</procedure>
73
74Constructs a new dmxbuffer with the same contents as blob.
75
76<procedure>(dmxbuffer? dmxbuffer) => bool</procedure>
77
78Dmxbuffer predicate.
79
80<procedure>(dmxbuffer=? dmxbuffer-a dmxbuffer-b) => bool</procedure>
81
82Test whether dmxbuffer-a and dmxbuffer-b have equal contents.
83
84<procedure>(dmxbuffer-size dmxbuffer) => size</procedure>
85
86Size of dmxbuffer.
87
88<procedure>(dmxbuffer-get dmxbuffer) => blob</procedure>
89
90Return contents of dmxbuffer as a blob.
91
92<procedure>(dmxbuffer-get-channel dmxbuffer channel) => value</procedure>
93
94Return the value of the given channel in dmxbuffer.
95
96<procedure>(dmxbuffer-get-range dmxbuffer offset length) => blob</procedure>
97
98Return a blob of the requested range in dmxbuffer.
99
100<procedure>(dmxbuffer-set! dmxbuffer blob offset size) => bool</procedure>
101
102Set the contents of dmxbuffer to contents of blob at given offset and size.
103
104<procedure>(dmxbuffer-set! dmxbuffer blob) => bool</procedure>
105
106Set the contents of dmxbuffer to contents of blob.
107
108<procedure>(dmxbuffer-set! dmxbuffer dmxbuffer-other) => bool</procedure>
109
110Set the contents of dmxbuffer to contents of dmxbuffer-other.
111
112<procedure>(dmxbuffer-set-channel! dmxbuffer channel value) => undefined</procedure>
113
114Set dmxbuffer channel to value.
115
116<procedure>(dmxbuffer-set-from-string! dmxbuffer str) => bool</procedure>
117
118Complement of dmxbuffer->string.  Sets the contents of dmxbuffer according to the specially formatted string str.  The format of the string is integers separated by commas, where 0's may be omitted, e.g. "1,2,,255"
119
120<procedure>(dmxbuffer-set-range! dmxbuffer dst-offset blob) => bool</procedure>
121
122Set contents of dmxbuffer from dst-offset to contents of blob.
123
124<procedure>(dmxbuffer-set-range! dmxbuffer dst-offset blob src-offset src-length) => bool</procedure>
125
126Set contents of dmxbuffer from dst-offset to contents of blob, from src-offset, src-length bytes.
127
128<procedure>(dmxbuffer-set-range-to-value! dmxbuffer offset value length) => bool</procedure>
129
130Set contents of dmxbuffer from offset for length to value.
131
132<procedure>(dmxbuffer-htp-merge! dmxbuffer other-dmxbuffer) => bool</procedure>
133
134Perform an HTP merge (high value merge) with other-dmxbuffer into dmxbuffer.
135
136<procedure>(dmxbuffer-blackout! dmxbuffer) => bool</procedure>
137
138Set all channels to 0 in dmxbuffer.
139
140<procedure>(dmxbuffer-reset! dmxbuffer) => undefined</procedure>
141
142Reset dmxbuffer size to 0.
143
144<procedure>(dmxbuffer->string dmxbuffer) => string</procedure>
145
146Complement of 'dmxbuffer-set-from-string!'.  Returns a human-readable
147string representing the contents of dmxbuffer - comma separated decimal
148values.
149
150=== StreamingClient
151
152<procedure>(streamingclient [auto-start: bool] [server-port: port]) => streamingclient</procedure>
153
154Constructs a client and attempts to establish a connection to the ola
155daemon.  Auto-start is whether to start olad if it is not already running,
156default true.  Server-port is the port to use, default 9010.  Signals an
157'(exn ola)' condition if it fails to connect to the ola daemon.
158
159<procedure>(streamingclient-stop streamingclient) => undefined</procedure>
160
161Stops a streamingclient.
162
163<procedure>(streamingclient-send-dmx streamingclient universe dmxbuffer) => bool</procedure>
164
165Sends contents of dmxbuffer to the given universe on streamingclient.
166
167
168== Examples
169
170<enscript>
171(use ola)
172(let ((client (streamingclient auto-start: #f)))
173  (streamingclient-send-dmx client 0 (dmxbuffer (string->blob "AeIoUaEiO"))))
174</enscript>
175
176
177== License
178
179LGPL-3
180
181
182== Version History
183
184* 0.1 (2016-03-12) initial release
185* 0.2 (2016-03-13) meta and documentation
186* 0.3 (2016-03-13) streamingclient-setup removed, ola-version added
Note: See TracBrowser for help on using the repository browser.