コード例 #1
0
 def __init__(self, *a, **k):
     super(ComradeEncoders, self).__init__((), *a, **k)
     self._main_modes = NullModes()
     self._element_injector = inject(element_container=const(None)).everywhere()
     self._message_injector = inject(message=const(None)).everywhere()
     with self.component_guard():
         with inject(skin=const(skin), message_cache=const(self._sysex_message_cache)).everywhere():
             self._elements = Elements()
     self._element_injector = inject(element_container=const(self._elements)).everywhere()
     with self.component_guard():
         self._create_message()
     self._message_injector = inject(message=const(self._message)).everywhere()
     self._switch_display_layout(sysex.KNOB_SCREEN_LAYOUT_BYTE)
     self._device_bank_registry = DeviceBankRegistry()
     with self.component_guard():
         self._create_transport()
         self._create_auto_arm()
         self._create_drums()
         self._create_device()
         self._create_device_navigation()
         self._create_actions()
         self._create_clip_actions()
         self._create_background()
         self._create_modes()
     self._drum_group_finder = self.register_disconnectable(PercussionInstrumentFinder(device_parent=self.song.view.selected_track))
     self.__on_drum_group_found.subject = self._drum_group_finder
     self.__on_drum_group_found()
     self.__on_selected_track_changed.subject = self.song.view
     self.__on_selected_track_changed()
     self.__on_record_mode_changed.subject = self.song
     self.set_feedback_channels([DRUM_FEEDBACK_CHANNEL])
     self._set_feedback_velocity()
コード例 #2
0
 def __init__(self, device_bank_registry=None, banking_info=None, delete_handler=None, track_list_component=None, *a, **k):
     assert banking_info is not None
     assert device_bank_registry is not None
     assert track_list_component is not None
     self._flattened_chain = FlattenedDeviceChain(collect_devices)
     self._track_decorator = DecoratorFactory()
     self._modes = NullModes()
     self.move_device = None
     super(DeviceNavigationComponent, self).__init__(item_provider=self._flattened_chain, *a, **k)
     self._delete_handler = delete_handler
     self.chain_selection = ChainSelectionComponent(parent=self, is_enabled=False)
     self.bank_selection = BankSelectionComponent(bank_registry=device_bank_registry, banking_info=banking_info, device_options_provider=self._device_component, is_enabled=False, parent=self)
     self.move_device = MoveDeviceComponent(parent=self, is_enabled=False)
     self._last_pressed_button_index = -1
     self._selected_on_previous_press = None
     self._modes = ModesComponent(parent=self)
     self._modes.add_mode('default', [
      partial(self.chain_selection.set_parent, None),
      partial(self.bank_selection.set_device, None)])
     self._modes.add_mode('chain_selection', [self.chain_selection])
     self._modes.add_mode('bank_selection', [self.bank_selection])
     self._modes.selected_mode = 'default'
     self.register_disconnectable(self._flattened_chain)
     self.__on_items_changed.subject = self
     self.__on_bank_selection_closed.subject = self.bank_selection
     self._update_selected_track()
     self._track_list = track_list_component
     watcher = self.register_disconnectable(DeviceChainStateWatcher(device_navigation=self))
     self.__on_device_item_state_changed.subject = watcher
     self._update_device()
     self._update_button_colors()
     return
コード例 #3
0
    def __init__(self, c_instance):
        ControlSurface.__init__(self, c_instance)

        self._main_modes = NullModes()
        self._element_injector = inject(
            element_container=const(None)).everywhere()
        self._message_injector = inject(message=const(None)).everywhere()
        with self.component_guard():
            with inject(skin=const(skin),
                        message_cache=const(
                            self._sysex_message_cache)).everywhere():
                self._elements = Elements()
        self._element_injector = inject(
            element_container=const(self._elements)).everywhere()
        with self.component_guard():
            self._create_message()
        self._message_injector = inject(
            message=const(self._message)).everywhere()
        self._switch_display_layout(sysex.KNOB_SCREEN_LAYOUT_BYTE)
        self._device_bank_registry = DeviceBankRegistry()
        with self.component_guard():
            self._create_session()
            self._create_mixer()
            self._create_session_recording()
            self._create_auto_arm()
            self._create_track_navigation()
            self._create_device()
            self._create_device_navigation()
            self._create_background()
            self._create_modes()
        return
コード例 #4
0
 def __init__(self, *a, **k):
     (super(SLMkIII, self).__init__)(
         a,
         product_id_bytes=sysex.NOVATION_MANUFACTURER_ID +
         sysex.DEVICE_FAMILY_CODE + sysex.DEVICE_FAMILY_MEMBER_CODE,
         **k)
     self._main_modes = NullModes()
     self._element_injector = inject(
         element_container=(const(None))).everywhere()
     self._message_injector = inject(message=(const(None))).everywhere()
     with self.component_guard():
         with inject(skin=(const(skin)),
                     message_cache=(const(
                         self._sysex_message_cache))).everywhere():
             self._elements = Elements()
     self._element_injector = inject(
         element_container=(const(self._elements))).everywhere()
     with self.component_guard():
         self._create_message()
     self._message_injector = inject(
         message=(const(self._message))).everywhere()
     self._switch_display_layout(sysex.KNOB_SCREEN_LAYOUT_BYTE)
     self._device_bank_registry = DeviceBankRegistry()
     with self.component_guard():
         self._create_session()
         self._create_mixer()
         self._create_transport()
         self._create_session_recording()
         self._create_auto_arm()
         self._create_track_navigation()
         self._create_drums()
         self._create_device()
         self._create_device_navigation()
         self._create_actions()
         self._create_clip_actions()
         self._create_background()
         self._create_modes()
     self._drum_group_finder = self.register_disconnectable(
         PercussionInstrumentFinder(
             device_parent=(self.song.view.selected_track)))
     self._SLMkIII__on_drum_group_found.subject = self._drum_group_finder
     self._SLMkIII__on_drum_group_found()
     self._SLMkIII__on_selected_track_changed.subject = self.song.view
     self._SLMkIII__on_selected_track_changed()
     self._SLMkIII__on_session_record_changed.subject = self.song
     self._SLMkIII__on_record_mode_changed.subject = self.song
     self.set_feedback_channels([DRUM_FEEDBACK_CHANNEL])
     self._set_feedback_velocity()