예제 #1
0
    def __init__(self, scrollable_list=None, data_sources=tuple(), *a, **k):
        super(ListComponent, self).__init__(*a, **k)
        self._data_sources = data_sources
        self._activation_task = Task.Task()
        self._action_on_scroll_task = Task.Task()
        self._scrollable_list = None
        self._scroller = self.register_component(ScrollComponent())
        self._pager = self.register_component(ScrollComponent())
        self.last_action_item = lambda: self._last_action_item
        self.item_formatter = DefaultItemFormatter()
        for c in (self._scroller, self._pager):
            for button in (c.scroll_up_button, c.scroll_down_button):
                button.color = 'List.ScrollerOn'
                button.pressed_color = None
                button.disabled_color = 'List.ScrollerOff'

        if scrollable_list == None:
            self.scrollable_list = ActionList(
                num_visible_items=len(data_sources))
        else:
            self.scrollable_list = scrollable_list
        self._scrollable_list.num_visible_items = len(data_sources)
        self._delay_activation = BooleanContext()
        self._selected_index_float = 0.0
        self._in_encoder_selection = BooleanContext(False)
        self._execute_action_task = self._tasks.add(
            Task.sequence(Task.delay(1), Task.run(self._execute_action)))
        self._execute_action_task.kill()
예제 #2
0
	def __init__(self, *a, **k):
		self.suppressing_control_notifications = BooleanContext()
		super(ActionsComponent, self).__init__(*a, **k)
		self._record_quantization = RecordingQuantization.rec_q_sixtenth
		self._on_record_quantization_changed_in_live.subject = self.song()
		self._on_record_quantization_changed_in_live()
		self._metronome_toggle = ToggleComponent('metronome', self.song())
 def __init__(self, scrollable_list=None, data_sources=tuple(), *a, **k):
     super(ListComponent, self).__init__(*a, **k)
     self._data_sources = data_sources
     self._activation_task = Task.Task()
     self._action_on_scroll_task = Task.Task()
     self._scrollable_list = None
     self._scroller = self.register_component(ScrollComponent())
     self.last_action_item = lambda: self._last_action_item
     if scrollable_list == None:
         self.scrollable_list = ActionList(
             num_visible_items=len(data_sources))
     else:
         self.scrollable_list = scrollable_list
     self._scrollable_list.num_visible_items = len(data_sources)
     self._delay_activation = BooleanContext()
     self._selected_index_float = 0.0
     self._in_encoder_selection = BooleanContext(False)
     self._execute_action_task = self._tasks.add(
         Task.sequence(Task.delay(1), Task.run(self._execute_action)))
     self._execute_action_task.kill()
예제 #4
0
 def __init__(self, *a, **k):
     super(FullBrowserModel, self).__init__(*a, **k)
     self._contents = []
     self._num_contents = 0
     self._push_content_list()
     self._inside_item_activated_notification = BooleanContext()
예제 #5
0
 def __init__(self, buttons=None, *a, **k):
     super(CombinedButtonsElement, self).__init__(rows=[buttons], *a, **k)
     self._is_pressed = BooleanContext(False)
예제 #6
0
 def __init__(self, *a, **k):
     super(ProxyBase, self).__init__(*a, **k)
     self._skip_wrapper_lookup = BooleanContext()