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

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

eggref/4/ola: update for ola egg version 0.4

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