Changeset - 6284a812da50
[Not reviewed]
default
0 3 0
dmcc - 22 years ago 2002-07-07 06:53:32

makefile - add link to ../Widgets/FlyingFader.py
makefile - add link to ../Widgets/FlyingFader.py
panels.py - use above link, incorporate FlyingFaders. some layout issues,
nothing too borked
rsn.py - focus follows mouse so that FFaders get keystrokes
3 files changed with 16 insertions and 14 deletions:
0 comments (0 inline, 0 general)
light8/Makefile
Show inline comments
 
LIB=/usr/local/lib
 

	
 
go: parportmodule.so
 
	ln -s ../Widgets/FlyingFader.py
 
	sudo python pypar
 

	
 
parportmodule.so: parport_wrap.c
 
	gcc -shared -I/usr/local/include/python2.2 parport_wrap.c parport.c -o parportmodule.so 
 

	
 
parport_wrap.c: parport.c parport.i
 
	swig -python parport.i
 

	
 
clean:
 
	rm -f parport_wrap.c *.o *.so
 
\ No newline at end of file
 
	rm -f parport_wrap.c *.o *.so
light8/panels.py
Show inline comments
 
"""some of the panels"""
 

	
 
from Tkinter import *
 
from uihelpers import *
 
import Patch
 
from FlyingFader import FlyingFader
 

	
 
stdfont = ('Arial', 8)
 
monofont = ('Courier', 8)
 

	
 

	
 

	
 
class Controlpanel(Frame):
 
    def __init__(self,parent,xfader,refresh_cb,quit_cb):
 
        Frame.__init__(self,parent)
 
        controlpanel=self
 
        for txt,cmd in (
 
            ('Quit',       quit_cb),
 
@@ -53,59 +54,58 @@ class Leveldisplay:
 
                font=stdfont, padx=0, pady=0, bd=0, height=1).pack(side='left')
 
            Label(f,text=Patch.get_channel_name(channel), width=8, 
 
                font=stdfont, anchor='w', padx=0, pady=0, bd=0, height=1).pack(side='left')
 
            l=Label(f, width=3, bg='lightBlue', #text=_oldlevels[channel-1],
 
                font=stdfont, anchor='e', padx=1, pady=0, bd=0, height=1)
 
            l.pack(side='left')
 
            colorlabel(l)
 
            channel_levels.append(l)
 
            f.pack(side='top')
 
        # channel_levels is an output - changelevel will use it to access these labels
 

	
 
class Subpanels:
 
    def __init__(self,scenesparent,effectsparent,scalelevels,Subs,xfader,changelevel):
 
    def __init__(self, scenesparent, effectsparent, scalelevels, Subs, xfader,
 
        changelevel):
 
        
 
        sublist = Subs.subs.items()
 
        sublist.sort()
 

	
 
        for name, sub in sublist:
 
            if sub.is_effect:
 
                parent=effectsparent
 
            else:
 
                parent=scenesparent
 

	
 
            f=Frame(parent, bd=1, relief='raised')
 
            f.pack(fill='both',exp=1,side='left')
 

	
 
            if name not in scalelevels:
 
                scalelevels[name]=DoubleVar()
 

	
 
            sub.set_slider_var(scalelevels[name])
 

	
 
            scaleopts = {}
 
            if sub.color:
 
                scaleopts['troughcolor'] = sub.color
 
            s=Scale(f,command=lambda l,name=name: changelevel(name,l),showvalue=0,
 
                    length=300-17,variable=scalelevels[name],width=20,
 
                    to=0,res=.001,from_=1,bd=1, **scaleopts)
 
            l=Label(f,text=str(name), font=stdfont, padx=0, pady=0)
 
            v=Label(f,textvariable=scalelevels[name], font=stdfont, padx=0, pady=0)
 
            l.pack(side='bottom')
 
            v.pack(side='bottom')
 

	
 
            s = FlyingFader(f, label=str(name), variable=scalelevels[name],
 
                    showvalue=0, length=300-17,
 
                    width=20, to=0,res=.001,from_=1,bd=1, font=stdfont,
 
                    **scaleopts)
 

	
 
            for axis in ('y','x'):
 
                cvar=IntVar()
 
                cb=Checkbutton(f,text=axis,variable=cvar,font=stdfont, padx=0, pady=0, bd=1)
 
                cb=Checkbutton(f,text=axis,variable=cvar,font=stdfont, padx=0, 
 
                               pady=0, bd=1)
 
                button = ('Alt','Control')[axis=='y'] # unused?
 
    #            s.bind('<Key-%s>'%axis, lambda ev,cb=cb: cb.invoke)
 
                # s.bind('<Key-%s>'%axis, lambda ev,cb=cb: cb.invoke)
 
                cb.pack(side='bottom',fill='both', padx=0, pady=0)
 
                xfader.registerbutton(name,axis,cvar)
 

	
 
            s.pack(side='left')
 
            s.bind('<3>', lambda evt, v=scalelevels[name]: toggle_slider(v))\
 
            s.bind('<3>', 
 
                lambda evt, v=scalelevels[name]: toggle_slider(v))
 

	
 
            # effects frame?
 
            sframe = Frame(f,bd=2,relief='groove')
 
            sub.draw_tk(sframe)
 
            sframe.pack(side='left',fill='y')
 

	
 
    
light8/rsn.py
Show inline comments
 
@@ -15,24 +15,25 @@ 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('+447+373')
 
root.tk_focusFollowsMouse()
 

	
 
import Subs, Patch
 

	
 
def get_data(*args):
 
    Subs.reload_data(DUMMY)
 
    Patch.reload_data(DUMMY)
 
    print "Patch:", Patch.patch
 
    print "Subs:", ', '.join(Subs.subs.keys())
 

	
 
get_data()
 

	
 
io.init(DUMMY)
0 comments (0 inline, 0 general)