当前位置: 首页>>代码示例>>Python>>正文


Python MainSelectorComponent._update_session_tempo_button方法代码示例

本文整理汇总了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
开发者ID:poltow,项目名称:Launchpad95,代码行数:70,代码来源:Launchpad.py


注:本文中的MainSelectorComponent.MainSelectorComponent._update_session_tempo_button方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。