Changeset - 5656767ca025
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 13 years ago 2012-06-15 20:49:57
drewp@bigasterisk.com
first drop action of a sub successfully gets current music time
Ignore-this: 1e0b9a46c771e5e51c182c2a45e259cc
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
bin/curvecalc
Show inline comments
 
@@ -45,12 +45,13 @@ class SubtermExists(ValueError):
 
    pass
 

	
 
class Main(object):
 
    def __init__(self, graph, opts, song, curveset, subterms, music):
 
        self.graph, self.opts, self.song = graph, opts, song
 
        self.curveset, self.subterms, self.music = curveset, subterms, music
 
        self.lastSeenInputTime = 0
 

	
 
        wtree = self.wtree = gtk.Builder()
 
        wtree.add_from_file("light9/curvecalc/curvecalc.glade")
 
        mainwin = wtree.get_object("MainWindow")
 
        
 
        mainwin.connect("destroy", self.onQuit)
 
@@ -93,13 +94,13 @@ class Main(object):
 

	
 
        try:
 
            self.makeSubterm(subName, withCurve=True)
 
        except SubtermExists:
 
            pass
 
        curveView = self.curvesetView.row(subName).curveView
 
        t = curveView.current_time()
 
        t = self.lastSeenInputTime # curveView.current_time() # new curve hasn't heard the time yet
 
        print "time", t
 
        curveView.add_point((t - .5, 0))
 
        curveView.add_point((t, 1))
 
            
 

	
 
    def onNewCurve(self, *args):
 
@@ -215,12 +216,14 @@ class Main(object):
 
            key.set_alignment(1, 0)
 
            value.set_alignment(0, 0)
 

	
 
            dispatcher.connect(lambda val, value=value, tf=textfilter:
 
                               value.set_text(tf(val)),
 
                               signame, weak=False)
 
        dispatcher.connect(lambda val: setattr(self, 'lastSeenInputTime', val),
 
                           'input time', weak=False)
 
        master.show_all()
 

	
 
    def refreshCurveView(self):
 
        wtree = self.wtree
 
        mtimes = [os.path.getmtime(f) for f in [
 
            'light9/curvecalc/curveview.py',
0 comments (0 inline, 0 general)