Changeset - b05423b17c46
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 15 years ago 2010-06-15 05:38:24
drewp@bigasterisk.com
remove curvecalc's old intro/post cheats, replace with slightly better ones
Ignore-this: abdfdba8eedd6e050f88d3f4b0d82efc
2 files changed with 17 insertions and 9 deletions:
0 comments (0 inline, 0 general)
light9/curve.py
Show inline comments
 
@@ -13,6 +13,10 @@ from light9.dmxchanedit import gradient
 
from light9.zoomcontrol import RegionZoom
 
from bcf2000 import BCF2000
 

	
 
# todo: move to config, consolidate with ascoltami, musicPad, etc
 
introPad = 4
 
postPad = 4
 

	
 
class Curve(object):
 
    """curve does not know its name. see Curveset"""
 
    points = None # x-sorted list of (x,y)
 
@@ -418,20 +422,24 @@ class Curveview(tk.Canvas):
 
        if t2-t1<30:
 
            for t in range(int(t1),int(t2)+1):
 
                mark(t,str(t))
 
        mark(-4,"-4")
 
        mark(introPad, str(introPad))
 

	
 
        endtimes = dispatcher.send("get max time")
 
        if endtimes:
 
            endtime = endtimes[0][1]
 
            mark(endtime,"end %.1f"%endtime)
 
            mark(endtime+10,"post %.1f"%(endtime+10))
 
            mark(endtime - postPad, "post %.1f" % (endtime - postPad))
 
        
 
    def _draw_one_marker(self,t,label):
 
        x = self.screen_from_world((t,0))[0]
 
        ht = self.height
 
        self.create_line(x,ht,x,ht-20, fill='white',
 
                         tags=('curve',))
 
        self.create_text(x,ht-20,text=label,anchor='s', fill='white',
 
        if not 0 <= x < self.winfo_width():
 
            return
 
        x = max(5, x) # cheat left-edge stuff onscreen
 
        self.create_line(x, ht,
 
                         x, ht - 20,
 
                         fill='white', tags=('curve',))
 
        self.create_text(x, ht-20, text=label, anchor='s', fill='white',
 
                         font="arial 7", tags=('curve',))
 

	
 

	
 
@@ -682,7 +690,7 @@ class Curveset:
 
        return self.curves.copy()
 
    
 
    def get_time_range(self):
 
        return -4, dispatcher.send("get max time")[0][1]+15
 
        return 0, dispatcher.send("get max time")[0][1]
 

	
 
    def new_curve(self,name):
 
        if name=="":
light9/zoomcontrol.py
Show inline comments
 
@@ -8,7 +8,7 @@ from light9 import cursors
 

	
 
class Zoomcontrol(object,tk.Canvas):
 

	
 
    mintime=-5
 
    mintime = 0
 

	
 
    def maxtime():
 
        doc = "seconds at the right edge of the bar"
 
@@ -75,7 +75,7 @@ class Zoomcontrol(object,tk.Canvas):
 
        
 
        dispatcher.connect(lambda: (self.start,self.end),"zoom area",weak=0)
 
        dispatcher.connect(self.input_time,"input time")
 
        dispatcher.connect(lambda maxtime: (setattr(self,'maxtime',maxtime+15),
 
        dispatcher.connect(lambda maxtime: (setattr(self,'maxtime',maxtime),
 
                                            self.redrawzoom()),
 
                           "max time",weak=0)
 
        dispatcher.connect(self.zoom_about_mouse, "zoom about mouse")
 
@@ -167,7 +167,7 @@ class Zoomcontrol(object,tk.Canvas):
 
        lastx=-1000
 
        for t in range(0,int(self.maxtime)):
 
            x = self.can_for_t(t)
 
            if 0<x<self.winfo_width() and x-lastx>30:
 
            if 0 < x < self.winfo_width() and x-lastx>30:
 
                txt=str(t)
 
                if lastx==-1000:
 
                    txt=txt+"sec"
0 comments (0 inline, 0 general)