diff options
author | Ben Connors <benconnors@outlook.com> | 2019-11-08 17:08:02 -0500 |
---|---|---|
committer | Ben Connors <benconnors@outlook.com> | 2019-11-08 17:08:02 -0500 |
commit | 1884a5197fbdf98bdaebafe2b25e3a7181967e30 (patch) | |
tree | f52cf449c61296970427570e2995a3dacdf5b3db /interface/ola.py | |
parent | 1f037f48e5badab2b758c4b9bd0541c5ccda7b3f (diff) |
Move to OLA rendering; bugfix
- Chaser.advance not using proper audio ID
- Add OLA renderer as main one
Diffstat (limited to 'interface/ola.py')
-rw-r--r-- | interface/ola.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/interface/ola.py b/interface/ola.py new file mode 100644 index 0000000..445b991 --- /dev/null +++ b/interface/ola.py @@ -0,0 +1,22 @@ +import array + +from ola.OlaClient import OlaClient + +class OLAOutput: + def set_values(self, values): + send = set() + for c, v in values.items(): + univ, addr = c.address + if univ not in self.universes: + self.universes[univ] = array.array('B', (0 for i in range(512))) + uni = self.universes[univ] + if uni[addr] != v: + uni[addr] = v + send.add(univ) + for univ in send: + self.client.SendDmx(univ, self.universes[univ]) + + def __init__(self): + self.client = OlaClient() + + self.universes = {1: array.array('B', (0 for i in range(512)))} |