コード例 #1
0
    def __init__(self, *a, **k):
        DeviceComponent.__init__(self, *a, **k)
        self._chain_sliders = []
        self._chain_buttons = []
        self._sibling_devices = []

        self._parent_component = None
コード例 #2
0
 def __init__(self):
     self._lock_button_pressed = False
     self._lock_button_pressed_time = 0
     self._lock_button_blink = False
     self._was_locked = False
     self._update_callback = None
     self._device_string = ''
     DeviceComponent.__init__(self)
     self._register_timer_callback(self._on_custom_timer)
コード例 #3
0
 def __init__(self):
     self._parameter_offset = 0
     self._selected_param = 0
     self._selected_parameter = None
     DeviceComponent.__init__(self)
     LC2ParameterElement.set_select_param(self.select_parameter)
     self._xys = [ LC2ParameterElement(MIDI_PB_TYPE, i, 0) for i in range(8) ]
     self._device_banks = {}
     self.song().view.add_selected_parameter_listener(self._on_selected_parameter_changed)
コード例 #4
0
	def __init__(self, matrix, side_buttons, top_buttons, control_surface):
		self._control_surface = control_surface
		self._skin = self._control_surface._skin
		self._matrix = matrix
		self._prev_track_button = None
		self._next_track_button = None
		self._prev_device_button = None
		self._next_device_button = None
		self._prev_bank_button = None
		self._next_bank_button = None
		self._precision_button = None
		self._precision_mode = False
		self._remaining_buttons = None
		self._device = None
		self._lock_button_slots = [None,None,None,None]
		self._lock_buttons = [None,None,None,None]
		self._locked_devices = [None,None,None,None]
		self._locked_device_index = None
		self._is_active = False
		self._force = True
		self._osd = None

		DeviceComponent.__init__(self)

		# Sliders
		self._sliders = []
		self.set_enabled(False)

		for column in range(self._matrix.width()):
			slider = DeviceControllerStrip(tuple([self._matrix.get_button(column, (self._matrix.height() - 1 - row)) for row in range(self._matrix.height())]),self._control_surface, self)
			self._sliders.append(slider)
		self._sliders = tuple(self._sliders)
		self.set_parameter_controls(self._sliders)
		self._selected_track = None

		# device selection buttons
		self.set_prev_device_button(top_buttons[0])
		self.set_next_device_button(top_buttons[1])
		# track selection buttons
		self.set_prev_track_button(top_buttons[2])
		self.set_next_track_button(top_buttons[3])

		# on/off button
		self.set_on_off_button(side_buttons[0])

		# bank nav buttons
		self.set_bank_nav_buttons(side_buttons[1], side_buttons[2])
		self._prev_bank_button = side_buttons[1]
		self._next_bank_button = side_buttons[2]
		# precision
		self.set_precision_button(side_buttons[3])
		
		# lock buttons
		self.set_lock_buttons([side_buttons[4],side_buttons[5],side_buttons[6],side_buttons[7]])
		
		# selected device listener
		self.song().add_appointed_device_listener(self._on_device_changed)
コード例 #5
0
     
 def __init__(self):
     self._lock_button_pressed = False
     self._lock_button_pressed_time = 0
     self._lock_button_blink = False
     self._was_locked = False
     self._update_callback = None
     self._device_string = ''
     DeviceComponent.__init__(self)
 def __init__(self):
     DeviceComponent.__init__(self)
     self.device_listener = None
     self.device_parm_listener = None
     self._control_translation_selector = ChannelTranslationSelector(8)
     self.clear_mode = True
     self.touch_mode = False
     self.del_parm_map = {}
     self.del_clip_map = {}
     self.del_touch_buttons = []
コード例 #7
0
 def __init__(self):
     DeviceComponent.__init__(self)
     self.device_listener = None
     self.device_parm_listener = None
     self._control_translation_selector = ChannelTranslationSelector(8)
     self.clear_mode = True
     self.touch_mode = False
     self.del_parm_map = {}
     self.del_clip_map = {}
     self.del_touch_buttons = []
コード例 #8
0
	def __init__(self,matrix,side_buttons,top_buttons,parent):
		self._parent=parent
		self._matrix=matrix
		self._prev_track_button=None
		self._next_track_button=None
		self._prev_device_button=None
		self._next_device_button=None
		self._prev_bank_button=None
		self._next_bank_button=None
		self._precision_button=None
		self._precision_mode=False
		self._remaining_buttons=None
		self._device= None
		self._is_active = False
		self._force=True
		self._osd = None
		
		DeviceComponent.__init__(self)

		#Sliders
		self._sliders = []
		self.set_enabled(False)
		
		for column in range(self._matrix.width()):
			slider = PreciseButtonSliderElement(tuple([self._matrix.get_button(column, (self._matrix.height() - 1 - row)) for row in range(self._matrix.height()) ]))
			slider.set_parent(self)
			slider.set_mode(3)
			self._sliders.append(slider)
		self._sliders=tuple(self._sliders)
		self.set_parameter_controls(self._sliders)
		self._selected_track = None
		
		#device selection buttons
		self.set_prev_device_button(top_buttons[0])
		self.set_next_device_button(top_buttons[1])
		#track selection buttons
		self.set_prev_track_button(top_buttons[2])
		self.set_next_track_button(top_buttons[3])
				
		#on/off button
		self.set_on_off_button(side_buttons[0])
		#lock button
		self.set_lock_button(side_buttons[1])
		self.set_lock_callback(self._lock_callback_function)
		#bank nav buttons
		self.set_bank_nav_buttons(side_buttons[2],side_buttons[3])
		self._prev_bank_button=side_buttons[2]
		self._next_bank_button=side_buttons[3]
		#precision
		self.set_precision_button(side_buttons[4])
		#remaining buttons that need to be turned off !
		self.set_remaining_buttons([side_buttons[5],side_buttons[6],side_buttons[7]])
		
		#selected device listener
		self.song().add_appointed_device_listener(self._on_device_changed)
コード例 #9
0
	def __init__(self, parent):
		DeviceComponent.__init__(self)
		self._type = None
		self._device_parent = None
		self._parent = parent
		self._chain = 0
		self._device_chain = 0
		self._number_params = 0
		self._params = []
		self._custom_parameter = []
		self._nodevice = NoDevice()	
コード例 #10
0
 def __init__(self):
     DeviceComponent.__init__(self)
     self._parameter_value_data_source = DisplayDataSource()
     self._parameter_name_data_sources = []
     self._page_name_data_sources = []
     self._page_index = [0, 0, 0, 0]
     for new_index in range(8):
         self._parameter_name_data_sources.append(DisplayDataSource())
         self._page_name_data_sources.append(DisplayDataSource())
         self._parameter_name_data_sources[-1].set_display_string(' - ')
         self._page_name_data_sources[-1].set_display_string(' - ')
コード例 #11
0
 def __init__(self, parent, host, cs):
     DeviceComponent.__init__(self)
     self._type = None
     self._device_parent = None
     self._host = host
     self._parent = parent
     self._chain = 0
     self._cs = cs
     self._device_chain = 0
     self._params = []
     self._cntrl_offset = 0
コード例 #12
0
	def __init__(self, parent, host, cs):
		DeviceComponent.__init__(self)
		self._type = None
		self._device_parent = None
		self._host = host
		self._parent = parent
		self._chain = 0
		self._cs = cs
		self._device_chain = 0
		self._params = []
		self._cntrl_offset = 0
コード例 #13
0
	def __init__(self,matrix,side_buttons,top_buttons,parent):
		self._parent=parent
		self._matrix=matrix
		self._prev_track_button=None
		self._next_track_button=None
		self._prev_device_button=None
		self._next_device_button=None
		self._prev_bank_button=None
		self._next_bank_button=None
		self._precision_button=None
		self._precision_mode=False
		self._remaining_buttons=None
		self._device= None
		self._is_active = False
		self._force=True
		
		DeviceComponent.__init__(self)

		#Sliders
		self._sliders = []
		self.set_enabled(False)
		
		for column in range(self._matrix.width()):
			slider = PreciseButtonSliderElement(tuple([self._matrix.get_button(column, (self._matrix.height() - 1 - row)) for row in range(self._matrix.height()) ]))
			slider.set_parent(self)
			slider.set_mode(3)
			self._sliders.append(slider)
		self._sliders=tuple(self._sliders)
		self.set_parameter_controls(self._sliders)
		
		#device selection buttons
		self.set_prev_device_button(top_buttons[0])
		self.set_next_device_button(top_buttons[1])
		#track selection buttons
		self.set_prev_track_button(top_buttons[2])
		self.set_next_track_button(top_buttons[3])
				
		#on/off button
		self.set_on_off_button(side_buttons[0])
		#lock button
		self.set_lock_button(side_buttons[1])
		self.set_lock_callback(self._lock_callback_function)
		#bank nav buttons
		self.set_bank_nav_buttons(side_buttons[2],side_buttons[3])
		self._prev_bank_button=side_buttons[2]
		self._next_bank_button=side_buttons[3]
		#precision
		self.set_precision_button(side_buttons[4])
		#remaining buttons that need to be turned off !
		self.set_remaining_buttons([side_buttons[5],side_buttons[6],side_buttons[7]])
		
		#selected device listener
		self.song().add_appointed_device_listener(self._on_device_changed)
コード例 #14
0
 def __init__(self):
     DeviceComponent.__init__(self)
     self._parameter_value_data_source = DisplayDataSource()
     self._parameter_name_data_sources = []
     self._page_name_data_sources = []
     self._page_index = [0,
      0,
      0,
      0]
     for new_index in range(8):
         self._parameter_name_data_sources.append(DisplayDataSource())
         self._page_name_data_sources.append(DisplayDataSource())
         self._parameter_name_data_sources[-1].set_display_string(' - ')
         self._page_name_data_sources[-1].set_display_string(' - ')
コード例 #15
0
 def __init__(self, parent):
     self._update_callback = None
     self._device_string = ' Browser '
     self.__parent = parent
     self._mode_selector = None
     self._action_controls = None
     self._is_last_nav = False
     self._active_browser = None
     self._mapping = SLPadMapping(self)    
     DeviceComponent.__init__(self)
     self._init_browser()
     #self._register_timer_callback(self._on_custom_timer)
     self._init_task = None
     self._init_done = False
コード例 #16
0
 def __init__(self, parent):
     self._update_callback = None
     self._device_string = ' Browser '
     self.__parent = parent
     self._mode_selector = None
     self._action_controls = None
     self._is_last_nav = False
     self._active_browser = None
     self._mapping = SLPadMapping(self)
     DeviceComponent.__init__(self)
     self._init_browser()
     #self._register_timer_callback(self._on_custom_timer)
     self._init_task = None
     self._init_done = False
    def __init__(self):
        DeviceComponent.__init__(self)
        new_banks = {}
        new_bank_names = {}
        self._device_banks = DEVICE_DICT
        self._device_bank_names = BANK_NAME_DICT
        self._device_best_banks = DEVICE_BOB_DICT
        for device_name in self._device_banks.keys():
            current_banks = self._device_banks[device_name]
            if len(current_banks) > 1:
                current_banks = self._device_best_banks[device_name] + current_banks
                new_bank_names[device_name] = (BOP_BANK_NAME,) + self._device_bank_names[device_name]
            new_banks[device_name] = current_banks

        self._device_banks = new_banks
        self._device_bank_names = new_bank_names
コード例 #18
0
    def __init__(self):
        DeviceComponent.__init__(self)
        new_banks = {}
        new_bank_names = {}
        self._device_banks = DEVICE_DICT
        self._device_bank_names = BANK_NAME_DICT
        self._device_best_banks = DEVICE_BOB_DICT
        for device_name in self._device_banks.keys():
            current_banks = self._device_banks[device_name]
            if len(current_banks) > 1:
                current_banks = self._device_best_banks[device_name] + current_banks
                new_bank_names[device_name] = (BOP_BANK_NAME,) + self._device_bank_names[device_name]
            new_banks[device_name] = current_banks

        self._device_banks = new_banks
        self._device_bank_names = new_bank_names
コード例 #19
0
    def __init__(self):
        DeviceComponent.__init__(self)
        new_banks = {}
        new_bank_names = {}
        self._device_banks = DEVICE_DICT
        self._device_bank_names = BANK_NAME_DICT
        self._device_best_banks = DEVICE_BOB_DICT
        for device_name, current_banks in self._device_banks.iteritems():
            raise len(current_banks) > 1 and (device_name in self._device_best_banks.keys() or AssertionError), "Could not find best-of-banks for '%s'" % device_name
            if not device_name in self._device_bank_names.keys():
                raise AssertionError, "Could not find bank names for '%s'" % device_name
                current_banks = self._device_best_banks[device_name] + current_banks
                new_bank_names[device_name] = (BOP_BANK_NAME,) + self._device_bank_names[device_name]
            new_banks[device_name] = current_banks

        self._device_banks = new_banks
        self._device_bank_names = new_bank_names
        self._bank_name_data_source = DisplayDataSource()
コード例 #20
0
    def __init__(self):
        DeviceComponent.__init__(self)
        new_banks = {}
        new_bank_names = {}
        self._device_banks = DEVICE_DICT
        self._device_bank_names = BANK_NAME_DICT
        self._device_best_banks = DEVICE_BOB_DICT
        for device_name, current_banks in self._device_banks.iteritems():
            raise len(current_banks) > 1 and (
                device_name in self._device_best_banks.keys() or AssertionError
            ), "Could not find best-of-banks for '%s'" % device_name
            if not device_name in self._device_bank_names.keys():
                raise AssertionError, "Could not find bank names for '%s'" % device_name
                current_banks = self._device_best_banks[
                    device_name] + current_banks
                new_bank_names[device_name] = (
                    BOP_BANK_NAME, ) + self._device_bank_names[device_name]
            new_banks[device_name] = current_banks

        self._device_banks = new_banks
        self._device_bank_names = new_bank_names
        self._bank_name_data_source = DisplayDataSource()
コード例 #21
0
	def __init__(self, script):
		DeviceComponent.__init__(self)
		self._script = script
		self._display_device_button = None
		self._prev_button = None
		self._next_button = None
コード例 #22
0
 def __init__(self):
     DeviceComponent.__init__(self)
コード例 #23
0
 def __init__(self, script):
     DeviceComponent.__init__(self)
     self._script = script
     self._display_device_button = None
     self._prev_button = None
     self._next_button = None
コード例 #24
0
 def __init__(self, surface):
     DeviceComponent.__init__(self)
     self.surface = surface
     self.device_listener = None
     self.device_parm_listener = None
コード例 #25
0
 def __init__(self, *a, **k):
     DeviceComponent.__init__(self, *a, **k)
     self._param_buttons = []
     self.active_bank = 0
コード例 #26
0
 def __init__(self):
     DeviceComponent.__init__(self)
コード例 #27
0
	def __init__(self, control_surface = None, name = "device_component", is_enabled = False, matrix = None, side_buttons = None, top_buttons = None):
		self._control_surface = control_surface
		self.name = name
		self._matrix = matrix
		self._prev_track_button = None
		self._next_track_button = None
		self._prev_device_button = None
		self._next_device_button = None
		self._prev_bank_button = None
		self._next_bank_button = None
		self._precision_button = None
		self._precision_mode = False
		self._remaining_buttons = None
		self._device = None
		self._lock_button_slots = [None,None,None,None]
		self._lock_buttons = [None,None,None,None]
		self._locked_devices = [None,None,None,None]
		self._locked_device_index = None
		self._is_active = False
		self._force = True
		self._osd = None

		LiveDeviceComponent.__init__(self)

		# Sliders
		self._sliders = []
		self.set_enabled(is_enabled)

		self._selected_track = None
		
		self._lock_buttons = [None for index in range(4)]
		self._locked_device_bank = [0 for index in range(4)]
		self._lock_button_press = [0 for index in range(4)]
		self._locked_devices = [None for index in range(4)]

		if top_buttons != None:
			# device selection buttons
			self.set_prev_device_button(top_buttons[0])
			self.set_next_device_button(top_buttons[1])
			# track selection buttons
			self.set_prev_track_button(top_buttons[2])
			self.set_next_track_button(top_buttons[3])

		if side_buttons != None:
			# on/off button
			self.set_on_off_button(side_buttons[0])

			# bank nav buttons
			self.set_bank_nav_buttons(side_buttons[1], side_buttons[2])
			self._prev_bank_button = side_buttons[1]
			self._next_bank_button = side_buttons[2]
			# precision
			self.set_precision_button(side_buttons[3])
		
			# lock buttons
			self.set_lock_button1(side_buttons[4])
			self.set_lock_button2(side_buttons[5])
			self.set_lock_button3(side_buttons[6])
			self.set_lock_button4(side_buttons[7])
		
		if matrix != None:
			self.set_matrix(matrix)
		
		
		# selected device listener
		self.song().add_appointed_device_listener(self._on_device_changed)
コード例 #28
0
ファイル: DeviceComponent.py プロジェクト: hdavid/Launchpad95
	def __init__(self, control_surface = None, name = "device_component", is_enabled = False, matrix = None, side_buttons = None, top_buttons = None):
		self._control_surface = control_surface
		self.name = name
		self._device = None
		self._matrix = matrix
		self._selected_track = None		
		
		#Track navigation buttons
		self._prev_track_button = None
		self._next_track_button = None
		#Track Device navigation buttons
		self._prev_device_button = None
		self._next_device_button = None
		#Device Bank navigation buttons
		self._prev_bank_button = None
		self._next_bank_button = None
		
		#Precision logic
		self._precision_button = None
		self._precision_mode = False
				
		#Lock logic
		self._lock_button_slots = [None,None,None,None]
		self._lock_buttons = [None,None,None,None]
		self._locked_devices = [None,None,None,None]
		self._locked_device_index = None
		self._lock_buttons = [None,None,None,None]
		self._locked_device_bank = [0,0,0,0]
		self._lock_button_press = [0,0,0,0]
		self._locked_devices = [None,None,None,None]
		
		self._is_active = False
		self._force = True
		self._osd = None

		self._control_surface.application().view.add_is_view_visible_listener('Detail', self._on_detail_view_changed)
		self._control_surface.application().view.add_is_view_visible_listener('Detail/Clip', self._on_views_changed)
		
		#self._remaining_buttons = None UNUSED
		LiveDeviceComponent.__init__(self)

		# Sliders
		self._sliders = []
		self.set_enabled(is_enabled)


		if top_buttons != None:
			# device selection buttons
			self.set_prev_device_button(top_buttons[0])
			self.set_next_device_button(top_buttons[1])
			# track selection buttons
			self.set_prev_track_button(top_buttons[2])
			self.set_next_track_button(top_buttons[3])

		if side_buttons != None:
			# on/off button
			self.set_on_off_button(side_buttons[0])

			# bank nav buttons
			self.set_bank_nav_buttons(side_buttons[1], side_buttons[2])
			self._prev_bank_button = side_buttons[1]
			self._next_bank_button = side_buttons[2]
			
			# precision
			self.set_precision_button(side_buttons[3])
		
			# lock buttons
			self.set_lock_button1(side_buttons[4])
			self.set_lock_button2(side_buttons[5])
			self.set_lock_button3(side_buttons[6])
			self.set_lock_button4(side_buttons[7])
		
		if matrix != None:
			self.set_matrix(matrix)
		
		# selected device listener
		self.song().add_appointed_device_listener(self._on_device_changed)
		self._control_surface.set_device_component(self)
コード例 #29
0
    def __init__(self,
                 control_surface=None,
                 name="device_component",
                 is_enabled=False,
                 matrix=None,
                 side_buttons=None,
                 top_buttons=None):
        self._control_surface = control_surface
        self.name = name
        self._device = None
        self._matrix = matrix
        self._selected_track = None

        # Track navigation buttons
        self._prev_track_button = None
        self._next_track_button = None
        # Track Device navigation buttons
        self._prev_device_button = None
        self._next_device_button = None
        # Device Bank navigation buttons
        self._prev_bank_button = None
        self._next_bank_button = None

        # Precision logic
        self._precision_button = None
        self._precision_mode = False

        # Lock logic
        self._lock_button_slots = [None, None, None, None]
        self._lock_buttons = [None, None, None, None]
        self._locked_devices = [None, None, None, None]
        self._locked_device_index = None
        self._lock_buttons = [None, None, None, None]
        self._locked_device_bank = [0, 0, 0, 0]
        self._lock_button_press = [0, 0, 0, 0]
        self._locked_devices = [None, None, None, None]

        self._is_active = False
        self._force = True
        self._osd = None

        self._control_surface.application().view.add_is_view_visible_listener(
            'Detail', self._on_detail_view_changed)
        self._control_surface.application().view.add_is_view_visible_listener(
            'Detail/Clip', self._on_views_changed)

        # self._remaining_buttons = None UNUSED
        LiveDeviceComponent.__init__(self)

        # Sliders
        self._sliders = []
        self.set_enabled(is_enabled)

        if top_buttons != None:
            # device selection buttons
            self.set_prev_device_button(top_buttons[0])
            self.set_next_device_button(top_buttons[1])
            # track selection buttons
            self.set_prev_track_button(top_buttons[2])
            self.set_next_track_button(top_buttons[3])

        if side_buttons != None:
            # on/off button
            self.set_on_off_button(side_buttons[0])

            # bank nav buttons
            self.set_bank_nav_buttons(side_buttons[1], side_buttons[2])
            self._prev_bank_button = side_buttons[1]
            self._next_bank_button = side_buttons[2]

            # precision
            self.set_precision_button(side_buttons[3])

            # lock buttons
            self.set_lock_button1(side_buttons[4])
            self.set_lock_button2(side_buttons[5])
            self.set_lock_button3(side_buttons[6])
            self.set_lock_button4(side_buttons[7])

        if matrix != None:
            self.set_matrix(matrix)

        # selected device listener
        self.song().add_appointed_device_listener(self._on_device_changed)
        self._control_surface.set_device_component(self)
コード例 #30
0
    def __init__(self, matrix, side_buttons, top_buttons, parent):
        self._parent = parent
        self._matrix = matrix
        self._prev_track_button = None
        self._next_track_button = None
        self._prev_device_button = None
        self._next_device_button = None
        self._prev_bank_button = None
        self._next_bank_button = None
        self._precision_button = None
        self._precision_mode = False
        self._remaining_buttons = None
        self._device = None
        self._lock_button_slots = [None, None, None, None]
        self._lock_buttons = [None, None, None, None]
        self._locked_devices = [None, None, None, None]
        self._locked_device_index = None
        self._is_active = False
        self._force = True
        self._osd = None

        DeviceComponent.__init__(self)

        # Sliders
        self._sliders = []
        self.set_enabled(False)

        for column in range(self._matrix.width()):
            slider = DeviceControllerStrip(
                tuple([
                    self._matrix.get_button(column,
                                            (self._matrix.height() - 1 - row))
                    for row in range(self._matrix.height())
                ]), self)
            self._sliders.append(slider)
        self._sliders = tuple(self._sliders)
        self.set_parameter_controls(self._sliders)
        self._selected_track = None

        # device selection buttons
        self.set_prev_device_button(top_buttons[0])
        self.set_next_device_button(top_buttons[1])
        # track selection buttons
        self.set_prev_track_button(top_buttons[2])
        self.set_next_track_button(top_buttons[3])

        # on/off button
        self.set_on_off_button(side_buttons[0])

        # bank nav buttons
        self.set_bank_nav_buttons(side_buttons[1], side_buttons[2])
        self._prev_bank_button = side_buttons[1]
        self._next_bank_button = side_buttons[2]
        # precision
        self.set_precision_button(side_buttons[3])

        # lock buttons
        self.set_lock_buttons([
            side_buttons[4], side_buttons[5], side_buttons[6], side_buttons[7]
        ])

        # selected device listener
        self.song().add_appointed_device_listener(self._on_device_changed)
コード例 #31
0
 def __init__(self):
     DeviceComponent.__init__(self)
     self._device_banks = {}
コード例 #32
0
    def __init__(self,
                 control_surface=None,
                 name="device_component",
                 is_enabled=False,
                 matrix=None,
                 side_buttons=None,
                 top_buttons=None):
        self._control_surface = control_surface
        self.name = name
        self._matrix = matrix
        self._prev_track_button = None
        self._next_track_button = None
        self._prev_device_button = None
        self._next_device_button = None
        self._prev_bank_button = None
        self._next_bank_button = None
        self._precision_button = None
        self._precision_mode = False
        self._remaining_buttons = None
        self._device = None
        self._lock_button_slots = [None, None, None, None]
        self._lock_buttons = [None, None, None, None]
        self._locked_devices = [None, None, None, None]
        self._locked_device_index = None
        self._is_active = False
        self._force = True
        self._osd = None

        LiveDeviceComponent.__init__(self)

        # Sliders
        self._sliders = []
        self.set_enabled(is_enabled)

        self._selected_track = None

        self._lock_buttons = [None for index in range(4)]
        self._locked_device_bank = [0 for index in range(4)]
        self._lock_button_press = [0 for index in range(4)]
        self._locked_devices = [None for index in range(4)]

        if top_buttons != None:
            # device selection buttons
            self.set_prev_device_button(top_buttons[0])
            self.set_next_device_button(top_buttons[1])
            # track selection buttons
            self.set_prev_track_button(top_buttons[2])
            self.set_next_track_button(top_buttons[3])

        if side_buttons != None:
            # on/off button
            self.set_on_off_button(side_buttons[0])

            # bank nav buttons
            self.set_bank_nav_buttons(side_buttons[1], side_buttons[2])
            self._prev_bank_button = side_buttons[1]
            self._next_bank_button = side_buttons[2]
            # precision
            self.set_precision_button(side_buttons[3])

            # lock buttons
            self.set_lock_button1(side_buttons[4])
            self.set_lock_button2(side_buttons[5])
            self.set_lock_button3(side_buttons[6])
            self.set_lock_button4(side_buttons[7])

        if matrix != None:
            self.set_matrix(matrix)

        # selected device listener
        self.song().add_appointed_device_listener(self._on_device_changed)
コード例 #33
0
 def __init__(self, surface):
     DeviceComponent.__init__(self)
     self.surface = surface
     self.device_listener = None
     self.device_parm_listener = None
 def __init__(self):
     DeviceComponent.__init__(self)
     self._shift_button = None
     self._shift_pressed = False
     self._control_translation_selector = ChannelTranslationSelector(8)
 def __init__(self):
     DeviceComponent.__init__(self)
     self._shift_button = None
     self._shift_pressed = False
     self._control_translation_selector = ChannelTranslationSelector(8)
コード例 #36
0
 def __init__(self):
     DeviceComponent.__init__(self)
     self._serato_interface = None
     self._parameter_listeners = []
     return
コード例 #37
0
ファイル: __init__.py プロジェクト: whilp/xone
 def __init__(self):
     DeviceComponent.__init__(
         self)
     parameter_controls = list(self.parameter_controls())
     self.set_parameter_controls(parameter_controls)
コード例 #38
0
    def __init__(self,
                 parent,
                 num_params=8,
                 direct_bank=False,
                 mono=True,
                 shared=False,
                 path=None,
                 delayed_update=False,
                 new_skin=False,
                 *a,
                 **k):
        self._parent = parent
        self._use_new_skin = new_skin
        self._mapper = None
        Framework_DeviceComponentBase.__init__(self, *a, **k)
        self._is_osc = hasattr(self._parent,
                               '_osc_control') and self._parent._osc_control
        if not self._is_osc:
            g_hud = False
        self.log(
            'DeviceComponent(STANDARD): num: ' + str(num_params) + ', path: ' +
            str(path) + ', HUD: ' + str(g_hud) + ', OSC: ' + str(self._is_osc),
            True)
        if g_mapper:
            PrEditorParameterProvider.__init__(self, parent)
            self.log('****** create mapper(STANDARD): path: ' + str(path),
                     True)
            PrEditorMapper.__init__(self, PrEditorParameterProvider, path,
                                    num_params)
        DeviceComponentBase.__init__(self, parent,
                                     PrEditorMapper if g_mapper else None,
                                     False, num_params, direct_bank, mono,
                                     shared, path, delayed_update, new_skin)
        k.pop('feedback_mode', None)
        k.pop('lock_button', None)

        def make_hud_encoder(index, name):
            control = HUDControlElement(self, self._hud_state_control, i)
            control.name = name + '_' + str(i)
            return control

        def make_osc_encoder(index, name, osc_msg):
            control = OSCControlElement(self, self._parent.oscServer, i,
                                        osc_msg)
            control.name = name + '_' + str(i)
            return control

        if g_hud:
            self.log('Creating HUD notification', True)
            self._hud_state_control = NotifyingControlElement()
            self._hud_state_control.name = 'HUD_State'
            self._hud_controls = ButtonMatrixElement(rows=[[
                make_osc_encoder(i, 'HUD_Control', '/hud') for i in xrange(8)
            ]])
            self._hud_cs_controls = ButtonMatrixElement(rows=[[
                make_osc_encoder(i, 'HUD_CS_Control', '/hudcs')
                for i in xrange(8)
            ]])
        self._mono = mono
        for light in self.encoder_rings:
            light.enabled = True

        for light in self.device_select:
            light.enabled = False
            light.color = 'DefaultButton.Off' if self._mono else 'Device.NoDevice'
            light.disabled_color = 'DefaultButton.Off' if self._mono else 'Device.NoDevice'

        for light in self.device_enable:
            light.enabled = False
            light.color = 'DefaultButton.Off' if self._mono else 'Device.NoDevice'
            light.disabled_color = 'DefaultButton.Off' if self._mono else 'Device.NoDevice'

        for light in self.parameter_lights:
            light.enabled = False
 def __init__(self):
     DeviceComponent.__init__(self)
     self._device_banks = {}
コード例 #40
0
 def __init__(self, surface):
     DeviceComponent.__init__(self)
     self.surface = surface
     self.device_listener = None
     self.device_parm_listener = None
     self._control_translation_selector = ChannelTranslationSelector(8)
コード例 #41
0
 def __init__(self):
     DeviceComponent.__init__(self)
     self._serato_interface = None
     self._parameter_listeners = []
コード例 #42
0
 def __init__(self, surface):
     DeviceComponent.__init__(self)
     self.surface = surface
     self.device_listener = None
     self.device_parm_listener = None
     self._control_translation_selector = ChannelTranslationSelector(8)