本文整理汇总了Python中ableton.v2.control_surface.mode.ModesComponent.push_mode方法的典型用法代码示例。如果您正苦于以下问题:Python ModesComponent.push_mode方法的具体用法?Python ModesComponent.push_mode怎么用?Python ModesComponent.push_mode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ableton.v2.control_surface.mode.ModesComponent
的用法示例。
在下文中一共展示了ModesComponent.push_mode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AumPush2
# 需要导入模块: from ableton.v2.control_surface.mode import ModesComponent [as 别名]
# 或者: from ableton.v2.control_surface.mode.ModesComponent import push_mode [as 别名]
#.........这里部分代码省略.........
self._device_selector.layer = Layer(priority = 9, matrix = self.elements.matrix.submatrix[:, :4])
self._device_selector.set_enabled(False)
self._send_reset = AumPushResetSendsComponent(self)
self._send_reset.layer = Layer(priority = 9, send_a_button = self._with_select(self.elements.track_state_buttons_raw[4]), send_b_button = self._with_select(self.elements.track_state_buttons_raw[5]), send_c_button = self._with_select(self.elements.track_state_buttons_raw[6]), send_d_button = self._with_select(self.elements.track_state_buttons_raw[7]))
self._send_reset.set_enabled(False)
static_modes = CompoundMode(tuple([self._grab_crossfader, self._release_crossfader]), self._crossfader_strip, self._device_selector, self._send_reset)
self._troll_modes = ModesComponent()
self._troll_modes.add_mode('disabled', [], cycle_mode_button_color = 'DefaultButton.Off')
self._troll_modes.add_mode('enabled', [static_modes, tuple([self._grab_track_mode, self._release_track_mode, ])], cycle_mode_button_color = 'DefaultButton.Alert')
self._troll_modes.layer = Layer(priority = 6, cycle_mode_button = 'master_select_button')
self._troll_modes.selected_mode = 'disabled'
#self.schedule_message(5, self._remove_pedal)
@listens('selected_mode')
def _on_main_mode_changed(self, mode):
debug('main_mode selected mode is now:', mode)
#if self._troll_modes.selected_mode is 'enabled' and not mode is 'device':
# self._troll_modes.selected_mode = 'disabled'
def _init_main_modes(self):
super(AumPush2, self)._init_main_modes()
self._on_main_mode_changed.subject = self._main_modes
def _grab_track_mode(self):
debug('grab device mode')
"""self._main_modes.pop_unselected_modes()
if not self._main_modes.selected_mode is 'device':
self._main_modes.push_mode('device')
self._device_component._update_parameters()"""
self._track_mixer_control._mode_on_troll_entrance = self._mix_modes.selected_mode
self._track_mixer_control._main_offset = self._track_mixer_control.scroll_offset
self._track_mixer_control._scroll_offset = self._track_mixer_control._troll_offset
if self._main_modes.selected_mode is 'mix':
self._check_track_mixer_entry()
def _release_track_mode(self):
debug('release device mode')
"""if self._troll_modes.selected_mode is 'enabled':
self._troll_modes.selected_mode = 'disabled'
if len(self._main_modes.active_modes) > 1:
self._main_modes.pop_mode('device')
self._device_component._update_parameters()"""
self._track_mixer_control._troll_offset = self._track_mixer_control.scroll_offset
self._track_mixer_control._scroll_offset = self._track_mixer_control._main_offset
if self._main_modes.selected_mode is 'mix':
self._mix_modes.selected_mode = self._track_mixer_control._mode_on_troll_entrance
if self._track_mixer_control._mode_on_troll_entrance is 'track':
self._track_mixer_control.notify_scroll_offset()
self._track_mixer_control.update()
def _check_track_mixer_entry(self):
debug('_check_track_mixer_entry')
if self._troll_modes.selected_mode is 'enabled':
if not self._mix_modes.selected_mode is 'track':
self._mix_modes.push_mode('track')
self._track_mixer_control.notify_scroll_offset()