# HG changeset patch # User drewp # Date 2002-07-13 03:09:26 # Node ID d6c48d2d3bd630b72d5a68981615cc0258993b98 # Parent 827a675131dcb086895ecd7e08ccbff8d5f317c5 shrunk the useful range of the slider so there won't be any noise at the ends diff --git a/light8/ExternalInput.py b/light8/ExternalInput.py --- a/light8/ExternalInput.py +++ b/light8/ExternalInput.py @@ -7,7 +7,12 @@ currentlevels = [0,0,0,0] class NetSliderHandler(SocketServer.StreamRequestHandler): def handle(self): data = self.rfile.readline(1000) - currentlevels[:] = [float(x)/255 for x in list(data.split())] + currentlevels[:] = [round(self.bounds(float(x)/255),3) for x in list(data.split())] + def bounds(self,x): + # the last .1 both ways shall not do anything + x=x*1.1-.05 + x=min(1,max(0,x)) + return x def start_server(levelstorage=0): server = SocketServer.TCPServer(