def __init__(self, matrix, top_buttons, side_buttons, config_button, osd, parent): assert isinstance(matrix, ButtonMatrixElement) assert ((matrix.width() == 8) and (matrix.height() == 8)) assert isinstance(top_buttons, tuple) assert (len(top_buttons) == 8) assert isinstance(side_buttons, tuple) assert (len(side_buttons) == 8) assert isinstance(config_button, ButtonElement) ModeSelectorComponent.__init__(self) self._osd = osd self._parent = parent self._mode_index = 0 self._previous_mode_index = -1 self._main_mode_index = 0 self._sub_mode_index = [0, 0, 0, 0] for index in range(4): self._sub_mode_index[index] = 0 self.set_mode_buttons(top_buttons[4:]) self._session = SpecialSessionComponent(matrix.width(), matrix.height(), self) self._session.set_osd(self._osd) self._zooming = SessionZoomingComponent(self._session) self._session.name = 'Session_Control' self._zooming.name = 'Session_Overview' self._matrix = matrix self._side_buttons = side_buttons self._nav_buttons = top_buttons[:4] self._config_button = config_button self._zooming.set_empty_value(LED_OFF) self._all_buttons = [] for button in self._side_buttons + self._nav_buttons: self._all_buttons.append(button) self._sub_modes = SubSelectorComponent(matrix, side_buttons, self._session) self._sub_modes.name = 'Mixer_Modes' self._sub_modes._mixer.set_osd(self._osd) self._sub_modes.set_update_callback(self._update_control_channels) self._stepseq = StepSequencerComponent(self._matrix, self._side_buttons, self._nav_buttons, self) self._stepseq.set_osd(self._osd) self._stepseq2 = StepSequencerComponent2(self._matrix, self._side_buttons, self._nav_buttons, self) self._stepseq2.set_osd(self._osd) self._instrument_controller = InstrumentControllerComponent( self._matrix, self._side_buttons, self._nav_buttons, self) self._instrument_controller.set_osd(self._osd) self._device_controller = DeviceControllerComponent( self._matrix, self._side_buttons, self._nav_buttons, self) self._device_controller.set_osd(self._osd) self._init_session() self._all_buttons = tuple(self._all_buttons)
def __init__(self, matrix, top_buttons, side_buttons, config_button, osd, control_surface): #verify matrix dimentions assert isinstance(matrix, ButtonMatrixElement) assert ((matrix.width() == 8) and (matrix.height() == 8)) assert isinstance(top_buttons, tuple) assert (len(top_buttons) == 8) assert isinstance(side_buttons, tuple) assert (len(side_buttons) == 8) assert isinstance(config_button, ButtonElement) ModeSelectorComponent.__init__(self) #super constructor #inject ControlSurface and OSD components (M4L) self._osd = osd self._control_surface = control_surface #initialize index variables self._mode_index = 0 #Inherited from parent self._main_mode_index = 0 #LP original modes self._sub_mode_list = [0, 0, 0, 0] for index in range(4): self._sub_mode_list[index] = 0 self.set_mode_buttons(top_buttons[4:]) if Settings.SESSION__STOP_BUTTONS: #session with bottom stop buttons clip_stop_buttons = [] for column in range(8): clip_stop_buttons.append( matrix.get_button(column, matrix.height() - 1)) self._session = SpecialSessionComponent(matrix.width(), matrix.height() - 1, clip_stop_buttons, self._control_surface, self) else: #no stop buttons self._session = SpecialSessionComponent(matrix.width(), matrix.height(), None, self._control_surface, self) #initialize _session variables self._session.set_osd(self._osd) self._session.name = 'Session_Control' #initialize _zooming variables self._zooming = DeprecatedSessionZoomingComponent(self._session, enable_skinning=True) self._zooming.name = 'Session_Overview' self._zooming.set_empty_value("Default.Button.Off") self._matrix = matrix self._side_buttons = side_buttons #launch buttons self._nav_buttons = top_buttons[:4] #arrow buttons self._config_button = config_button #used to reset launchpad self._all_buttons = [] for button in self._side_buttons + self._nav_buttons: self._all_buttons.append(button) #SubSelector changes the Mode using side buttons (ie. Pan, Volume, Send1, Send2, Stop, Solo, Activate, Arm) self._sub_modes = SubSelectorComponent(matrix, side_buttons, self._session, self._control_surface) self._sub_modes.name = 'Mixer_Modes' self._sub_modes._mixer.set_osd(self._osd) self._sub_modes.set_update_callback(self._update_control_channels) #User2 stepSequencer (Drum & Melodic) self._stepseq = StepSequencerComponent(self._matrix, self._side_buttons, self._nav_buttons, self._control_surface) self._stepseq.set_osd(self._osd) #User2 stepSequencer (Retro style) self._stepseq2 = StepSequencerComponent2(self._matrix, self._side_buttons, self._nav_buttons, self._control_surface) self._stepseq2.set_osd(self._osd) #User1 Instrument controller (Scale) self._instrument_controller = InstrumentControllerComponent( self._matrix, self._side_buttons, self._nav_buttons, self._control_surface) self._instrument_controller.set_osd(self._osd) #self._instrument_controller = None #User1 Device controller (Fx or Instrument parameters) self._device_controller = DeviceComponent( control_surface=self._control_surface, matrix=self._matrix, side_buttons=self._side_buttons, top_buttons=self._nav_buttons) self._device_controller.set_osd(self._osd) self._init_session() self._all_buttons = tuple(self._all_buttons)
def __init__(self, matrix, top_buttons, side_buttons, config_button, osd, control_surface): assert isinstance(matrix, ButtonMatrixElement) assert ((matrix.width() == 8) and (matrix.height() == 8)) assert isinstance(top_buttons, tuple) assert (len(top_buttons) == 8) assert isinstance(side_buttons, tuple) assert (len(side_buttons) == 8) assert isinstance(config_button, ButtonElement) ModeSelectorComponent.__init__(self) self._osd = osd self._control_surface = control_surface self._mode_index = 0 self._previous_mode_index = -1 self._main_mode_index = 0 self._sub_mode_index = [0, 0, 0, 0] for index in range(4): self._sub_mode_index[index] = 0 self.set_mode_buttons(top_buttons[4:]) if Settings.SESSION__STOP_BUTTONS: #session with bottom stop buttons clip_stop_buttons = [] for column in range(8): clip_stop_buttons.append( matrix.get_button(column, matrix.height() - 1)) self._session = SpecialSessionComponent(matrix.width(), matrix.height() - 1, clip_stop_buttons, self._control_surface, self) else: #no stop buttons self._session = SpecialSessionComponent(matrix.width(), matrix.height(), None, self._control_surface, self) self._session.set_osd(self._osd) self._session.name = 'Session_Control' self._zooming = DeprecatedSessionZoomingComponent(self._session) self._zooming.name = 'Session_Overview' self._zooming.set_empty_value(self._control_surface._skin.off) self._matrix = matrix self._side_buttons = side_buttons self._nav_buttons = top_buttons[:4] self._config_button = config_button self._all_buttons = [] for button in self._side_buttons + self._nav_buttons: self._all_buttons.append(button) self._sub_modes = SubSelectorComponent(matrix, side_buttons, self._session, self._control_surface) self._sub_modes.name = 'Mixer_Modes' self._sub_modes._mixer.set_osd(self._osd) self._sub_modes.set_update_callback(self._update_control_channels) self._stepseq = StepSequencerComponent(self._matrix, self._side_buttons, self._nav_buttons, self._control_surface) self._stepseq.set_osd(self._osd) self._stepseq2 = StepSequencerComponent2(self._matrix, self._side_buttons, self._nav_buttons, self._control_surface) self._stepseq2.set_osd(self._osd) self._instrument_controller = InstrumentControllerComponent( self._matrix, self._side_buttons, self._nav_buttons, self._control_surface) self._instrument_controller.set_osd(self._osd) self._device_controller = DeviceControllerComponent( self._matrix, self._side_buttons, self._nav_buttons, self._control_surface) self._device_controller.set_osd(self._osd) self._init_session() self._all_buttons = tuple(self._all_buttons)