Changeset - b6ba0e7d126b
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 10 years ago 2015-06-14 20:26:36
drewp@bigasterisk.com
workaround for missing effects in songs
Ignore-this: 8433bee972cfc440067149c45e1ffab6
2 files changed with 13 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/Effects.py
Show inline comments
 
@@ -19,13 +19,13 @@ def register(f):
 
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,:])
 
        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])
light9/effecteval/effectloop.py
Show inline comments
 
@@ -231,12 +231,24 @@ class LedLoop(EffectLoop):
 
        combined = {'L': Z, 'R': Z,
 
                    'blacklight0': 0, 'blacklight1': 0,
 
                    'W': numpy.zeros((1, 3), dtype=numpy.float16)}
 
        
 
        for out in outputs:
 
            log.debug('combine output %r', out)
 

	
 

	
 
            # workaround- somehow these subs that drive fx aren't
 
            # sending their fx, so we react to the sub
 
            if isinstance(out, Submaster.Submaster) and '*' in out.name:
 
                level = float(out.name.split('*')[1])
 
                n = out.name.split('*')[0]
 
                if n == 'widered': out = Effects.Strip.solid('W', (1,0,0)) * level
 
                if n == 'widegreen': out = Effects.Strip.solid('W', (0,1,0)) * level
 
                if n == 'wideblue': out = Effects.Strip.solid('W', (0,0,1)) * level
 
                if n == 'whiteled': out = Effects.Strip.solid('W', (1,.5,.5)) * level
 
 
 
            if isinstance(out, Effects.Blacklight):
 
                # no picking yet
 
                #key = 'blacklight%s' % out.which
 
                for key in ['blacklight0', 'blacklight1']:
 
                    combined[key] = max(combined[key], out)
 
            elif isinstance(out, Effects.Strip):
0 comments (0 inline, 0 general)