本文整理匯總了Python中MainSelectorComponent.MainSelectorComponent._update_session_tempo_button方法的典型用法代碼示例。如果您正苦於以下問題:Python MainSelectorComponent._update_session_tempo_button方法的具體用法?Python MainSelectorComponent._update_session_tempo_button怎麽用?Python MainSelectorComponent._update_session_tempo_button使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MainSelectorComponent.MainSelectorComponent
的用法示例。
在下文中一共展示了MainSelectorComponent._update_session_tempo_button方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Launchpad
# 需要導入模塊: from MainSelectorComponent import MainSelectorComponent [as 別名]
# 或者: from MainSelectorComponent.MainSelectorComponent import _update_session_tempo_button [as 別名]
#.........這裏部分代碼省略.........
for instance in Launchpad._active_instances:
support_devices |= (instance._device_component != None)
offset = 0
for instance in Launchpad._active_instances:
instance._activate_combination_mode(offset, support_devices)
offset += instance._selector._session.width()
_combine_active_instances = staticmethod(_combine_active_instances)
def _activate_combination_mode(self, track_offset, support_devices):
if(Settings.STEPSEQ__LINK_WITH_SESSION):
self._selector._stepseq.link_with_step_offset(track_offset)
if(Settings.SESSION__LINK):
self._selector._session.link_with_track_offset(track_offset)
def _do_combine(self):
if (DO_COMBINE and (self not in Launchpad._active_instances)):
Launchpad._active_instances.append(self)
Launchpad._combine_active_instances()
def _do_uncombine(self):
if self in Launchpad._active_instances:
Launchpad._active_instances.remove(self)
if(Settings.SESSION__LINK):
self._selector._session.unlink()
if(Settings.STEPSEQ__LINK_WITH_SESSION):
self._selector._stepseq.unlink()
Launchpad._combine_active_instances()
@profile
def update_display(self):
super(Launchpad, self).update_display()
if self._selector != None:
self._selector._update_session_tempo_button()
def refresh_state(self):
ControlSurface.refresh_state(self)
self.schedule_message(5, self._update_hardware)
def handle_sysex(self, midi_bytes):
self._suppress_send_midi = False
self.set_enabled(True)
def build_midi_map(self, midi_map_handle):
ControlSurface.build_midi_map(self, midi_map_handle)
if self._selector!=None:
if self._selector._main_mode_index==2 or self._selector._main_mode_index==1:
mode = Settings.USER_MODES[(self._selector._main_mode_index-1) * 3 + self._selector._sub_mode_list[self._selector._main_mode_index] ]
#self._selector.mode_index == 1:
#if self._selector._sub_mode_list[self._selector._mode_index] > 0: # disable midi map rebuild for instrument mode to prevent light feedback errors
if mode != "instrument":
new_channel = self._selector.channel_for_current_mode()
for note in self._drum_notes:
self._translate_message(MIDI_NOTE_TYPE, note, 0, note, new_channel)
def _send_midi(self, midi_bytes, optimized=None):
sent_successfully = False
if not self._suppress_send_midi:
sent_successfully = ControlSurface._send_midi(self, midi_bytes, optimized=optimized)
return sent_successfully
def _update_hardware(self):
self._suppress_send_midi = False
if self._user_byte_write_button != None:
self._user_byte_write_button.send_value(1)
self._wrote_user_byte = True