changeset 277:e7630a2072bd

awesome curvecalc control of ascoltami
author drewp@bigasterisk.com
date Fri, 17 Jun 2005 23:57:04 +0000
parents 77c39b6e71ab
children d20fda03a041
files bin/curvecalc light9/curve.py
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bin/curvecalc	Fri Jun 17 23:41:08 2005 +0000
+++ b/bin/curvecalc	Fri Jun 17 23:57:04 2005 +0000
@@ -42,6 +42,9 @@
             pass#self.player=None
         d.addCallback(sendtime)
         return d
+    
+    def seekplay_or_pause(self,t):
+        self.player.callRemote('seekplay_or_pause',t)
         
 class Subexpr:
     curveset = None
@@ -241,6 +244,7 @@
     raise SystemExit("song name is required, e.g. '05-mix'")
 
 music=Music()
+dispatcher.connect(lambda t: music.seekplay_or_pause(t),"music seek")
 
 zc = Zoomcontrol(root)
 zc.pack(side='top',fill='x')
@@ -286,7 +290,7 @@
 root.bind("<Control-Key-s>",savekey)
 
 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; Mousewheel zoom",
+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')
--- a/light9/curve.py	Fri Jun 17 23:41:08 2005 +0000
+++ b/light9/curve.py	Fri Jun 17 23:57:04 2005 +0000
@@ -81,6 +81,9 @@
         self.bind("<Key-Escape>",lambda ev:
                   dispatcher.send("see time",
                                   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)