![]() |
Open Lighting Architecture
0.9.1
|
This page introduces the OLA Client API, and provides sample programs to send and receive DMX512 data from olad.
Once OLA is installed on your system, the examples can be built with:
g++ example.cpp $(pkg-config --cflags --libs libola)
The quickest way to get started is by using ola::StreamingClient. The program below sends 100 frames of DMX data to the olad server on universe 1. The frames are sent 25ms apart which gives a frame rate of 40 fps.
Each frame consists of 512 DMX data slots. The first slot is incremented by one each frame, the other slots are always 0. This produces the following DMX frames:
Time (ms) DMX Data
0 0,0,0,0,.....
25 1,0,0,0,.....
50 2,0,0,0,.....
75 3,0,0,0,.....
....
2475 100,0,0,0,.....
While ola::StreamingClient is easy to use it has the drawback that it can only send DMX512 data. It's not possible to retrieve information (like the active universes etc.) from olad using the StreamingClient.
The ola::OlaCallbackClient provides a much richer interface for interacting with the server. However, because of this it's slightly harder to use.
The following code behaves thes same as the Streaming Client Sender example.
1.8.1.2