Mercurial > code > home > repos > light9
annotate light8/dmxclient.py @ 167:79bc84310e80
changes from tonight's rehearsal:
changes from tonight's rehearsal:
- CueFader is closer to actually running the show, computes DMX levels
to send.
- KeyboardComposer is not a dummy. Use DMXDUMMY=1 to disable it.
- Submaster: subs can now be "temporary" -- i.e. they shouldn't be saved
or loaded. to save a temporary sub, make a copy of it with a proper name
since the computed name will be ugly.
Also, get_normalized_copy() and crossfade() methods added.
linear_fade helper (shouldn't be in Submaster, probably) added too.
- dmxchanedit: longer labels
- cuelist1 now has some bogus data in it and some crap removed
- dmxclient: now listens to the $DMXHOST and $DMXDUMMY env variables.
- patchdata: now up to date with this year's show
- danshow subs song{01..19}: removed. maybe we'll re-add them in an
archive directory.
author | dmcc |
---|---|
date | Tue, 08 Jul 2003 16:19:55 +0000 |
parents | 2dfe2c0ba052 |
children | 238eede02bf9 |
rev | line source |
---|---|
0 | 1 """ module for clients to use for easy talking to the dmx |
2 server. sending levels is now a simple call to | |
3 dmxclient.outputlevels(..) | |
4 | |
5 client id is formed from sys.argv[0] and the PID. """ | |
6 | |
7 import xmlrpclib,os,sys,socket,time | |
8 _dmx=None | |
9 | |
10 _id="%s-%s" % (sys.argv[0].replace('.py','').replace('./',''),os.getpid()) | |
11 | |
120
b75bfbcf5979
new modules: dmxclient provides a very convenient way for clients to talk to the
drewp
parents:
0
diff
changeset
|
12 def outputlevels(levellist): |
0 | 13 """present a list of dmx channel levels, each scaled from |
14 0..1. list can be any length- it will apply to the first len() dmx | |
15 channels. | |
16 | |
17 if the server is not found, outputlevels will block for a | |
18 second.""" | |
19 | |
20 global _dmx,_id | |
21 | |
22 if _dmx is None: | |
167 | 23 host = os.getenv('DMXHOST', 'localhost') |
24 _dmx=xmlrpclib.Server("http://%s:8030" % host) | |
0 | 25 |
120
b75bfbcf5979
new modules: dmxclient provides a very convenient way for clients to talk to the
drewp
parents:
0
diff
changeset
|
26 try: |
b75bfbcf5979
new modules: dmxclient provides a very convenient way for clients to talk to the
drewp
parents:
0
diff
changeset
|
27 _dmx.outputlevels(_id,levellist) |
b75bfbcf5979
new modules: dmxclient provides a very convenient way for clients to talk to the
drewp
parents:
0
diff
changeset
|
28 except socket.error,e: |
141 | 29 print "dmx server error %s, waiting"%e |
120
b75bfbcf5979
new modules: dmxclient provides a very convenient way for clients to talk to the
drewp
parents:
0
diff
changeset
|
30 time.sleep(1) |
b75bfbcf5979
new modules: dmxclient provides a very convenient way for clients to talk to the
drewp
parents:
0
diff
changeset
|
31 except xmlrpclib.Fault,e: |
b75bfbcf5979
new modules: dmxclient provides a very convenient way for clients to talk to the
drewp
parents:
0
diff
changeset
|
32 print "outputlevels had xml fault: %s" % e |
b75bfbcf5979
new modules: dmxclient provides a very convenient way for clients to talk to the
drewp
parents:
0
diff
changeset
|
33 time.sleep(1) |
0 | 34 |
167 | 35 dummy = os.getenv('DMXDUMMY') |
36 if dummy: | |
37 print "dmxclient: DMX is in dummy mode." | |
38 def bogus(*args): | |
39 pass | |
40 outputlevels = bogus |