コード例 #1
0
 def handle_sysex(self, midi_bytes):
     result = find_if(lambda (id, _): midi_bytes[:len(id)] == id, self._forwarding_long_identifier_registry.iteritems())
     if result != None:
         id, control = result
         control.receive_value(midi_bytes[len(id):-1])
     else:
         self.log_message('Got unknown sysex message: ', midi_bytes)
コード例 #2
0
ファイル: Signal.py プロジェクト: jda808/mlostekk-live
 def connect(self, slot, in_front = False, sender = None):
     """
     Connects the signal to the slot. Does nothing if the slot is
     already connected. Returns the wrapper object that is used as
     a slot.
     
     If 'in_front' is True, the slot will be put first, meaning it
     will be called before previously registered slots (by default
     it is put last).
     
     If 'sender' is not None, it will be passed as last ordinal
     parameter to the slot when the signal is dispatched.
     """
     if not callable(slot):
         raise AssertionError
         if slot not in self._slots:
             slot = IdentifyingSlot(sender, slot) if sender is not None else Slot(slot)
             in_front and self._slots.insert(0, slot)
         else:
             self._slots.append(slot)
     else:
         slot = find_if(lambda x: x == slot, self._slots)
     return slot
コード例 #3
0
 def connect(self, slot, in_front = False, sender = None):
     """
     Connects the signal to the slot. Does nothing if the slot is
     already connected. Returns the wrapper object that is used as
     a slot.
     
     If 'in_front' is True, the slot will be put first, meaning it
     will be called before previously registered slots (by default
     it is put last).
     
     If 'sender' is not None, it will be passed as last ordinal
     parameter to the slot when the signal is dispatched.
     """
     if not callable(slot):
         raise AssertionError
         if slot not in self._slots:
             slot = IdentifyingSlot(sender, slot) if sender is not None else Slot(slot)
             in_front and self._slots.insert(0, slot)
         else:
             self._slots.append(slot)
     else:
         slot = find_if(lambda x: x == slot, self._slots)
     return slot
コード例 #4
0
 def find_disconnectable(self, predicate):
     return find_if(predicate, self._registered_disconnectables)
コード例 #5
0
def short_circuit_combiner(slot_results):
    return find_if(nop, slot_results)
コード例 #6
0
ファイル: Signal.py プロジェクト: jda808/mlostekk-live
def short_circuit_combiner(slot_results):
    return find_if(nop, slot_results)
コード例 #7
0
 def get_control_by_name(self, control_name):
     return find_if(lambda c: c.name == control_name, self.controls)
コード例 #8
0
 def get_control_by_name(self, control_name):
     return find_if(lambda c: c.name == control_name, self.controls)
コード例 #9
0
 def find(self, task):
     return find_if(lambda t: t._task_equivalent(task), self._tasks)
コード例 #10
0
 def find(self, task):
     return find_if(lambda t: t._task_equivalent(task), self._tasks)
コード例 #11
0
 def find_disconnectable(self, predicate):
     return find_if(predicate, self._registered_disconnectables)