Changeset - 3cbe7110d8f7
[Not reviewed]
default
0 1 0
dmcc - 23 years ago 2002-07-07 12:11:42

cleanup imports, fix backwards colors in changing level direction
cleanup imports, fix backwards colors in changing level direction
indicators
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
light8/rsn.py
Show inline comments
 
#!/usr/bin/env python
 
from __future__ import nested_scopes
 

	
 
from Tkinter import *
 
from time import sleep
 
from signal import *
 
import sys, thread, cPickle, math
 
from signal import signal, SIGINT
 
import sys, cPickle
 

	
 
import io
 
from uihelpers import *
 
from panels import *
 
from Xfader import *
 
import stage
 

	
 
if len(sys.argv) >= 2:
 
    DUMMY = 0
 
    print "This is the real thing, baby"
 
    window_title = "Light 8.8 (On Air)"
 
else:
 
    DUMMY = 1
 
    print "Dummy mode"
 
    window_title = "Light 8.8 (Bogus)"
 

	
 
root = Tk()
 
root.wm_title(window_title)
 
root.wm_geometry('+462+470')
 
root.tk_focusFollowsMouse()
 

	
 
import Subs, Patch
 

	
 
def get_data(*args):
 
@@ -91,51 +91,51 @@ class Lightboard:
 
        'rebuild interface, reload data'
 
        get_data()
 
        self.buildinterface()
 
        bindkeys(root,'<Escape>', self.quit)
 

	
 
    # this is called on a loop, and ALSO by the Scales
 
    def changelevel(self, *args):
 
        'Amp trims slider'
 

	
 
        levels = [0] * 68
 
        for name, s in Subs.subs.items():
 
            newlevels = s.get_levels(level=self.scalelevels[name].get())
 
            for (ch, fadelev) in newlevels.items():
 
                levels[ch-1] = max(levels[ch-1], fadelev)
 

	
 
        levels = [int(l) for l in levels]
 

	
 
        for lev,lab,oldlev,numlab in zip(levels, self.channel_levels, 
 
                                         self.oldlevels, 
 
                                         self.leveldisplay.number_labels):
 
            if lev != oldlev:
 
                lab.config(text="%d" % lev)
 
                colorlabel(lab)
 
                if lev < oldlev:
 
                    numlab['bg'] = 'red'
 
                    numlab['bg'] = 'blue'
 
                else:
 
                    numlab['bg'] = 'blue'
 
                    numlab['bg'] = 'red'
 
            else:
 
                numlab['bg'] = 'lightPink'
 

	
 
        self.oldlevels = levels[:]
 
            
 
        parportdmx.sendlevels(levels)
 

	
 
    def load(self):
 
        try:
 
            filename = '/tmp/light9.prefs'
 
            if DUMMY:
 
                filename += '.dummy'
 
            print "Loading from", filename
 
            file = open(filename, 'r')
 
            p = cPickle.load(file)
 
            for s, v in p.scalelevels.items():
 
                try:
 
                    self.scalelevels[s].set(v)
 
                except:
 
                    print "Couldn't set %s -> %s" % (s, v)
 
            for name, substate in p.substate.items():
 
                try:
 
                    Subs.subs[name].set_state(substate)
 
                except:
0 comments (0 inline, 0 general)