Exemplo n.º 1
0
 def __init__(self, real_time_mapper = None, register_real_time_data = None, *a, **k):
     super(RoutingControlComponent, self).__init__(*a, **k)
     self.__on_current_monitoring_state_changed.subject = self.song.view
     self._real_time_channel_assigner = RoutingMeterRealTimeChannelAssigner(real_time_mapper=real_time_mapper, register_real_time_data=register_real_time_data, is_enabled=False)
     self._update_monitoring_state_task = self._tasks.add(task.run(self._update_monitoring_state))
     input_type_router = self.register_disconnectable(InputTypeRouter(song=self.song))
     output_type_router = self.register_disconnectable(OutputTypeRouter(song=self.song))
     input_channel_router = self.register_disconnectable(InputChannelRouter(song=self.song))
     output_channel_router = self.register_disconnectable(OutputChannelRouter(song=self.song))
     input_channel_and_position_router = self.register_disconnectable(InputChannelAndPositionRouter(input_channel_router, input_type_router))
     self._active_type_router = input_type_router
     self._active_channel_router = input_channel_and_position_router
     self._can_route = can_set_input_routing
     self._update_can_route()
     self._routing_type_list, self._routing_channel_list = self.register_disconnectables([RoutingTypeList(parent_task_group=self._tasks, router=self._active_type_router), RoutingChannelList(parent_task_group=self._tasks, rt_channel_assigner=self._real_time_channel_assigner, router=self._active_channel_router)])
     self.__on_input_channel_position_index_changed.subject = input_channel_and_position_router
     self._routing_channel_position_list = None
     self._update_routing_channel_position_list()
     self.add_mode(u'input', [SetAttributeMode(self, u'_can_route', can_set_input_routing), partial(self._set_active_routers, input_type_router, input_channel_and_position_router), self._real_time_channel_assigner])
     self.add_mode(u'output', [SetAttributeMode(self, u'_can_route', lambda *a: True), partial(self._set_active_routers, output_type_router, output_channel_router), self._real_time_channel_assigner])
     self.selected_mode = u'input'
     self.__on_selected_track_changed.subject = self.song.view
     self.__on_selected_track_changed()
     self._connect_monitoring_state_encoder()
     self.input_output_choice_encoder.connect_static_list(self, u'selected_mode', list_values=[u'input', u'output'])
     self.__on_selected_mode_changed.subject = self
     self.__on_tracks_changed.subject = self.song
     self.__on_return_tracks_changed.subject = self.song
     self._update_track_listeners()
Exemplo n.º 2
0
 def __init__(self, selection = None, browser_mode = None, browser_component = None, browser_hotswap_mode = None, *a, **k):
     super(CreateInstrumentTrackComponent, self).__init__(*a, **k)
     self._selection = selection
     self._with_browser_modes = self.register_component(ModesComponent())
     self._with_browser_modes.add_mode('create', [self._prepare_browser,
      SetAttributeMode(self.application.browser, 'filter_type', Live.Browser.FilterType.instrument_hotswap),
      SetAttributeMode(browser_component, 'do_load_item', self._do_browser_load_item),
      browser_mode,
      browser_component.reset_load_memory])
     self._with_browser_modes.add_mode('hotswap', [browser_hotswap_mode, browser_mode])
     self._go_to_hotswap_task = self._tasks.add(task.sequence(task.delay(1), task.run(self._go_to_hotswap)))
     self._go_to_hotswap_task.kill()
Exemplo n.º 3
0
 def __init__(self,
              selection=None,
              browser_component=None,
              browser_mode=None,
              browser_hotswap_mode=None,
              insert_left=False,
              *a,
              **k):
     super(CreateDeviceComponent, self).__init__(*a, **k)
     self._selection = selection
     self._add_effect_mode = BrowserAddEffectMode(
         selection=selection,
         browser=self.application.browser,
         application_view=self.application.view,
         insert_left=insert_left)
     self._create_device_modes = ModesComponent(parent=self)
     self._create_device_modes.add_mode(u'create', [
         SetAttributeMode(browser_component, u'do_load_item',
                          self._do_browser_load_item),
         self._add_effect_mode, browser_mode,
         browser_component.reset_load_memory
     ])
     self._create_device_modes.add_mode(
         u'hotswap', [browser_hotswap_mode, browser_mode])
     self._go_to_hotswap_task = self._tasks.add(
         task.sequence(task.delay(1), task.run(self._go_to_hotswap)))
     self._go_to_hotswap_task.kill()
Exemplo n.º 4
0
	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, troll_submodes = self._troll_submodes, 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())
Exemplo n.º 5
0
 def _create_modes(self):
     self._encoder_modes = DisplayingSkinableModesComponent(name=u'Encoder_Modes')
     self._encoder_modes.add_mode(u'devices', [partial(self._switch_display_layout, sysex.BOX_SCREEN_LAYOUT_BYTE),
      AddLayerMode(self._encoder_modes, Layer(mode_display=self._elements.text_display_line_5, mode_color_fields=self._elements.color_field_line_2, mode_selection_fields=self._elements.selection_field_line_2)),
      LayerMode(self._device_navigation, Layer(select_buttons=u'pads_flattened', device_color_fields=u'color_field_lines_0_1_flattened', device_name_display_1=u'text_display_line_0', device_name_display_2=u'text_display_line_2', device_bank_name_display_1=u'text_display_line_1', device_bank_name_display_2=u'text_display_line_3', device_selection_fields=u'selection_field_lines_0_1_flattened', selected_device_name_display=u'center_display_1')),
      SetAttributeMode(self._device_navigation, u'scroll_left_layer', Layer(button=u'up_button')),
      SetAttributeMode(self._device_navigation, u'scroll_right_layer', Layer(button=u'down_button')),
      LayerMode(self._device, Layer(prev_bank_button=u'display_up_button', next_bank_button=u'display_down_button')),
      AddLayerMode(self._background, Layer(center_display_2=u'center_display_2', scene_launch_buttons=u'scene_launch_buttons', encoders=u'encoders')),
      AddLayerMode(self._actions, Layer(actions_display=u'text_display_line_5_with_shift', actions_selection_fields=u'selection_field_line_2_with_shift'))])
     self._encoder_modes.add_mode(u'pan', [partial(self._switch_display_layout, sysex.KNOB_SCREEN_LAYOUT_BYTE),
      AddLayerMode(self._encoder_modes, Layer(mode_display=self._elements.text_display_line_3, mode_color_fields=self._elements.color_field_line_2, mode_selection_fields=self._elements.selection_field_line_1, selected_mode_color_field=u'center_color_field')),
      AddLayerMode(self._background, Layer(display_up_button=u'display_up_button', display_down_button=u'display_down_button')),
      AddLayerMode(self._actions, Layer(actions_display=u'text_display_line_3_with_shift', actions_selection_fields=u'selection_field_line_1_with_shift'))])
     self._encoder_modes.add_mode(u'sends', [partial(self._switch_display_layout, sysex.KNOB_SCREEN_LAYOUT_BYTE),
      AddLayerMode(self._encoder_modes, Layer(mode_display=self._elements.text_display_line_3, mode_color_fields=self._elements.color_field_line_2, mode_selection_fields=self._elements.selection_field_line_1, selected_mode_color_field=u'center_color_field')),
      AddLayerMode(self._actions, Layer(actions_display=u'text_display_line_3_with_shift', actions_selection_fields=u'selection_field_line_1_with_shift'))])
     self._pad_modes = ModesComponent(name=u'Pad_Modes')
     self._pad_modes.add_mode(u'drum', LayerMode(self._drum_group, Layer(matrix=u'pads_quadratic', scroll_up_button=u'up_button', scroll_down_button=u'down_button')))
     self._pad_modes.add_mode(u'disabled', AddLayerMode(self._background, Layer(matrix=u'pads_quadratic', scroll_up_button=u'up_button', scroll_down_button=u'down_button')))
     self._main_modes = ModesComponent(name=u'Encoder_Modes')
     set_main_mode = partial(setattr, self._main_modes, u'selected_mode')
     self._main_modes.add_mode(u'device_control', [partial(self._switch_display_layout, sysex.KNOB_SCREEN_LAYOUT_BYTE),
      LayerMode(self._device_parameters, Layer(parameter_controls=u'encoders', name_display_line=u'text_display_line_0', value_display_line=u'text_display_line_1', parameter_color_fields=u'color_field_line_0', encoder_color_fields=u'encoder_color_fields')),
      LayerMode(self._device, Layer(prev_bank_button=u'display_up_button', next_bank_button=u'display_down_button')),
      LayerMode(self._device_navigation, Layer(selected_device_name_display=u'center_display_1', selected_device_bank_name_display=u'center_display_2')),
      AddLayerMode(self._actions, Layer(actions_display=u'text_display_line_3_with_shift', actions_selection_fields=u'selection_field_line_1_with_shift'))])
     self._main_modes.add_mode(u'options', [self._encoder_modes,
      LayerMode(self._encoder_modes, Layer(devices_button=u'select_buttons_raw[0]', pan_button=u'select_buttons_raw[1]', sends_button=u'select_buttons_raw[2]')),
      SetAttributeMode(self._encoder_modes, u'selected_mode', u'devices'),
      AddLayerMode(self._background, Layer(select_button_3=u'select_buttons_raw[3]', select_button_4=u'select_buttons_raw[4]', select_button_5=u'select_buttons_raw[5]', select_button_6=u'select_buttons_raw[6]', select_button_7=u'select_buttons_raw[7]'))], behaviour=ReenterBehaviour(on_reenter=partial(set_main_mode, u'device_control')))
     self._main_modes.add_mode(u'grid', [partial(self._switch_display_layout, sysex.KNOB_SCREEN_LAYOUT_BYTE),
      self._pad_modes,
      self._select_grid_mode,
      LayerMode(self._device_parameters, Layer(parameter_controls=u'encoders', name_display_line=u'text_display_line_0', value_display_line=u'text_display_line_1', parameter_color_fields=u'color_field_line_0', encoder_color_fields=u'encoder_color_fields')),
      LayerMode(self._device, Layer(prev_bank_button=u'display_up_button', next_bank_button=u'display_down_button')),
      LayerMode(self._device_navigation, Layer(selected_device_name_display=u'center_display_1', selected_device_bank_name_display=u'center_display_2')),
      AddLayerMode(self._background, Layer(scene_launch_buttons=u'scene_launch_buttons')),
      AddLayerMode(self._actions, Layer(actions_display=u'text_display_line_3_with_shift', actions_selection_fields=u'selection_field_line_1_with_shift'))], behaviour=ReenterBehaviour(on_reenter=partial(set_main_mode, u'device_control')))
     self._main_modes.layer = Layer(options_button=u'options_button', grid_button=u'grid_button')
     self._main_modes.selected_mode = u'device_control'
Exemplo n.º 6
0
    def _create_modes(self):
        self._encoder_modes = DisplayingSkinableModesComponent(
            name='Encoder_Modes')
        self._encoder_modes.add_mode('devices', [
            partial(self._switch_display_layout, sysex.BOX_SCREEN_LAYOUT_BYTE),
            AddLayerMode(
                self._encoder_modes,
                Layer(mode_display=self._elements.text_display_line_5,
                      mode_color_fields=self._elements.color_field_line_2,
                      mode_selection_fields=self._elements.
                      selection_field_line_2)),
            LayerMode(
                self._device_navigation,
                Layer(select_buttons='pads_flattened',
                      device_color_fields='color_field_lines_0_1_flattened',
                      device_name_display_1='text_display_line_0',
                      device_name_display_2='text_display_line_2',
                      device_bank_name_display_1='text_display_line_1',
                      device_bank_name_display_2='text_display_line_3',
                      device_selection_fields=
                      'selection_field_lines_0_1_flattened',
                      selected_device_name_display='center_display_1')),
            SetAttributeMode(self._device_navigation, 'scroll_left_layer',
                             Layer(button='up_button')),
            SetAttributeMode(self._device_navigation, 'scroll_right_layer',
                             Layer(button='down_button')),
            LayerMode(
                self._device,
                Layer(prev_bank_button='display_up_button',
                      next_bank_button='display_down_button')),
            AddLayerMode(
                self._mixer,
                Layer(selected_track_color_field='center_color_field',
                      selected_track_name_display='center_display_1')),
            AddLayerMode(
                self._background,
                Layer(center_display_2='center_display_2',
                      scene_launch_buttons='scene_launch_buttons',
                      encoders='encoders'))
        ])
        self._main_modes = ModesComponent(name='Encoder_Modes')
        self._main_modes.add_mode('device_control', [
            partial(self._switch_display_layout,
                    sysex.KNOB_SCREEN_LAYOUT_BYTE),
            AddLayerMode(
                self._mixer,
                Layer(track_select_buttons='select_buttons',
                      track_names_display='text_display_line_3',
                      track_color_fields='color_field_line_2',
                      track_selection_fields='selection_field_line_1',
                      selected_track_color_field='center_color_field')),
            LayerMode(
                self._device_parameters,
                Layer(parameter_controls='encoders',
                      name_display_line='text_display_line_0',
                      value_display_line='text_display_line_1',
                      parameter_color_fields='color_field_line_0',
                      encoder_color_fields='encoder_color_fields')),
            LayerMode(self._session_navigation,
                      Layer(up_button='up_button', down_button='down_button')),
            LayerMode(
                self._device,
                Layer(prev_bank_button='display_up_button',
                      next_bank_button='display_down_button')),
            LayerMode(
                self._device_navigation,
                Layer(selected_device_name_display='center_display_1',
                      selected_device_bank_name_display='center_display_2'))
        ])

        self._main_modes.selected_mode = 'device_control'
Exemplo n.º 7
0
	def _create_modes(self):
		self._session_modes = ModesComponent(name = u'SessionModes')
		self._session_modes.add_mode(u'Session', [self._session, self._session.cliplaunch_layer, self._session_navigation, self._session_navigation.nav_layer], cycle_mode_button_color = u'MainModes.SelectedOn')
		self._session_modes.add_mode(u'Zoom', [self._zooming, self._session_navigation, self._session_navigation.page_layer], cycle_mode_button_color = u'MainModes.SelectedPressed')
		self._session_modes.selected_mode = u'Session'
		self._session_modes.layer = Layer(priority = 1, cycle_mode_button = self._top_buttons[4])
		self._session_modes.set_enabled(False)

		self._mixer_modes = ModesComponent(name = u'MixerModes')
		self._mixer_modes.add_mode(u'Overview', [self._session_navigation, self._session_navigation.nav_layer, self._session, self._session.clipstop_layer, self._mixer, self._mixer.overview_layer])
		self._mixer_modes.add_mode(u'TrackVolume', [self._session_navigation, self._session_navigation.nav_layer, self._mixer, self._mixer.volume_layer, tuple([self.set_slider_volume_mode, self.set_slider_single_mode])])
		self._mixer_modes.add_mode(u'TrackPan', [self._session_navigation, self._session_navigation.nav_layer, self._mixer, self._mixer.pan_layer, tuple([self.set_slider_pan_mode, self.set_slider_single_mode])])
		self._mixer_modes.add_mode(u'TrackSend1', [self._session_navigation, self._session_navigation.nav_layer, self._mixer, self._mixer.send1_layer, SetAttributeMode(obj=self._mixer, attribute=u'send_index', value=0), tuple([self.set_slider_send_mode, self.set_slider_single_mode])])
		self._mixer_modes.add_mode(u'TrackSend2', [self._session_navigation, self._session_navigation.nav_layer, self._mixer, self._mixer.send2_layer, SetAttributeMode(obj=self._mixer, attribute=u'send_index', value=1), tuple([self.set_slider_send_mode, self.set_slider_single_mode])])
		for mode in self._mixer_modes._mode_list:
			if mode == 'Overview':
				self._mixer_modes.get_mode_button(mode).mode_selected_color = u'MainModes.SelectedOn'
				self._mixer_modes.get_mode_button(mode).mode_unselected_color = u'MainModes.SelectedOn'
			else:
				self._mixer_modes.get_mode_button(mode).mode_selected_color = u'SubModes.SelectedOn'
				self._mixer_modes.get_mode_button(mode).mode_unselected_color = u'SubModes.SelectedOff'
		self._mixer_modes.selected_mode = 'Overview'
		self._mixer_modes.layer = Layer(priority = 1, Overview_button = self._top_buttons[7], TrackVolume_button = self._side_buttons[0], TrackPan_button = self._side_buttons[1], TrackSend1_button = self._side_buttons[2], TrackSend2_button = self._side_buttons[3])
		self._mixer_modes.set_enabled(False)

		self._selector = ModesComponent(name = u'Selector')
		self._selector.add_mode(u'disabled', [self._background])
		self._selector.add_mode(u'Session', [self._session_modes])
		self._selector.add_mode(u'User1', [self._translations1])
		self._selector.add_mode(u'User2', [self._translations2])
		self._selector.add_mode(u'Mixer', [tuple([self.enable_sliders, self.disable_sliders]), self._mixer_modes])
		for mode in self._selector._mode_list:
			self._selector.get_mode_button(mode).mode_selected_color = u'MainModes.SelectedOn'
			self._selector.get_mode_button(mode).mode_unselected_color = u'MainModes.SelectedOff'
		self._selector.layer = Layer(priority = 1, Session_button = self._top_buttons[4], User1_button = self._top_buttons[5], User2_button = self._top_buttons[6], Mixer_button = self._top_buttons[7])
		self._selector.set_enabled(True)
		self._selector.selected_mode = u'disabled'