本文整理汇总了Python中_Framework.ModesComponent.ModesComponent类的典型用法代码示例。如果您正苦于以下问题:Python ModesComponent类的具体用法?Python ModesComponent怎么用?Python ModesComponent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ModesComponent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_enabled
def set_enabled(self, enabled):
if not enabled:
self._do_implicit_arm(enabled)
ControlSurfaceComponent.set_enabled(self, enabled)
ModesComponent.set_enabled(self._modes, enabled)
if enabled:
self._do_implicit_arm(enabled)
示例2: CntrlrMonoInstrumentComponent
class CntrlrMonoInstrumentComponent(MonoInstrumentComponent):
def _setup_shift_mode(self):
self._shifted = False
self._shift_mode = ModesComponent()
self._shift_mode.add_mode('shift', tuple([self._enable_shift, self._disable_shift]), behaviour = ColoredCancellableBehaviourWithRelease(color = 'MonoInstrument.ShiftOn', off_color = 'MonoInstrument.ShiftOff'))
示例3: _create_global_control
def _create_global_control(self):
def set_pan_controls():
for index, control in enumerate(self._global_param_controls):
self._mixer.channel_strip(index).set_pan_control(control)
self._mixer.channel_strip(index).set_send_controls((None, None, None))
control.set_channel(0)
return None
def set_send_controls(send_index):
for index, control in enumerate(self._global_param_controls):
self._mixer.channel_strip(index).set_pan_control(None)
send_controls = [None] * 3
send_controls[send_index] = control
self._mixer.channel_strip(index).set_send_controls(send_controls)
control.set_channel(send_index + 1)
return
encoder_modes = ModesComponent(name='Track_Control_Modes', is_enabled=False)
encoder_modes.add_mode('pan', [set_pan_controls])
encoder_modes.add_mode('send_a', [partial(set_send_controls, 0)])
encoder_modes.add_mode('send_b', [partial(set_send_controls, 1)])
encoder_modes.add_mode('send_c', [partial(set_send_controls, 2)])
encoder_modes.selected_mode = 'pan'
encoder_modes.layer = Layer(pan_button=self._global_bank_buttons[0], send_a_button=self._global_bank_buttons[1], send_b_button=self._global_bank_buttons[2], send_c_button=self._global_bank_buttons[3])
self._translation_selector = ChannelTranslationSelector(name='Global_Translations')
示例4: _setup_modes
def _setup_modes(self):
self._button_modes = ModesComponent(name='Button_Modes')
self._button_modes.add_mode('launcher', self._launcher)
self._button_modes.add_mode('looper', self._looper)
self._button_modes.add_mode('device', self._device_control)
self._button_modes.selected_mode = 'looper'
self._button_modes.set_enabled(True)
示例5: __init__
def __init__(self, *a, **k):
super(OhmModHandler, self).__init__(*a, **k)
self._shift_mode = ModesComponent()
self._color_type = 'RGB'
self._shift_mode.add_mode('shift', tuple([self._enable_shift, self._disable_shift]), behaviour = CancellableBehaviourWithRelease())
self.nav_box = self.register_component(NavigationBox(self, 16, 16, 8, 8, self.set_offset))
self._mod_button = None
示例6: __init__
def __init__(self, control_surface, drum_component=None, *a, **k):
self._control_surface = control_surface
self._drum_component = drum_component
self._implicit_arm = True
self._modes = ModesComponent(name="Instrument_Modes", is_enabled=False)
self._modes.set_enabled = self.set_enabled
self._feedback_channels = [
consts.DR_MAP_CHANNEL,
consts.DR_MAP_CHANNEL + 1,
consts.DR_MAP_CHANNEL + 2,
consts.DR_MAP_CHANNEL + 3,
consts.DR_MAP_CHANNEL + 4,
]
self._non_feedback_channel = consts.DR_MAP_CHANNEL + 5
self._common_component = CommonModeComponent(instrument_component=self, control_surface=self._control_surface)
self._scale_component = ScaleComponent(control_surface=self._control_surface, enabled=True)
self._note_component = NoteComponent(
control_surface=self._control_surface,
feedback_channels=self._feedback_channels,
non_feedback_channel=self._non_feedback_channel,
get_pattern=self._scale_component.get_pattern,
)
super(InstrumentComponent, self).__init__(*a, **k)
示例7: _setup_modes
def _setup_modes(self):
self._button_modes = ModesComponent(name='Button_Modes')
self._button_modes.add_mode('launcher', self._launcher)
self._button_modes.add_mode('looper', self._looper)
self._button_modes.add_mode('device', self._device_control)
self._button_modes.selected_mode = 'looper'
self._button_modes.layer = Layer(looper_button = self._side_buttons[0], launcher_button = self._side_buttons[1], device_button = self._side_buttons[2])
self._button_modes.set_enabled(True)
示例8: _create_mode_selector
def _create_mode_selector(self):
self._mode_selector = ModesComponent()
mode_selection = LayerMode(self._encoder_modes, Layer(device_mode_button=self._device_mode_button, pan_mode_button=self._pan_mode_button, **self._send_mode_buttons))
device_navigation = AddLayerMode(self._device, Layer(device_nav_left_button=self._track_left_button, device_nav_right_button=self._track_right_button))
self._mode_selector.add_mode('mode_selection', [partial(self._toggle_in_control, True), mode_selection, device_navigation], behaviour=MomentaryBehaviour())
session_control = AddLayerMode(self._session, Layer(clip_launch_buttons=self._top_pad_row))
self._mode_selector.add_mode('session_mode', [partial(self._toggle_in_control, False), session_control])
self._mode_selector.layer = Layer(mode_selection_button=self._encoder_incontrol_button2)
示例9: _create_modes
def _create_modes(self):
self._modes = ModesComponent(name='Launchpad_Modes', is_enabled=False)
self._session_layer_mode = AddLayerMode(
self._session,
Layer(
scene_launch_buttons=self._midimap['Scene_Launch_Button_Matrix'],
clip_launch_buttons=self._midimap['Main_Button_Matrix'],
delete_button=self._midimap['Delete_Button'],
duplicate_button=self._midimap['Duplicate_Button'],
double_button=self._midimap['Double_Loop_Button'],
quantize_button=self._midimap['Quantize_Button']
)
)
action_button_background = BackgroundComponent(name='No_Op_Buttons')
self._action_button_background_layer_mode = LayerMode(
action_button_background,
Layer(
delete_button=self._midimap['Delete_Button'],
quantize_button=self._midimap['Quantize_Button'],
duplicate_button=self._midimap['Duplicate_Button'],
double_button=self._midimap['Double_Loop_Button']
)
)
self._clip_delete_layer_mode = AddLayerMode(
self._clip_actions_component,
layer=Layer(
delete_button=self._midimap['Delete_Button']
)
)
self._create_session_zooming_modes()
self._create_session_mode()
self._create_note_modes()
self._create_device_mode()
self._create_user_mode()
self._create_record_arm_mode()
self._create_track_select_mode()
self._create_mute_mode()
self._create_solo_mode()
self._create_volume_mode()
self._create_pan_mode()
self._create_sends_mode()
self._create_stop_clips_mode()
self._modes.layer = Layer(
session_mode_button=self._midimap['Session_Mode_Button'],
note_mode_button=self._midimap['Note_Mode_Button'],
device_mode_button=self._midimap['Device_Mode_Button'],
user_mode_button=self._midimap['User_Mode_Button'],
record_arm_mode_button=self._midimap['Record_Arm_Mode_Button'],
track_select_mode_button=self._midimap['Track_Select_Mode_Button'],
mute_mode_button=self._midimap['Mute_Mode_Button'],
solo_mode_button=self._midimap['Solo_Mode_Button'],
volume_mode_button=self._midimap['Volume_Mode_Button'],
pan_mode_button=self._midimap['Pan_Mode_Button'],
sends_mode_button=self._midimap['Sends_Mode_Button'],
stop_clip_mode_button=self._midimap['Stop_Clip_Mode_Button']
)
self._modes.selected_mode = 'session_mode'
self._on_layout_changed.subject = self._modes
示例10: _init_track_modes
def _init_track_modes(self):
self._track_modes = ModesComponent(name='Track_Modes', is_enabled=False)
self._track_modes.default_behaviour = ImmediateBehaviour()
self._track_modes.add_mode('pan', [AddLayerMode(self._mixer, Layer(pan_controls=self._mixer_encoders))])
self._track_modes.add_mode('send_a', [AddLayerMode(self._mixer, Layer(send_controls=self._mixer_encoders)), partial(self._mixer.set_send_button_index, 0)])
self._track_modes.add_mode('send_b', [AddLayerMode(self._mixer, Layer(send_controls=self._mixer_encoders)), partial(self._mixer.set_send_button_index, 1)])
self._track_modes.add_mode('send_c', [AddLayerMode(self._mixer, Layer(send_controls=self._mixer_encoders)), partial(self._mixer.set_send_button_index, 2)])
self._track_modes.layer = Layer(pan_button=self._pan_button, send_a_button=self._send_a_button, send_b_button=self._send_b_button, send_c_button=self._send_c_button)
self._track_modes.selected_mode = 'pan'
示例11: set_modes
def set_modes(self, sends_layer, fx1_layer, fx2_layer, fx3_layer):
if hasattr(self, '_modes'):
self._modes.disconnect()
self._modes = ModesComponent()
self._modes.add_mode('sends', [LayerMode(self, sends_layer)])
self._modes.add_mode('fx1', [LayerMode(self, fx1_layer)])
self._modes.add_mode('fx2', [LayerMode(self, fx2_layer)])
self._modes.add_mode('fx3', [LayerMode(self, fx3_layer)])
self._modes._set_selected_mode('sends')
示例12: _setup_modes
def _setup_modes(self):
super(AumTroll, self)._setup_modes()
self._alt_shift_mode = ModesComponent()
self._alt_shift_mode.add_mode(
"alt_shift",
tuple([self._enable_alt_shift, self._disable_alt_shift]),
behaviour=CancellableBehaviourWithRelease(),
)
self._alt_shift_mode.set_mode_button("alt_shift", self._grid[15])
示例13: _create_mixer
def _create_mixer(self):
self._mixer = MixerComponent(NUM_TRACKS, auto_name=True, is_enabled=False, invert_mute_feedback=True, layer=Layer(volume_controls=self._volume_controls, arm_buttons=self._arm_buttons, solo_buttons=self._solo_buttons, mute_buttons=self._mute_buttons, shift_button=self._shift_button, track_select_buttons=self._select_buttons, prehear_volume_control=self._prehear_control, crossfader_control=self._crossfader_control, crossfade_buttons=self._crossfade_buttons))
self._mixer.master_strip().layer = Layer(volume_control=self._master_volume_control, select_button=self._master_select_button)
self._encoder_mode = ModesComponent(name='Encoder_Mode', is_enabled=False)
self._encoder_mode.default_behaviour = ImmediateBehaviour()
self._encoder_mode.add_mode('pan', [AddLayerMode(self._mixer, Layer(pan_controls=self._mixer_encoders))])
self._encoder_mode.add_mode('sends', [AddLayerMode(self._mixer, Layer(send_controls=self._mixer_encoders)), DelayMode(AddLayerMode(self._mixer, Layer(send_select_buttons=self._send_select_buttons)))])
self._encoder_mode.add_mode('user', [AddLayerMode(self._mixer, Layer(user_controls=self._mixer_encoders))])
self._encoder_mode.layer = Layer(pan_button=self._pan_button, sends_button=self._sends_button, user_button=self._user_button)
self._encoder_mode.selected_mode = 'pan'
示例14: _create_step_button_modes
def _create_step_button_modes(self):
matrix_modes = ModesComponent(name='Step_Button_Modes')
clip_mode = AddLayerMode(self._session, Layer(clip_launch_buttons=self._step_buttons, stop_track_clip_buttons=self._modified_step_buttons))
scene_mode = AddLayerMode(self._session, Layer(scene_launch_buttons=self._step_buttons))
matrix_modes.add_mode('clip', clip_mode)
matrix_modes.add_mode('scene', scene_mode)
matrix_modes.layer = Layer(clip_button=self._recall_button, scene_button=self._store_button)
matrix_modes.selected_mode = 'clip'
return matrix_modes
示例15: _setup_modes
def _setup_modes(self):
next_buttons = CompoundMode(self._next_a_button, self._next_a_button)
self._main_modes = ModesComponent(name = 'MainModes')
self._main_modes.add_mode('disabled', None)
self._main_modes.add_mode('left_session', [self._left_session, next_buttons])
self._main_modes.add_mode('right_session', [self._right_session, next_buttons])
self._main_modes.add_mode('set_session', [self._left_set_session, self._right_set_session, next_buttons])
self._main_modes.layer = Layer(priority = 6, left_session_button = self._crate_button[0], right_session_button = self._crate_button[1], set_session_button = self._crate_button[2])
self._main_modes.selected_mode = 'set_session'
self._main_modes.set_enabled(True)