예제 #1
0
    def _create_session(self):
        self._session = SessionComponent(SESSION_WIDTH,
                                         SESSION_HEIGHT,
                                         name=u'Session_Control',
                                         auto_name=True,
                                         enable_skinning=True)
        self._session.set_clip_launch_buttons(self._matrix)
        self._session.set_stop_track_clip_buttons(
            tuple(self._track_stop_buttons))
        self._session.set_scene_launch_buttons(self._scene_launch_buttons)
        for scene_index in range(SESSION_HEIGHT):
            scene = self._session.scene(scene_index)
            for track_index in range(SESSION_WIDTH):
                clip_slot = scene.clip_slot(track_index)
                clip_slot.name = u'%d_Clip_Slot_%d' % (track_index,
                                                       scene_index)

        self._session.selected_scene().set_launch_button(
            self._selected_scene_launch_button)
        self._session_zoom = ShiftableZoomingComponent(
            self._session,
            tuple(self._track_stop_buttons),
            name=u'Session_Overview',
            enable_skinning=True)
        self._session_zoom.set_button_matrix(self._matrix)
        self._session_zoom.set_zoom_button(self._shift_button)
        self._session_zoom.set_scene_bank_buttons(self._scene_launch_buttons)
    def _create_session(self):

        def when_bank_on(button):
            return self._bank_toggle.create_toggle_element(on_control=button)

        def when_bank_off(button):
            return self._bank_toggle.create_toggle_element(off_control=button)

        self._session = SessionComponent(NUM_TRACKS, NUM_SCENES, auto_name=True, is_enabled=False, enable_skinning=True, layer=Layer(track_bank_left_button=when_bank_off(self._left_button), track_bank_right_button=when_bank_off(self._right_button), scene_bank_up_button=when_bank_off(self._up_button), scene_bank_down_button=when_bank_off(self._down_button), page_left_button=when_bank_on(self._left_button), page_right_button=when_bank_on(self._right_button), page_up_button=when_bank_on(self._up_button), page_down_button=when_bank_on(self._down_button), stop_track_clip_buttons=self._stop_buttons, stop_all_clips_button=self._stop_all_button, scene_launch_buttons=self._scene_launch_buttons, clip_launch_buttons=self._session_matrix))
        clip_color_table = colors.CLIP_COLOR_TABLE.copy()
        clip_color_table[16777215] = 119
        self._session.set_rgb_mode(clip_color_table, colors.RGB_COLOR_TABLE)
        self._session_zoom = SessionZoomingComponent(self._session, name='Session_Overview', enable_skinning=True, is_enabled=False, layer=Layer(button_matrix=self._shifted_matrix, nav_left_button=self._with_shift(self._left_button), nav_right_button=self._with_shift(self._right_button), nav_up_button=self._with_shift(self._up_button), nav_down_button=self._with_shift(self._down_button), scene_bank_buttons=self._shifted_scene_buttons))