Пример #1
0
    def __choice(self,v):
        choice = utils.key_to_lists(v)
        if not choice: return
        if not choice[2]: return
        # remove the hardness so that it's not part of the identity of the choice
        del choice[2]

        # if this choice is the same as the previous one
        # stop choose mode and store the new mapping
        if self.__choices and choice==self.__choices[-1]:
            self.__stop_choosing()
            self.__add_choices()
            return

        # if this is a new choice, store it and adapt the status leds
        if not choice in self.__choices:
            self.__choices.append(choice)
            if self.__choosemusical:
                key = choice[1]
            else:
                key = choice[0]
            self.status_buffer.set_status(self.__choosemusical,piw.coordinate(key[0],key[1]),self.__colour_to_int(self.__choosecolour))
            self.status_buffer.send()
Пример #2
0
 def __make_key_coordinate(self):
     return piw.coordinate(self[1].get_value(), self[2].get_value(),
                           self[3].get_value(), self[4].get_value())
Пример #3
0
 def __update_event_key(self):
     if self.control:
         self.control.set_key(
             piw.coordinate(self[1].get_value(), self[2].get_value(),
                            self[3].get_value(), self[5].get_value()))
Пример #4
0
 def __add_lights(self,musical,v):
     mapping = logic.parse_clause(v)
     for m in mapping:
         if 2 == len(m) and 2 == len(m[0]):
             self.status_buffer.set_status(musical,piw.coordinate(int(m[0][0]),int(m[0][1])),self.__colour_to_int(m[1]))
Пример #5
0
 def __make_key_coordinate(self):
     return piw.coordinate(
         self.get_internal(248).get_value(),
         self.get_internal(249).get_value(),
         self.get_internal(245).get_value(),
         self.get_internal(246).get_value())