Changeset - ae9f5ac1a48b
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 8 years ago 2017-06-10 23:32:27
drewp@bigasterisk.com
sequencer logging
Ignore-this: 1ec02885f6c28015576b3b00116afa00
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/effect/sequencer.py
Show inline comments
 
@@ -161,33 +161,34 @@ class Sequencer(object):
 
        self.lastStatLog = 0
 
        self._compileGraphCall = None
 
        self.notes = {} # song: [notes]
 
        self.graph.addHandler(self.compileGraph)
 
        self.update()
 

	
 
        self.codeWatcher = CodeWatcher(
 
            onChange=lambda: self.graph.addHandler(self.compileGraph))
 

	
 
    def compileGraph(self):
 
        """rebuild our data from the graph"""
 
        log.info('compileGraph start')
 
        t1 = time.time()
 
        g = self.graph
 

	
 
        sharedEffectOutputs = {}
 

	
 
        for song in g.subjects(RDF.type, L9['Song']):
 
            self.notes[song] = []
 
            for note in g.objects(song, L9['note']):
 
                self.notes[song].append(Note(g, note, effecteval, sharedEffectOutputs))
 
        log.info('compileGraph done')
 
        log.info('compileGraph done %.2f ms', 1000 * (time.time() - t1))
 

	
 
    @stats.update.time()
 
    def update(self):
 
        now = time.time()
 
        self.recentUpdateTimes = self.recentUpdateTimes[-20:] + [now]
 
        stats.recentFps = len(self.recentUpdateTimes) / (self.recentUpdateTimes[-1] - self.recentUpdateTimes[0] + .0001)
 
        if now > self.lastStatLog + 10:
 
            log.info("%.2f fps", stats.recentFps)
 
            self.lastStatLog = now
 
        
 
        reactor.callLater(1 / self.fps, self.update)
 

	
0 comments (0 inline, 0 general)