本文整理汇总了Python中ableton.v2.control_surface.mode.ModesComponent类的典型用法代码示例。如果您正苦于以下问题:Python ModesComponent类的具体用法?Python ModesComponent怎么用?Python ModesComponent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ModesComponent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _setup_shift_modes
def _setup_shift_modes(self):
self._main_shift_modes = ModesComponent(name = 'MainShiftModes')
self._main_shift_modes.add_mode('disabled', [self.normal_encoder_sysex], cycle_mode_button_color = 'DefaultButton.Off')
self._main_shift_modes.add_mode('enabled', [self.slow_encoder_sysex], cycle_mode_button_color = 'DefaultButton.On') #, self._value_default
self._main_shift_modes.layer = Layer(priority = 4, cycle_mode_button = self._livid)
self._main_shift_modes.set_enabled(False)
self._main_shift_modes.selected_mode = 'disabled'
self._mod_shift_modes = ModesComponent(name = 'ModShiftModes')
self._mod_shift_modes.layer = Layer(priority = 4, cycle_mode_button = self._livid)
self._mod_shift_modes.set_enabled(False)
示例2: _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)
示例3: _create_main_mixer_modes
def _create_main_mixer_modes(self):
self._mixer_control = MixerControlComponent(name='Global_Mix_Component', view_model=self._model.mixerView, tracks_provider=self._session_ring, is_enabled=False, layer=Layer(controls='fine_grain_param_controls', volume_button='track_state_buttons_raw[0]', panning_button='track_state_buttons_raw[1]', send_slot_one_button='track_state_buttons_raw[2]', send_slot_two_button='track_state_buttons_raw[3]', send_slot_three_button='track_state_buttons_raw[4]', send_slot_four_button='track_state_buttons_raw[5]', send_slot_five_button='track_state_buttons_raw[6]', cycle_sends_button='track_state_buttons_raw[7]'))
self._model.mixerView.realtimeMeterData = self._mixer_control.real_time_meter_handlers
track_mixer_control = TrollMixerControlComponent(script = self, name='Track_Mix_Component', is_enabled=False, tracks_provider=self._session_ring, layer=Layer(controls='fine_grain_param_controls', scroll_left_button='track_state_buttons_raw[6]', scroll_right_button='track_state_buttons_raw[7]'))
self._track_mixer_control = track_mixer_control
#track_mixer_control = TrackMixerControlComponent(name='Track_Mix_Component', is_enabled=False, tracks_provider=self._session_ring, layer=Layer(controls='fine_grain_param_controls', scroll_left_button='track_state_buttons_raw[6]', scroll_right_button='track_state_buttons_raw[7]'))
routing_control = RoutingControlComponent(is_enabled=False, layer=Layer(monitor_state_encoder='parameter_controls_raw[0]'))
track_mix_or_routing_chooser = TrackOrRoutingControlChooserComponent(tracks_provider=self._session_ring, track_mixer_component=track_mixer_control, routing_control_component=routing_control, is_enabled=False, layer=Layer(mix_button='track_state_buttons_raw[0]', routing_button='track_state_buttons_raw[1]'))
self._model.mixerView.trackControlView = track_mix_or_routing_chooser
self._mix_modes = ModesComponent(is_enabled=False)
self._mix_modes.add_mode('global', self._mixer_control)
self._mix_modes.add_mode('track', track_mix_or_routing_chooser)
self._mix_modes.selected_mode = 'global'
self._model.mixerSelectView = self._mixer_control
self._model.trackMixerSelectView = track_mixer_control
class MixModeBehaviour(ReenterBehaviour):
def press_immediate(behaviour_self, component, mode):
if self._is_on_master() and self._mix_modes.selected_mode != 'track':
self._mix_modes.selected_mode = 'track'
super(MixModeBehaviour, behaviour_self).press_immediate(component, mode)
def on_reenter(behaviour_self):
if not self._is_on_master():
self._mix_modes.cycle_mode()
self._main_modes.add_mode('mix', [self._mix_modes, SetAttributeMode(obj=self._note_editor_settings_component, attribute='parameter_provider', value=self._track_parameter_provider)], behaviour=MixModeBehaviour())
示例4: _setup_keygroup
def _setup_keygroup(self):
self._scale_mode = ModesComponent(name = 'ScaleMode')
for scale in SCALES:
debug('making scale mode:', scale, str(scale))
self._scale_mode.add_mode(str(scale), [])
self._scale_mode.layer = Layer(priority = 5,
ionian_button = self._grid[7][0],
dorian_button = self._grid[7][1],
phrygian_button = self._grid[7][2],
lydian_button = self._grid[7][3],
mixolydian_button = self._grid[7][4],
aeolian_button = self._grid[7][5],
locrian_button = self._grid[7][6],
major_button = self._grid[7][7])
self._scale_mode.selected_mode = 'ionian'
self._scale_mode.set_enabled(False)
self._on_scale_change.subject = self._scale_mode
self._octave_offset_component = ScrollingChannelizedSettingsComponent(name = 'NoteOffset', parent_task_group = self._task_group, value_dict = range(104), default_value_index = 36, default_channel = 0, bank_increment = 12, bank_on_color = 'MonoInstrument.OffsetOnValue', bank_off_color = 'MonoInstrument.OffsetOffValue')
self._octave_offset_component.layer = Layer(priority = 5, bank_up_button = self._menu[2], bank_down_button = self._menu[5])
self._on_octave_change.subject = self._octave_offset_component
self._keygroup = OhmKeyGroupComponent()
self._keygroup._on_selected_track_changed.subject = None
self._keygroup.translation_channel = PAGE1_KEYS_CHANNEL
self._keygroup.layer = Layer(priority = 6, matrix = self._matrix.submatrix[:, 4:7])
self._keygroup.set_enabled(False)
示例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: _setup_main_modes
def _setup_main_modes(self):
self._main_modes = ModesComponent(name = 'MainModes')
self._main_modes.add_mode('Main', [self._mixer, self._mixer.main_layer, self._session, self._session_navigation], cycle_mode_button_color = 'ModeButtons.Main')
self._main_modes.add_mode('Select', [self._mixer, self._mixer.select_layer, self._session, self._session_navigation], cycle_mode_button_color = 'ModeButtons.Select')
self._main_modes.add_mode('Clips', [self._mixer, self._session, self._session.clips_layer, self._session_navigation], cycle_mode_button_color = 'ModeButtons.Clips')
self._main_modes.layer = Layer(priority = 4, cycle_mode_button = self._grid[2][2])
self._main_modes.selected_mode = 'Main'
self._main_modes.set_enabled(False)
示例7: _init_track_modes
def _init_track_modes(self):
self._track_modes = ModesComponent(name='Track_Modes')
self._track_modes.set_enabled(False)
self._track_modes.add_mode('stop', AddLayerMode(self._stop_clips, self._stop_track_clips_layer))
self._track_modes.add_mode('solo', AddLayerMode(self._mixer, self._mixer_solo_layer))
self._track_modes.add_mode('mute', AddLayerMode(self._mixer, self._mixer_mute_layer))
self._track_modes.layer = self._create_track_modes_layer()
self._track_modes.selected_mode = 'mute'
示例8: _create_session_mode
def _create_session_mode(self):
session_modes = ModesComponent(is_enabled=False)
session_modes.add_mode('session', self._session_mode)
session_modes.add_mode('overview', self._session_overview_mode)
session_modes.layer = Layer(cycle_mode_button='layout_button')
session_modes.selected_mode = 'session'
return [session_modes, self._session_navigation]
示例9: _setup_modswitcher
def _setup_modswitcher(self):
self._modswitcher = ModesComponent(name = 'ModSwitcher')
self._modswitcher.add_mode('mod', [self.modhandler, self._mod_shift_modes])
self._modswitcher.add_mode('special_device', [self._special_device, self._mixer, self._mixer._select_layer, self._main_shift_modes])
self._modswitcher.selected_mode = 'special_device'
self._modswitcher.set_enabled(False)
self._mod_shift_modes.add_mode('disabled', [self.modhandler.keys_layer], cycle_mode_button_color = 'Mod.ShiftOff')
self._mod_shift_modes.add_mode('enabled', [self.modhandler.code_keys_layer, self.modhandler.code_buttons_layer, tuple([self._send_mod_shift, self._release_mod_shift])], cycle_mode_button_color = 'Mod.ShiftOn')
self._mod_shift_modes.selected_mode = 'disabled'
示例10: _create_device_mode
def _create_device_mode(self):
self._drum_pad_parameter_component = DrumPadParameterComponent(view_model=self._model, is_enabled=False, layer=Layer(choke_encoder='parameter_controls_raw[0]'))
self._device_or_pad_parameter_chooser = ModesComponent()
self._device_or_pad_parameter_chooser.add_mode('device', [make_freeze_aware(self._device_parameter_component, self._device_parameter_component.layer), self._device_view])
self._device_or_pad_parameter_chooser.add_mode('drum_pad', [make_freeze_aware(self._drum_pad_parameter_component, self._drum_pad_parameter_component.layer)])
self._device_or_pad_parameter_chooser.selected_mode = 'device'
return [partial(self._view_control.show_view, 'Detail/DeviceChain'),
self._device_or_pad_parameter_chooser,
self._setup_freeze_aware_device_navigation(),
self._device_note_editor_mode,
SetAttributeMode(obj=self._note_editor_settings_component, attribute='parameter_provider', value=self._device_component)]
示例11: _setup_modes
def _setup_modes(self):
self._main_modes = ModesComponent(name = 'MainModes')
self._main_modes.add_mode('disabled', [])
self._main_modes.add_mode('session_shifted', [self._recorder, self._mixer, self._mixer.solo_mute_record_stop_layer, self._session, self._session.stop_layer, self._session_navigation, self._session_navigation._vertical_layer, self._transport], groups = ['shifted'], behaviour = self._shift_latching(color = 'Mode.Session'))
self._main_modes.add_mode('session', [self._recorder, self._mixer, self._session, self._session.cliplaunch_layer, self._session_navigation, self._session_navigation._horizontal_layer, self._transport], behaviour = self._shift_latching(color = 'Mode.Session'))
self._main_modes.add_mode('instrument_shifted', [self._recorder, self._mixer, self._mixer.mute_layer, self._viewcontrol, self._instrument, self._transport], groups = ['shifted'], behaviour = self._shift_latching(color = 'Mode.Instrument'))
self._main_modes.add_mode('instrument', [self._recorder, self._mixer, self._mixer.select_layer, self._viewcontrol, self._instrument, self._transport], behaviour = self._shift_latching(color = 'Mode.Instrument'))
self._main_modes.layer = Layer(priority = 6, session_button = self._side_button[4], instrument_button = self._side_button[3])
self._main_modes.set_enabled(False)
self._main_modes.selected_mode = 'disabled'
示例12: _create_clip_mode
def _create_clip_mode(self):
base_loop_layer = Layer(shift_button='shift_button', loop_button='track_state_buttons_raw[1]')
self._loop_controller = LoopSettingsControllerComponent(is_enabled=False)
self._model.loopSettingsView = self._loop_controller
audio_clip_layer = Layer(warp_mode_encoder='parameter_controls_raw[5]', transpose_encoder='parameter_controls_raw[6]', detune_encoder=self._with_shift('parameter_controls_raw[6]'), gain_encoder='parameter_controls_raw[7]', shift_button='shift_button')
audio_clip_controller = AudioClipSettingsControllerComponent(is_enabled=False)
self._model.audioClipSettingsView = audio_clip_controller
clip_control_mode_selector = ModesComponent(is_enabled=False)
clip_control_mode_selector.add_mode('midi', [make_freeze_aware(self._loop_controller, base_loop_layer + Layer(encoders=self.elements.global_param_controls.submatrix[:3, :]))])
clip_control_mode_selector.add_mode('audio', [make_freeze_aware(self._loop_controller, base_loop_layer + Layer(encoders=self.elements.global_param_controls.submatrix[1:4, :], zoom_encoder='fine_grain_param_controls_raw[0]')), make_freeze_aware(audio_clip_controller, audio_clip_layer)])
clip_control_mode_selector.add_mode('no_clip', [])
clip_control_mode_selector.selected_mode = 'no_clip'
clip_control = ClipControlComponent(loop_controller=self._loop_controller, audio_clip_controller=audio_clip_controller, mode_selector=clip_control_mode_selector, decorator_factory=self._clip_decorator_factory, is_enabled=False)
self._model.clipView = clip_control
return [partial(self._view_control.show_view, 'Detail/Clip'), clip_control_mode_selector, clip_control]
示例13: _setup_device_chooser
def _setup_device_chooser(self):
self._selected_device = self._device[0]
self._last_selected_device = self._device[0]
self._selected_device_modes = ModesComponent()
self._selected_device_modes.add_mode('disabled', [None])
self._selected_device_modes.add_mode('device_0', [self._device_navigator._dev1_layer], behaviour = DefaultedBehaviour())
self._selected_device_modes.add_mode('device_1', [self._device_navigator._dev2_layer], behaviour = DefaultedBehaviour())
self._selected_device_modes.add_mode('device_2', [self._device_navigator._dev3_layer], behaviour = DefaultedBehaviour())
self._selected_device_modes.add_mode('device_3', [self._device_navigator._dev4_layer], behaviour = DefaultedBehaviour())
self._selected_device_modes.layer = Layer(priority = 4, device_0_button = self._button[0][0], device_1_button = self._button[0][1], device_2_button = self._button[0][2], device_3_button = self._button[0][3])
self._selected_device_modes.selected_mode = 'device_0'
self._selected_device_modes.set_enabled(False)
self._on_device_selector_mode_changed.subject = self._selected_device_modes
示例14: _init_matrix_modes
def _init_matrix_modes(self):
self._auto_arm = AutoArmComponent(name='Auto_Arm')
self._auto_arm.can_auto_arm_track = self._can_auto_arm_track
self._auto_arm.layer = Layer(_notification=self._notification.use_single_line(2))
self._select_playing_clip = SelectPlayingClipComponent(name='Select_Playing_Clip', playing_clip_above_layer=Layer(action_button='nav_up_button'), playing_clip_below_layer=Layer(action_button='nav_down_button'))
self._select_playing_clip.layer = Layer(_notification=self._notification.use_single_line(2))
self._percussion_instrument_finder = PercussionInstrumentFinderComponent(device_parent=self.song.view.selected_track)
self.__on_percussion_instrument_changed.subject = self._percussion_instrument_finder
self._drum_modes = ModesComponent(name='Drum_Modes', is_enabled=False)
self._drum_modes.add_mode('sequencer', [self._drum_step_sequencer, self._note_editor_settings_component, AddLayerMode(self._drum_component, Layer(matrix=self.elements.matrix.submatrix[:4, 4:8]))])
self._drum_modes.add_mode('64pads', [AddLayerMode(self._drum_component, Layer(matrix='matrix'))])
self._drum_modes.selected_mode = 'sequencer'
self._slicing_modes = self._create_slicing_modes()
self._note_modes = ModesComponent(name='Note_Modes')
self._note_modes.add_mode('drums', [self._drum_component,
self._note_repeat_enabler,
self._accent_component,
self._drum_modes])
self._note_modes.add_mode('slicing', [self._slicing_component,
self._note_repeat_enabler,
self._accent_component,
self._slicing_modes])
self._note_modes.add_mode('looper', self._audio_loop if consts.PROTO_AUDIO_NOTE_MODE else self._matrix_background)
self._note_modes.add_mode('instrument', [self._note_repeat_enabler,
self._accent_component,
self._instrument,
self._scales_enabler])
self._note_modes.add_mode('disabled', self._matrix_background)
self._note_modes.selected_mode = 'disabled'
self._note_modes.set_enabled(False)
self._matrix_modes = ModesComponent(name='Matrix_Modes', is_root=True)
self._matrix_modes.add_mode('session', self._create_session_mode())
self._matrix_modes.add_mode('note', self._create_note_mode(), behaviour=self._create_note_mode_behaviour())
self._matrix_modes.selected_mode = 'note'
self._matrix_modes.layer = Layer(session_button='session_mode_button', note_button='note_mode_button')
self.__on_matrix_mode_changed.subject = self._matrix_modes
self._matrix_modes.selected_mode = 'note'
示例15: _init_main_modes
def _init_main_modes(self):
def configure_note_editor_settings(parameter_provider, mode):
for note_editor_setting in self._note_editor_settings:
note_editor_setting.component.parameter_provider = parameter_provider
note_editor_setting.component.automation_layer = getattr(note_editor_setting, mode + '_automation_layer')
self._track_note_editor_mode = partial(configure_note_editor_settings, self._track_parameter_provider, 'track')
self._device_note_editor_mode = partial(configure_note_editor_settings, self._device_component, 'device')
self._enable_stop_mute_solo_as_modifiers = AddLayerMode(self._mod_background, Layer(stop='global_track_stop_button', mute='global_mute_button', solo='global_solo_button'))
self._main_modes = ModesComponent(is_root=True)
self._create_main_mixer_modes()
self._main_modes.add_mode('clip', self._create_clip_mode())
self._main_modes.add_mode('device', self._create_device_mode(), behaviour=ReenterBehaviour(self._device_navigation.back_to_top))
self._init_browse_mode()
self._main_modes.selected_mode = 'device'
self._main_modes.layer = self._create_main_modes_layer()