Changeset - 0bfaeaa40cfe
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 10 years ago 2015-06-14 20:05:18
drewp@bigasterisk.com
debug effects
Ignore-this: 74e4b63b84eb58d37d1402400d77e8b4
2 files changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/Effects.py
Show inline comments
 
@@ -17,12 +17,16 @@ def register(f):
 

	
 
@register
 
class Strip(object):
 
    """list of r,g,b tuples for sending to an LED strip"""
 
    which = 'L' # LR means both. W is the wide one
 
    pixels = []
 

	
 
    def __repr__(self):
 
        return '<Strip which=%r px0=%r>' % (self.which, self.pixels[0,:])
 
    
 
    @classmethod
 
    def solid(cls, which='L', color=(1,1,1), hsv=None):
 
        """hsv overrides color"""
 
        if hsv is not None:
 
            color = colorsys.hsv_to_rgb(hsv[0] % 1.0, hsv[1], hsv[2])
 
        x = cls()
light9/effecteval/effectloop.py
Show inline comments
 
@@ -19,13 +19,13 @@ log = logging.getLogger('effectloop')
 
class EffectLoop(object):
 
    """maintains a collection of the current EffectNodes, gets time from
 
    music player, sends dmx"""
 
    def __init__(self, graph, stats):
 
        self.graph, self.stats = graph, stats
 
        self.currentSong = None
 
        self.currentEffects = []
 
        self.currentEffects = [] # EffectNodes for the current song plus the submaster ones
 
        self.lastLogTime = 0
 
        self.lastLogMsg = ""
 
        self.lastErrorLog = 0
 
        self.graph.addHandler(self.setEffects)
 
        self.period = 1 / 30
 
        self.coastSecs = .3 # main reason to keep this low is to notice play/pause
 
@@ -104,12 +104,13 @@ class EffectLoop(object):
 
        if self.currentPlaying:
 
            t += max(0, now - self.songTimeFetch)
 
        return t
 

	
 
    @inlineCallbacks
 
    def sendLevels(self):
 
        print ''
 
        t1 = time.time()
 
        log.debug("time since last call: %.1f ms" % (1000 * (t1 - self.lastSendLevelsTime)))
 
        self.lastSendLevelsTime = t1
 
        try:
 
            with self.stats.sendLevels.time():
 
                if self.currentSong is not None:
0 comments (0 inline, 0 general)