예제 #1
0
    def run(self):
        detector = BeatDetector(self)
        detector.start()
        while (self.doRun):
            self.event.wait()
            
            channel = random.randint(0, len(self.fixtures) - 1)

            colors = random.randint(1, 7)
            value = {}

            for color in ['red', 'green', 'blue']:
                value[color] = colors & 1
                colors = colors >> 1

            b = Bleep(self.fixtures, channel, value)

            self.event.clear()

            while not self.event.is_set():
                self.event.wait(.01)
                b.spread()
       
            b.dismiss()
        detector.stop()
        self.endEvent.set()
예제 #2
0
파일: PARBlip.py 프로젝트: jketterl/pilight
    def run(self):
        fixtures = self.fixtureList.filter(lambda f: f.hasTag("par"))

        detector = BeatDetector(self)
        detector.start()

        while self.doRun:
            self.event.wait()
            for fixture in fixtures:
                fixture.setChannels(self.generateColor())
            self.event.clear()

        for fixture in fixtures:
            fixture.setChannels({"red": 0, "green": 0, "blue": 0})

        detector.stop()
        self.endEvent.set()
예제 #3
0
파일: BPM.py 프로젝트: jketterl/pilight
 def run(self):
     detector = BeatDetector(self)
     detector.start()
     index = None
     fixtures = self.fixtureList.filter(lambda f : f.hasTag('rgb'))
     while (self.doRun):
         self.event.wait()
         if index is None:
             index = 0
         else:  
             fixtures[index].setChannels({'blue':0})
             index += 1
             if (index >= len(fixtures)): index = 0
         fixtures[index].setChannels({'blue':255})
         self.event.clear()
     fixtures[index].setChannels({'blue':0})
     detector.stop()
     self.endEvent.set()