Changeset - e7630a2072bd
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 20 years ago 2005-06-17 23:57:04
drewp@bigasterisk.com
awesome curvecalc control of ascoltami
2 files changed with 8 insertions and 1 deletions:
0 comments (0 inline, 0 general)
bin/curvecalc
Show inline comments
 
@@ -39,12 +39,15 @@ class Music:
 
            dispatcher.send("input time",val=t)
 
            return t # pass along to the real receiver
 
        def error(e):
 
            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
 
    def __init__(self,curveset,expr=""):
 
        self.curveset = curveset
 
        self.lasteval = None
 
@@ -238,12 +241,13 @@ options,args = parser.parse_args()
 
try:
 
    song = args[0]
 
except IndexError:
 
    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')
 

	
 
curveset = Curveset()
 
csv = Curvesetview(root,curveset)
 
@@ -283,13 +287,13 @@ def savekey(*args):
 
    print "saved"
 

	
 
    
 
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')
 

	
 
recent_t=[]
 
later = None
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("<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)
 

	
 
    def current_time(self):
 
        return self._time
0 comments (0 inline, 0 general)