# HG changeset patch # User drewp@bigasterisk.com # Date 2008-06-15 23:11:48 # Node ID fb888a771b422aa05e5c1e592c6228ad26e71486 # Parent c5db6b33203079ce999c5b2b21c0e924950620a5 curvecalc now starts up showing the whole time range diff --git a/bin/curvecalc b/bin/curvecalc --- a/bin/curvecalc +++ b/bin/curvecalc @@ -433,6 +433,7 @@ musicfilename = showconfig.songOnDisk(so maxtime = wavelength(musicfilename) dispatcher.send("max time",maxtime=maxtime) dispatcher.connect(lambda: maxtime, "get max time",weak=0) +dispatcher.send("show all") curveset.load(basename=os.path.join(showconfig.curvesDir(), showconfig.songFilenameFromURI(song)), skipMusic=opts.skip_music) @@ -461,7 +462,7 @@ root.bind("",savekey) root.bind("", lambda evt: dispatcher.send('reload all subs')) create_status_lines(root) -for helpline in ["Bindings: C-s save subterms; Esc see current time; S-Esc see curtime to end; Mousewheel zoom; C-p play/pause music at mouse", +for helpline in ["Bindings: C-s save subterms; Esc see current time; S-Esc see curtime to end; C-Esc show all; Mousewheel zoom; C-p play/pause music at mouse", "Curve point bindings: B1 drag point; C-B1 curve add point; S-B1 sketch points; Del selected points; 1..5 add point at time; B1 drag select points", "Available in functions: nsin/ncos period=amp=1; within(a,b) bef(x) aft(x) compare to time; smoove(x) cubic smoothstep; chan(name); curvename(t) eval curve"]: tk.Label(root,text=helpline, font="Helvetica -12 italic", diff --git a/light9/curve.py b/light9/curve.py --- a/light9/curve.py +++ b/light9/curve.py @@ -183,6 +183,7 @@ class Curveview(tk.Canvas): self.bind("", lambda ev: dispatcher.send("see time until end", t=self.current_time())) + self.bind("", lambda ev: dispatcher.send("show all")) self.bind("", lambda ev: dispatcher.send("music seek", t=self.world_from_screen(ev.x,0)[0])) diff --git a/light9/zoomcontrol.py b/light9/zoomcontrol.py --- a/light9/zoomcontrol.py +++ b/light9/zoomcontrol.py @@ -81,6 +81,7 @@ class Zoomcontrol(object,tk.Canvas): 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.show_all, "show all") dispatcher.connect(self.zoom_to_range, "zoom to range") self.created=1 def zoom_to_range(self,start,end): @@ -88,6 +89,11 @@ class Zoomcontrol(object,tk.Canvas): self.end = end self.redrawzoom() + def show_all(self): + self.start = self.mintime + self.end = self.maxtime + self.redrawzoom() + def zoom_about_mouse(self,t,factor): self.start = t - factor*(t-self.start) self.end = t + factor*(self.end-t)