コード例 #1
0
 def process_midi_bytes(self, midi_bytes, midi_processor):
     """
     The switches send sysex which we need to ignore to avoid
     an error being logged from Live
     """
     if is_sysex(midi_bytes):
         return
     return super(Blackstar_Live_Logic, self).process_midi_bytes(midi_bytes, midi_processor)
コード例 #2
0
	def process_midi_bytes(self, midi_bytes, midi_processor):
		u"""
		Finds the right recipient for the MIDI message and translates it into the
		expected format. The result is forwarded to the midi_processor.
		"""
		if midi.is_sysex(midi_bytes):
			result = self.get_registry_entry_for_sysex_midi_message(midi_bytes)
			if result is not None:
				identifier, recipient = result
				midi_processor(recipient, midi_bytes[len(identifier):-1])
			#elif self.received_midi_listener_count() == 0:
			#	logger.warning(u'Got unknown sysex message: ' + midi.pretty_print_bytes(midi_bytes))
		else:
			recipient = self.get_recipient_for_nonsysex_midi_message(midi_bytes)
			if recipient is not None:
				midi_processor(recipient, midi.extract_value(midi_bytes))
コード例 #3
0
	def process_midi_bytes(self, midi_bytes, midi_processor):
		if midi.is_sysex(midi_bytes):
			result = self.get_registry_entry_for_sysex_midi_message(midi_bytes)
			if result is not None:
				identifier, recipient = result
				midi_processor(recipient, midi_bytes[len(identifier):-1])
			else:
				try:
					self.handle_sysex(midi_bytes)
				except:
					pass
		else:
			recipient = self.get_recipient_for_nonsysex_midi_message(midi_bytes)
			if recipient is not None:
				midi_processor(recipient, midi.extract_value(midi_bytes))
			else:
				logger.warning('Got unknown message: ' + midi.pretty_print_bytes(midi_bytes))
コード例 #4
0
 def process_midi_bytes(self, midi_bytes, midi_processor):
     if not midi.is_sysex(midi_bytes):
         recipient = self.get_recipient_for_nonsysex_midi_message(midi_bytes)
         if isinstance(recipient, ButtonElement) and midi.extract_value(midi_bytes) != 0 and self._notification is not None:
             self._notification.hide_notification()
     super(PushBase, self).process_midi_bytes(midi_bytes, midi_processor)
コード例 #5
0
 def _send_midi(self, midi_event_bytes, optimized = True):
     if not self._suppress_sysex or not midi.is_sysex(midi_event_bytes):
         return super(PushBase, self)._send_midi(midi_event_bytes, optimized)
コード例 #6
0
 def process_midi_bytes(self, midi_bytes, midi_processor):
     if is_sysex(midi_bytes):
         return
     return super(Blackstar_Live_Logic, self).process_midi_bytes(midi_bytes, midi_processor)