本文整理汇总了Python中_Framework.ModesComponent.ModesComponent.cycle_mode方法的典型用法代码示例。如果您正苦于以下问题:Python ModesComponent.cycle_mode方法的具体用法?Python ModesComponent.cycle_mode怎么用?Python ModesComponent.cycle_mode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_Framework.ModesComponent.ModesComponent
的用法示例。
在下文中一共展示了ModesComponent.cycle_mode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Launchpad_Pro95
# 需要导入模块: from _Framework.ModesComponent import ModesComponent [as 别名]
# 或者: from _Framework.ModesComponent.ModesComponent import cycle_mode [as 别名]
#.........这里部分代码省略.........
next_scene_button = self._midimap['Arrow_Down_Button'],
scale_button = self._midimap['Scene_Launch_Button_Matrix_Raw'][0][0],
octave_button = self._midimap['Scene_Launch_Button_Matrix_Raw'][0][1],
pitch_button = self._midimap['Scene_Launch_Button_Matrix_Raw'][0][2],
quantization_button = self._midimap['Scene_Launch_Button_Matrix_Raw'][0][3],
velocity_button = self._midimap['Scene_Launch_Button_Matrix_Raw'][0][4],
length_button = self._midimap['Scene_Launch_Button_Matrix_Raw'][0][5],
random_button = self._midimap['Scene_Launch_Button_Matrix_Raw'][0][6],
lock_button = self._midimap['Scene_Launch_Button_Matrix_Raw'][0][7]
)
)
#,self._step_sequencer2.update()
]
)
self._user_button_modes.add_mode('user_mode', [
partial(self._layout_switch, consts.SESSION_LAYOUT_SYSEX_BYTE),
partial(self._layout_setup, consts.USER_LAYOUT_SYSEX_BYTE)
])
self._user_button_modes.selected_mode = "stepsequencer_mode"
self._modes.add_mode(
'user_mode',
[
partial(self._layout_switch, consts.SESSION_LAYOUT_SYSEX_BYTE),
partial(self._layout_setup, consts.DRUM_LAYOUT_SYSEX_BYTE, consts.SYSEX_PARAM_BYTE_STANDALONE_LAYOUT),
self._enable_user_button_modes,
self._user_button_modes
],
behaviour=ReenterBehaviour(self._toggle_user_button_modes)
)
def _toggle_user_button_modes(self):
self._user_button_modes.cycle_mode()
button = self._midimap['User_Mode_Button']
if self._user_button_modes.selected_mode == "stepsequencer_mode":
button.default_states = {True: 'Mode.StepSequencer.On', False: 'Mode.StepSequencer.Off'}
self.show_message("drum step sequencer")
elif self._user_button_modes.selected_mode == "stepsequencer2_mode":
button.default_states = {True: 'Mode.StepSequencer2.On', False: 'Mode.StepSequencer2.Off'}
self.show_message("melodic step sequencer")
elif self._user_button_modes.selected_mode == "user_mode":
button.default_states = {True: 'Mode.User.On', False: 'Mode.User.Off'}
self.show_message("user mode")
button.reset_state()
button.turn_on()
self._enable_user_button_modes()
self._step_sequencer.update()
self._step_sequencer2.update()
def _enable_user_button_modes(self):
self._step_sequencer.set_enabled(self._user_button_modes.selected_mode == "stepsequencer_mode")
self._step_sequencer2.set_enabled(self._user_button_modes.selected_mode == "stepsequencer2_mode")
#self._step_sequencer.update()
#self._step_sequencer2.update()
def _create_record_arm_mode(self):
arm_layer_mode = LayerMode(
self._mixer,
layer=Layer(arm_buttons=self._midimap['Mixer_Button_Matrix'])
)
self._modes.add_mode('record_arm_mode',
[
partial(self._layout_setup, consts.SESSION_LAYOUT_SYSEX_BYTE),
self._session_layer_mode,
arm_layer_mode,