Mercurial > code > home > repos > light9
annotate flax/littletimeline.py @ 119:6f9898f00c9c
now uses dmxclient to talk to dmxserver
author | drewp |
---|---|
date | Fri, 13 Jun 2003 13:59:32 +0000 |
parents | b6ccc325f1ec |
children | 2f48cb9219ed |
rev | line source |
---|---|
0 | 1 #!/usr/bin/python |
2 | |
113
b6ccc325f1ec
a demo client that gets times from ascoltami player (in semprini/) and sends a light
drewp
parents:
0
diff
changeset
|
3 """ |
b6ccc325f1ec
a demo client that gets times from ascoltami player (in semprini/) and sends a light
drewp
parents:
0
diff
changeset
|
4 a test that listens to ascoltami player and outputs a light to dmxserver |
b6ccc325f1ec
a demo client that gets times from ascoltami player (in semprini/) and sends a light
drewp
parents:
0
diff
changeset
|
5 """ |
b6ccc325f1ec
a demo client that gets times from ascoltami player (in semprini/) and sends a light
drewp
parents:
0
diff
changeset
|
6 import xmlrpclib,time,socket,os |
0 | 7 |
8 player=xmlrpclib.Server("http://localhost:8040") | |
113
b6ccc325f1ec
a demo client that gets times from ascoltami player (in semprini/) and sends a light
drewp
parents:
0
diff
changeset
|
9 dmx=xmlrpclib.Server("http://localhost:8030") |
b6ccc325f1ec
a demo client that gets times from ascoltami player (in semprini/) and sends a light
drewp
parents:
0
diff
changeset
|
10 |
b6ccc325f1ec
a demo client that gets times from ascoltami player (in semprini/) and sends a light
drewp
parents:
0
diff
changeset
|
11 print "found both servers" |
0 | 12 |
13 t1=time.time() | |
14 while 1: | |
15 try: | |
16 playtime=player.gettime() | |
17 except socket.error,e: | |
18 print "server error %r, waiting"%e | |
19 time.sleep(2) | |
113
b6ccc325f1ec
a demo client that gets times from ascoltami player (in semprini/) and sends a light
drewp
parents:
0
diff
changeset
|
20 print time.time()-t1,playtime |
b6ccc325f1ec
a demo client that gets times from ascoltami player (in semprini/) and sends a light
drewp
parents:
0
diff
changeset
|
21 try: |
b6ccc325f1ec
a demo client that gets times from ascoltami player (in semprini/) and sends a light
drewp
parents:
0
diff
changeset
|
22 dmx.outputlevels("littletimeline-%s"%os.getpid(),[.01*(playtime)%100]) |
b6ccc325f1ec
a demo client that gets times from ascoltami player (in semprini/) and sends a light
drewp
parents:
0
diff
changeset
|
23 except xmlrpclib.Fault,e: |
b6ccc325f1ec
a demo client that gets times from ascoltami player (in semprini/) and sends a light
drewp
parents:
0
diff
changeset
|
24 print "outputlevels: %s" % e |
b6ccc325f1ec
a demo client that gets times from ascoltami player (in semprini/) and sends a light
drewp
parents:
0
diff
changeset
|
25 |
0 | 26 time.sleep(.01) |