def _setup_modes(self): self._main_modes = ModesComponent(name='MainModes') self._main_modes.add_mode('disabled', [self._background]) self._main_modes.add_mode('Mix', [ self._session_modes, self._mixer, self._mixer.mix_layer, self._transport ]) self._main_modes.add_mode( 'DJ', [ self._session_modes, self._mixer, self._mixer.dj_layer, self._dj_translation, tuple([self._assign_tempo, self._deassign_tempo]) ], behaviour=DefaultedBehaviour(default_mode='Mix')) #tuple([ lambda:self._set_tempo_buttons([self._grid[7][5], self._grid[7][6]]), self._set_tempo_buttons([])])], self._main_modes.add_mode( 'Instrument', [ self._update_keygroup_colors, self._bassgroup, self._keygroup, self._scale_mode, self._octave_offset_component, self._device, self._device_navigator, self._mixer, self._mixer.instrument_layer, self._drumgroup ], behaviour=DefaultedBehaviour(default_mode='Mix')) self._main_modes.add_mode( 'Mod', [ self._modswitcher, self._device, self._mixer, self._mixer.instrument_layer ], behaviour=DefaultedBehaviour(default_mode='Mix')) self._main_modes.layer = Layer(priority=5, Instrument_button=self._shift_l, DJ_button=self._shift_r, Mod_button=self._livid) self._main_modes.selected_mode = 'disabled' self._main_modes.set_enabled(True)
def _setup_session_control(self): self._session_ring = SessionRingComponent(num_tracks=7, num_scenes=5) self._session_ring.set_enabled(True) self._session_navigation = SessionNavigationComponent( session_ring=self._session_ring) self._session_navigation.scroll_navigation_layer = AddLayerMode( self._session_navigation, Layer(priority=5, up_button=self._menu[2], down_button=self._menu[5], left_button=self._menu[3], right_button=self._menu[4])) self._session_navigation.page_navigation_layer = AddLayerMode( self._session_navigation, Layer(priority=5, page_up_button=self._menu[2], page_down_button=self._menu[5], page_left_button=self._menu[3], page_right_button=self._menu[4])) self._session_navigation._vertical_banking.scroll_up_button.color = 'Session.NavigationButtonOn' self._session_navigation._vertical_banking.scroll_down_button.color = 'Session.NavigationButtonOn' self._session_navigation._horizontal_banking.scroll_up_button.color = 'Session.NavigationButtonOn' self._session_navigation._horizontal_banking.scroll_down_button.color = 'Session.NavigationButtonOn' self._session_navigation._vertical_paginator.scroll_up_button.color = 'Session.PageNavigationButtonOn' self._session_navigation._vertical_paginator.scroll_down_button.color = 'Session.PageNavigationButtonOn' self._session_navigation._horizontal_paginator.scroll_up_button.color = 'Session.PageNavigationButtonOn' self._session_navigation._horizontal_paginator.scroll_down_button.color = 'Session.PageNavigationButtonOn' self._session_navigation.set_enabled(False) self._session = OhmSessionComponent(name='Session', session_ring=self._session_ring, auto_name=True) hasattr(self._session, '_enable_skinning') and self._session._enable_skinning() self._session.set_enabled(False) self._session.clip_launch_layer = AddLayerMode( self._session, Layer(priority=5, clip_launch_buttons=self._matrix.submatrix[:7, :5])) self._session.scene_launch_layer = AddLayerMode( self._session, Layer(priority=5, scene_launch_buttons=self._matrix.submatrix[7, :5])) self._session_zoom = SessionOverviewComponent( name='Session_Overview', session_ring=self._session_ring, enable_skinning=True) self._session_zoom.layer = Layer( priority=5, button_matrix=self._matrix.submatrix[:7, :5]) self._session_zoom.set_enabled(False) self._session_modes = ModesComponent(name='Session_Modes') self._session_modes.add_mode('disabled', [ self._session, self._session.clip_launch_layer, self._session.scene_launch_layer, self._session_navigation, self._session_navigation.scroll_navigation_layer ]) self._session_modes.add_mode('enabled', [ self._session, self._session.scene_launch_layer, self._session_zoom, self._session_navigation, self._session_navigation.page_navigation_layer ], behaviour=DefaultedBehaviour()) self._session_modes.layer = Layer(priority=5, enabled_button=self._grid[7][7]) self._session_modes.selected_mode = 'disabled' self._session_modes.set_enabled(False)