def __init__(self, matrix, top_buttons, side_buttons, config_button): raise isinstance(matrix, ButtonMatrixElement) or AssertionError raise matrix.width() == 8 and matrix.height() == 8 or AssertionError raise isinstance(top_buttons, tuple) or AssertionError raise len(top_buttons) == 8 or AssertionError raise isinstance(side_buttons, tuple) or AssertionError raise len(side_buttons) == 8 or AssertionError raise isinstance(config_button, ButtonElement) or AssertionError ModeSelectorComponent.__init__(self) self._session = SpecialSessionComponent(matrix.width(), matrix.height()) self._zooming = DeprecatedSessionZoomingComponent(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.set_update_callback(self._update_control_channels) self._init_session() self._all_buttons = tuple(self._all_buttons) self.set_modes_buttons(top_buttons[4:])
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, knobs, sliders, script): 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._script = script self._session = SpecialSessionComponent(matrix.width(), matrix.height()) for scene in self._session._scenes: for slot in scene._clip_slots: slot._triggered_to_play_value = 4 slot._triggered_to_record_value = 3 slot._started_value = 2 slot._recording_value = 1 slot._stopped_value = 127 self._zooming = SessionZoomingComponent(self._session) self._zooming._stopped_value = 127 self._zooming._playing_value = 2 self._zooming._selected_value = 1 self._matrix = matrix self._knobs = knobs self._sliders = sliders self._side_buttons = side_buttons self._nav_buttons = top_buttons[:4] self._config_button = config_button self._shift_button = top_buttons[5] 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._shift_pressed = 0 self._shift_pressed_timer = 0 self._last_normal_mode = 0 self._shift_button = None self.set_shift_button(top_buttons[6]) self._sub_modes = SubSelectorComponent(matrix, side_buttons, self._session) self._sub_modes.set_update_callback(self._update_control_channels) self._init_session() self._all_buttons = tuple(self._all_buttons) self.set_modes_buttons(top_buttons[4:6])
def __init__(self, matrix, top_buttons, side_buttons, config_button, script): 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._script = script self._session = SpecialSessionComponent(matrix.width(), matrix.height()) """for scene in self._session._scenes: for slot in scene._clip_slots: slot._triggered_to_play_value = 24 slot._triggered_to_record_value = 27 slot._started_value = 7 slot._recording_value = 9 slot._stopped_value = 8""" self._zooming = SessionZoomingComponent(self._session) self._session.name = 'Session_Control' self._zooming.name = 'Session_Overview' """self._zooming._stopped_value = 9 self._zooming._playing_value = 7 self._zooming._selected_value = 8""" 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.set_update_callback(self._update_control_channels) self._init_session() self._all_buttons = tuple(self._all_buttons) self.set_modes_buttons(top_buttons[4:]) if START_IN_MOD is True: self._set_protected_mode_index(4)
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)