Changeset - e3362ad9a123
[Not reviewed]
default
0 3 0
David McClosky - 20 years ago 2005-06-17 20:21:31
dmcc@bigasterisk.com
curvecalc gets "see time until end", C-r for reload, doc updates
3 files changed with 14 insertions and 1 deletions:
0 comments (0 inline, 0 general)
bin/curvecalc
Show inline comments
 
@@ -222,17 +222,19 @@ def add_one_subterm(subname, curveset, s
 
def sub_commands_tk(master, curveset, subterms, root, ssv):
 
    f=tk.Frame(master,relief='raised',bd=1)
 
    newname = tk.StringVar()
 

	
 
    def add_cmd():
 
        add_one_subterm(newname.get(), curveset, subterms, root, ssv, '')
 
        newname.set('')
 

	
 
    def reload_subs():
 
        dispatcher.send('reload all subs')
 

	
 
    tk.Button(f, text="reload subs", command=reload_subs).pack(side='left')
 
    tk.Button(f, text="reload subs (C-r)", 
 
        command=reload_subs).pack(side='left')
 
    tk.Button(f,text="new subterm named:", command=add_cmd).pack(side='left')
 
    tk.Entry(f,textvariable=newname).pack(side='left',fill='x',exp=1)
 
    return f
 
    
 
#######################################################################
 
root=tk.Tk()
 
@@ -290,12 +292,13 @@ def savekey(*args):
 
    print "saving",song
 
    savesubterms(showconfig.subtermsForSong(song),subterms)
 
    curveset.save(basename=os.path.join(showconfig.curvesDir(),song))
 
    print "saved"
 
    
 
root.bind("<Control-Key-s>",savekey)
 
root.bind("<Control-Key-r>", lambda evt: dispatcher.send('reload all subs'))
 

	
 
create_status_lines(root)
 
for helpline in ["Bindings: C-s save subterms; B1 drag point; C-B1 curve add point; 1..5 add point at time; Esc see current time; S-Esc see curtime to end; Mousewheel zoom; C-p play/pause music at mouse",
 
                 "Available in functions: nsin/ncos period=amp=1; within(a,b) bef(x) aft(x) compare to time; smoove(x) cubic smoothstep; curvename(t) eval curve"]:
 
    tk.Label(root,text=helpline, font="Helvetica -12 italic",
 
             anchor='w').pack(side='top',fill='x')
light9/curve.py
Show inline comments
 
@@ -78,12 +78,15 @@ class Curveview(tk.Canvas):
 
                      dispatcher.send("zoom about mouse",
 
                                      t=self.world_from_screen(ev.x,0)[0],
 
                                      factor=factor))
 
        self.bind("<Key-Escape>",lambda ev:
 
                  dispatcher.send("see time",
 
                                  t=self.current_time()))
 
        self.bind("<Shift-Escape>", lambda ev:
 
                  dispatcher.send("see time until end",
 
                                  t=self.current_time()))
 
        self.bind("<Control-p>", lambda ev:
 
                  dispatcher.send("music seek",
 
                                  t=self.world_from_screen(ev.x,0)[0]))
 

	
 
        # this binds on c-a-b1, etc
 
        RegionZoom(self, self.world_from_screen, self.screen_from_world)
light9/zoomcontrol.py
Show inline comments
 
@@ -74,12 +74,13 @@ class Zoomcontrol(object,tk.Canvas):
 
        dispatcher.connect(self.input_time,"input time")
 
        dispatcher.connect(lambda maxtime: (setattr(self,'maxtime',maxtime+15),
 
                                            self.redrawzoom()),
 
                           "max time",weak=0)
 
        dispatcher.connect(self.zoom_about_mouse,"zoom about mouse")
 
        dispatcher.connect(self.see_time,"see time")
 
        dispatcher.connect(self.see_time_until_end, "see time until end")
 
        dispatcher.connect(self.zoom_to_range,"zoom to range")
 
        self.created=1
 
    def zoom_to_range(self,start,end):
 
        self.start = start
 
        self.end = end
 
        self.redrawzoom()
 
@@ -94,12 +95,18 @@ class Zoomcontrol(object,tk.Canvas):
 
        margin = vis_seconds * .1
 
        if t < self.start or t > (self.end - vis_seconds * .3):
 
            self.offset = t - margin
 

	
 
        self.redrawzoom()
 
            
 
    def see_time_until_end(self, t):
 
        self.start = t - 2
 
        self.end = self.maxtime
 

	
 
        self.redrawzoom()
 
            
 
    def input_time(self,val):
 
        t=val
 
        x=self.can_for_t(t)
 
        self.coords(self.time,x,0,x,self.winfo_height())
 
    def press(self,ev,attr):
 
        self.adjustingattr = attr
0 comments (0 inline, 0 general)