def __init__(self, selection=None, *a, **k):
     super(CreateDefaultTrackComponent, self).__init__(*a, **k)
     self.options = self.register_component(OptionsComponent())
     self.options.selected_option = None
     self.options.default_option_names = ('Audio', 'Midi', 'Return')
     self.options.labels = ('Create track:', '', '', '')
     self.options.selected_color = 'Browser.Load'
     self.options.unselected_color = 'Browser.Load'
     self._on_option_selected.subject = self.options
     self._selection = selection
Beispiel #2
0
 def __init__(self, *a, **k):
     super(NoteRepeatComponent, self).__init__(*a, **k)
     self._aftertouch = None
     self._last_record_quantization = None
     self._note_repeat = None
     self._options = self.register_component(OptionsComponent())
     self._options.selected_color = 'NoteRepeat.RateSelected'
     self._options.unselected_color = 'NoteRepeat.RateUnselected'
     self._options.option_names = map(str, range(8))
     self._options.selected_option = 5
     self._on_selected_option_changed.subject = self._options
     self.set_note_repeat(None)
 def __init__(self, *a, **k):
     super(NoteRepeatComponent, self).__init__(*a, **k)
     self._last_record_quantization = None
     self._note_repeat = None
     self._options = self.register_component(OptionsComponent())
     self._options.set_enabled(False)
     self._options.selected_color = 'NoteRepeat.RateSelected'
     self._options.unselected_color = 'NoteRepeat.RateUnselected'
     self._options.default_option_names = map(str, range(8))
     self._options.selected_option = 5
     self.add_mode('disabled', None)
     self.add_mode('enabled', [self._options, (self._enable_note_repeat, self._disable_note_repeat)], 'DefaultButton.On')
     self.selected_mode = 'disabled'
     self._on_selected_option_changed.subject = self._options
     self.set_note_repeat(None)
Beispiel #4
0
 def __init__(self, grid_resolution = None, initial_encoder_layer = None, encoder_layer = None, settings_layer = None, *a, **k):
     super(NoteEditorSettingsComponent, self).__init__(*a, **k)
     raise encoder_layer or AssertionError
     self._bottom_data_sources = [ DisplayDataSource() for _ in xrange(8) ]
     self._request_hide = False
     self.settings = self.register_component(NoteSettingsComponent(grid_resolution=grid_resolution, layer=settings_layer))
     self.settings.set_enabled(False)
     self._automation = self.register_component(AutomationComponent())
     self._automation.set_enabled(False)
     self._mode_selector = self.register_component(OptionsComponent(num_options=2, num_labels=0, num_display_segments=8))
     self._mode_selector.set_enabled(False)
     self._on_selected_option.subject = self._mode_selector
     self._update_available_modes()
     self._mode_selector.selected_option = 0
     self._visible_detail_view = 'Detail/DeviceChain'
     self._show_settings_task = self._tasks.add(Task.sequence(Task.wait(Defaults.MOMENTARY_DELAY), Task.run(self._show_settings)))
     self._show_settings_task.kill()
     self._update_infos_task = self._tasks.add(Task.run(self._update_note_infos))
     self._update_infos_task.kill()
     self._settings_modes = self.register_component(ModesComponent())
     self._settings_modes.set_enabled(False)
     self._settings_modes.add_mode('automation', [self._automation,
      self._mode_selector,
      partial(self._set_envelope_view_visible, True),
      self._show_clip_view])
     self._settings_modes.add_mode('note_settings', [self.settings,
      self._update_note_infos,
      self._mode_selector,
      partial(self._set_envelope_view_visible, False),
      self._show_clip_view])
     self._settings_modes.add_mode('pad_settings', [self.settings, partial(self._set_envelope_view_visible, False), self._show_clip_view])
     self._encoders = None
     self._initial_encoders = None
     self.add_mode('disabled', [])
     self.add_mode('about_to_show', [AddLayerMode(self, initial_encoder_layer), (self._show_settings_task.restart, self._show_settings_task.kill)])
     self.add_mode('enabled', [DetailViewRestorerMode(self.application()),
      AddLayerMode(self, encoder_layer),
      self._update_available_modes,
      self._settings_modes])
     self.selected_mode = 'disabled'
     self._editors = []
     self._on_detail_clip_changed.subject = self.song().view
     self._on_selected_track_changed.subject = self.song().view