def __init__(self, device_bank_registry=None, *a, **k):
     super(ChainNode, self).__init__(*a, **k)
     self._device_bank_registry = device_bank_registry
     self._on_devices_changed_in_live.subject = self._object
     self._on_selected_device_changed_in_live.subject = self._get_track().view
     self._child_name_slots = self.register_disconnectable(EventObject())
     self._child_state_slots = self.register_disconnectable(EventObject())
     self._selected_drum_pad_slots = self.register_disconnectable(EventObject())
     self._update_children()
     self._update_selected_child()
 def __init__(self,
              device_provider=None,
              device_bank_registry=None,
              toggle_lock=None,
              *a,
              **k):
     super(SimpleDeviceParameterComponent, self).__init__(*a, **k)
     self._toggle_lock = toggle_lock
     self._device = None
     self._banks = []
     self._bank_index = 0
     self._parameter_controls = None
     self._empty_control_slots = self.register_disconnectable(EventObject())
     self._device_bank_registry = device_bank_registry
     self._device_provider = device_provider
     self._device_name_slot = self.register_slot(
         None, self._update_device_name_display, u'name')
     self.__on_provided_device_changed.subject = device_provider
     self.__on_provided_device_changed()
     self._display_bank_name_task = self._tasks.add(
         task.sequence(task.run(self._display_bank_name),
                       task.wait(BANK_NAME_DISPLAY_DURATION),
                       task.run(self._update_device_name_display)))
     self._display_bank_name_task.kill()
     if toggle_lock:
         self.__on_is_locked_to_device_changed.subject = self._device_provider
         self.__on_is_locked_to_device_changed()
Exemple #3
0
 def __init__(self, note_layout=None, *a, **k):
     assert note_layout is not None
     super(InstrumentScalesComponent, self).__init__(*a, **k)
     self._note_layout = note_layout
     self._key_center_buttons = []
     self._encoder_touch_button_slots = self.register_disconnectable(
         EventObject())
     self._encoder_touch_buttons = []
     self._top_key_center_buttons = None
     self._bottom_key_center_buttons = None
     self._absolute_relative_button = None
     self._diatonic_chromatic_button = None
     self._info_sources = map(DisplayDataSource,
                              (u'Scale selection:', u'', u''))
     self._line_sources = recursive_map(
         DisplayDataSource, ((u'', u'', u'', u'', u'', u'', u''),
                             (u'', u'', u'', u'', u'', u'', u'')))
     self._scale_sources = map(
         partial(DisplayDataSource, adjust_string_fn=adjust_string_crop),
         (u'', u'', u'', u''))
     self._presets = InstrumentPresetsComponent(self._note_layout,
                                                is_enabled=False,
                                                parent=self)
     self._presets.selected_mode = 'scale_p4_vertical'
     self._scale_list = ListComponent(parent=self,
                                      data_sources=self._scale_sources)
     self._scale_list.scrollable_list.fixed_offset = 1
     self._scale_list.scrollable_list.assign_items(SCALES)
     self._scale_list.scrollable_list.select_item_index_with_offset(
         list(SCALES).index(self._note_layout.scale), 1)
     self._on_selected_scale.subject = self._scale_list.scrollable_list
     self._update_data_sources()
     return
 def __init__(self, *a, **k):
     super(ScrollableListComponent, self).__init__(*a, **k)
     self._data_sources = [ DisplayDataSource() for _ in range(self.num_segments) ]
     self._selected_option = None
     self._offset_index = 0
     self._option_names = []
     self._select_buttons = []
     self._select_button_slots = self.register_disconnectable(EventObject())
     self.register_slot(self, self._set_selected_option, b'press_option')
     return
 def __init__(self,
              device_provider=None,
              device_bank_registry=None,
              *a,
              **k):
     (super(ChainNode, self).__init__)(*a, **k)
     self._device_bank_registry = device_bank_registry
     self._device_provider = device_provider
     self._on_devices_changed_in_live.subject = self._object
     self._on_selected_device_changed_in_live.subject = self._get_track(
     ).view
     macro_devices = filter(lambda device: hasattr(device, 'macros_mapped'),
                            self._object.devices)
     self._on_macros_mapped_changed.replace_subjects(macro_devices)
     self._child_name_slots = self.register_disconnectable(EventObject())
     self._child_state_slots = self.register_disconnectable(EventObject())
     self._selected_drum_pad_slots = self.register_disconnectable(
         EventObject())
     self._update_children()
     self._update_selected_child()
 def __init__(self, device_provider=None, device_bank_registry=None, toggle_lock=None, use_parameter_banks=False, *a, **k):
     (super(SimpleDeviceParameterComponent, self).__init__)(*a, **k)
     self._toggle_lock = toggle_lock
     self._use_parameter_banks = use_parameter_banks
     self._device = None
     self._banks = []
     self._bank_index = 0
     self._parameter_controls = None
     self._empty_control_slots = self.register_disconnectable(EventObject())
     self._device_bank_registry = device_bank_registry
     self._device_provider = device_provider
     self._SimpleDeviceParameterComponent__on_provided_device_changed.subject = device_provider
     self._SimpleDeviceParameterComponent__on_provided_device_changed()
     if toggle_lock:
         self._SimpleDeviceParameterComponent__on_is_locked_to_device_changed.subject = self._device_provider
         self._SimpleDeviceParameterComponent__on_is_locked_to_device_changed()
 def __init__(self, *a, **k):
     super(GridResolution, self).__init__(*a, **k)
     self._index = DEFAULT_INDEX
     self._quantization_buttons = []
     self._quantization_button_slots = self.register_disconnectable(
         EventObject())