Changeset - 1db548d395fb
[Not reviewed]
default
0 1 0
Drew Perttula - 8 years ago 2017-05-30 06:14:49
drewp@bigasterisk.com
simplify sequencer.compileGraph call
Ignore-this: 436115a9e862f05cdd7ed310fa5e659e
1 file changed with 0 insertions and 13 deletions:
0 comments (0 inline, 0 general)
light9/effect/sequencer.py
Show inline comments
 
@@ -158,38 +158,25 @@ class Sequencer(object):
 

	
 
        self.recentUpdateTimes = []
 
        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):
 
        log.info('compileGraph request')
 
        self._compileGraphRun()
 
        return
 

	
 
        # may not help
 
        if self._compileGraphCall:
 
            self._compileGraphCall.cancel()
 
        self._compileGraphCall = reactor.callLater(
 
            .5,
 
            self.graph.addHandler, self._compileGraphRun)
 

	
 
    def _compileGraphRun(self):
 
        """rebuild our data from the graph"""
 
        self._compileGraphCall = None
 
        log.info('compileGraph start')
 
        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')
 

	
 
    @stats.update.time()
0 comments (0 inline, 0 general)