Personal tools
The Open Lighting Project has moved!

We've launched our new site at www.openlighting.org. This wiki will remain and be updated with more technical information.

OLA Python API

From wiki.openlighting.org

Revision as of 10:45, 13 October 2007 by 69.181.26.114 (talk)
Jump to: navigation, search

Building the Python Bindings

See Building LLA but run ./configure --enable-python-libs

Interesting Classes

LlaClient
the main connection class
dmxBuffer
represents a list of DMX channel values
LlaClientObserver
base class to handle events
LlaPlugin
represents a Plugin
LlaDevice
represents a Device

Sending DMX

A simple example to send DMX:

from lla import *
import sys

con = LlaClient()
if con.start():
  sys.exit()

universe = 0

# create a dmxBuffer for the channel values
DMX_LEN = 512
dmx = dmxBuffer(DMX_LEN)
for i in range(0, DMX_LEN):
  dmx[i] = i

con.send_dmx(universe, dmx, DMX_LEN)

Receiving DMX

Receiving is slightly harder, we need to setup an Observer object to handle the events:

from lla import *
import sys