Mercurial > code > home > repos > light9
changeset 113:b6ccc325f1ec
a demo client that gets times from ascoltami player (in semprini/) and sends a light
a demo client that gets times from ascoltami player (in semprini/) and sends a light
level to dmxserver (in light8/)
author | drewp |
---|---|
date | Thu, 12 Jun 2003 17:12:11 +0000 |
parents | afbdae5e1359 |
children | d74caafb8ee5 |
files | flax/littletimeline.py |
diffstat | 1 files changed, 13 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/flax/littletimeline.py Wed Jun 11 09:36:35 2003 +0000 +++ b/flax/littletimeline.py Thu Jun 12 17:12:11 2003 +0000 @@ -1,15 +1,14 @@ #!/usr/bin/python -""" a test that listens to ascoltami player and outputs a light to -dmxserver """ - -from __future__ import division -import xmlrpclib,time,socket,sys -sys.path.append("../light8") -import dmxclient +""" +a test that listens to ascoltami player and outputs a light to dmxserver +""" +import xmlrpclib,time,socket,os player=xmlrpclib.Server("http://localhost:8040") -print "found player" +dmx=xmlrpclib.Server("http://localhost:8030") + +print "found both servers" t1=time.time() while 1: @@ -18,17 +17,10 @@ except socket.error,e: print "server error %r, waiting"%e time.sleep(2) - - lev=0 - for low,high,func in ((0,20,0), - (20,30,(playtime-20)/10), - (30,170,1), - (170,189,1-(playtime-170)/19), - ): - if low<=playtime<high: - lev=func - - print "Send",lev - dmxclient.outputlevels([lev]) - + print time.time()-t1,playtime + try: + dmx.outputlevels("littletimeline-%s"%os.getpid(),[.01*(playtime)%100]) + except xmlrpclib.Fault,e: + print "outputlevels: %s" % e + time.sleep(.01)