Changeset - c5e44bab7c9a
[Not reviewed]
default
0 1 0
Drew Perttula - 11 years ago 2014-06-02 01:21:03
drewp@bigasterisk.com
greplin.scales api fix
Ignore-this: b622bd759e9c0011fd427c2c72333d45
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
bin/effecteval
Show inline comments
 
@@ -171,49 +171,49 @@ class EffectLoop(object):
 
                if song != self.currentSong:
 
                    self.currentSong = song
 
                    # this may be piling on the handlers
 
                    self.graph.addHandler(self.setEffects)
 

	
 
                if song is None:
 
                    return
 

	
 
                outSubs = []
 
                for e in self.currentEffects:
 
                    outSubs.append(e.eval(songTime))
 
                out = Submaster.sub_maxes(*outSubs)
 

	
 
                dmx = out.get_dmx_list()
 

	
 
                if log.isEnabledFor(logging.DEBUG):
 
                    log.debug("send dmx: %r", out.get_levels())
 

	
 
                with self.stats.writeDmx.time():
 
                    yield dmxclient.outputlevels(dmx, twisted=True)
 

	
 
                elapsed = time.time() - t1
 
                dt = max(0, self.period - elapsed)
 
        except Exception:
 
            self.stats.errors.mark()
 
            self.stats.errors += 1
 
            traceback.print_exc()
 
            dt = 1
 

	
 
        reactor.callLater(dt, self.sendLevels)
 
    
 
class App(object):
 
    def __init__(self, show):
 
        self.show = show
 
        self.graph = SyncedGraph("effectEval")
 
        self.graph.initiallySynced.addCallback(self.launch)
 

	
 
        self.stats = scales.collection('/',
 
                                       scales.PmfStat('sendLevels'),
 
                                       scales.PmfStat('getMusic'),
 
                                       scales.PmfStat('writeDmx'),
 
                                       scales.IntStat('errors'),
 
                                       )
 

	
 
    def launch(self, *args):
 
        self.loop = EffectLoop(self.graph, self.stats)
 
        
 
        SFH = cyclone.web.StaticFileHandler
 
        self.cycloneApp = cyclone.web.Application(handlers=[
 
            (r'/()', SFH,
0 comments (0 inline, 0 general)