コード例 #1
0
    def setup(self):
        self.log.info('Initializing Ui')

        # Aquire the Main-Window from the UI-File
        self.win = self.get_check_widget('window')

        # Connect Close-Handler
        self.win.connect('delete-event', Gtk.main_quit)

        # Create Audio-Level Display
        drawing_area = self.find_widget_recursive(self.win, 'audiolevel_main')
        self.audio_level_display = AudioLevelDisplay(drawing_area)

        # Create Main-Video Overlay Controller
        drawing_area = self.find_widget_recursive(self.win,
                                                  'video_overlay_drawingarea')
        self.video_warning_overlay = VideoWarningOverlay(drawing_area)

        # Create Main-Video Display
        drawing_area = self.find_widget_recursive(self.win, 'video_main')
        self.main_video_display = VideoDisplay(
            drawing_area,
            port=11000,
            play_audio=Config.getboolean('mainvideo', 'playaudio'),
            level_callback=self.audio_level_display.level_callback)

        # Setup Preview Controller
        box_left = self.find_widget_recursive(self.win, 'box_left')
        self.video_previews_controller = VideoPreviewsController(
            box_left, win=self.win, uibuilder=self)

        # check if there is a fixed audio source configured.
        # if so, remove the combo-box entirely instead of setting it up.
        if Config.has_option('mix', 'audiosource'):
            box_audio = self.find_widget_recursive(self.win, 'box_audio')
            box_left.remove(box_audio)
        else:
            combo_audio = self.find_widget_recursive(self.win, 'combo_audio')
            self.audio_selector_controller = AudioSelectorController(
                combo=combo_audio, win=self.win, uibuilder=self)

        # Setup Toolbar Controllers
        toolbar = self.find_widget_recursive(self.win, 'toolbar')
        self.composition_toolbar_controller = CompositionToolbarController(
            toolbar, win=self.win, uibuilder=self)

        self.streamblank_toolbar_controller = StreamblankToolbarController(
            toolbar,
            win=self.win,
            uibuilder=self,
            warning_overlay=self.video_warning_overlay)

        self.misc_controller = MiscToolbarController(toolbar,
                                                     win=self.win,
                                                     uibuilder=self)

        # Setup Shortcuts window
        self.win.connect('key-press-event', self.handle_keypress)
コード例 #2
0
    def setup(self):
        self.log.info('Initializing Ui')

        # Aquire the Main-Window from the UI-File
        self.win = self.get_check_widget('window')

        # Connect Close-Handler
        self.win.connect('delete-event', Gtk.main_quit)

        # Create Audio-Level Display
        drawing_area = self.find_widget_recursive(self.win, 'audiolevel_main')
        self.audio_level_display = AudioLevelDisplay(drawing_area)

        # Create Main-Video Overlay Controller
        self.video_warning_overlay = VideoWarningOverlay()

        # Create Main-Video Display
        drawing_area = self.find_widget_recursive(self.win, 'video_main')
        self.main_video_display = VideoDisplay(
            drawing_area,
            port=11000,
            play_audio=Config.getboolean('mainvideo', 'playaudio'),
            draw_callback=self.video_warning_overlay.draw_callback,
            level_callback=self.audio_level_display.level_callback)

        # Setup Preview Controller
        drawing_area = self.find_widget_recursive(self.win, 'box_left')
        self.video_previews_controller = VideoPreviewsController(
            drawing_area, win=self.win, uibuilder=self)

        drawing_area = self.find_widget_recursive(self.win, 'combo_audio')
        self.audio_selector_controller = AudioSelectorController(
            drawing_area, win=self.win, uibuilder=self)

        # Setup Toolbar Controllers
        toolbar = self.find_widget_recursive(self.win, 'toolbar')
        self.composition_toolbar_controller = CompositionToolbarController(
            toolbar, win=self.win, uibuilder=self)

        self.streamblank_toolbar_controller = StreamblankToolbarController(
            toolbar,
            win=self.win,
            uibuilder=self,
            warning_overlay=self.video_warning_overlay)

        self.special_functions_toolbar_controller = SpecialFunctionsToolbarController(
            toolbar,
            win=self.win,
            uibuilder=self,
            video_display=self.main_video_display)
コード例 #3
0
    def setup(self):
        self.log.info('Initializing Ui')

        # Aquire the Main-Window from the UI-File
        self.win = self.get_check_widget('window')

        # check for configuration option mainwindow/force_fullscreen
        if Config.getboolean('mainwindow', 'forcefullscreen', fallback=False):
            self.log.info(
                'Forcing main window to full screen by configuration')
            # set window into fullscreen mode
            self.win.fullscreen()
        else:
            # check for configuration option mainwindow/width and /height
            if Config.has_option('mainwindow', 'width') \
                    and Config.has_option('mainwindow', 'height'):
                # get size from config
                width = Config.getint('mainwindow', 'width')
                height = Config.getint('mainwindow', 'height')
                self.log.info(
                    'Set window size by configuration to %d:%d', width, height)
                # set window size
                self.win.set_size_request(width, height)
                self.win.set_resizable(False)

        # Connect Close-Handler
        self.win.connect('delete-event', Gtk.main_quit)

        # Create Audio-Level Display
        drawing_area = self.find_widget_recursive(self.win, 'audiolevel_main')
        self.audio_level_display = AudioLevelDisplay(drawing_area)

        # Create Main-Video Overlay Controller
        drawing_area = self.find_widget_recursive(self.win,
                                                  'video_overlay_drawingarea')
        self.video_warning_overlay = VideoWarningOverlay(drawing_area)

        # Create Main-Video Display
        drawing_area = self.find_widget_recursive(self.win, 'video_main')
        self.main_video_display = VideoDisplay(
            drawing_area,
            port=11000,
            play_audio=Config.getboolean('mainvideo', 'playaudio'),
            level_callback=self.audio_level_display.level_callback
        )

        # Setup Preview Controller
        box_left = self.find_widget_recursive(self.win, 'box_left')
        self.video_previews_controller = VideoPreviewsController(
            box_left,
            win=self.win,
            uibuilder=self
        )

        # Setup Toolbar Controllers
        toolbar = self.find_widget_recursive(self.win, 'toolbar')
        self.composition_toolbar_controller = CompositionToolbarController(
            toolbar,
            win=self.win,
            uibuilder=self
        )

        self.streamblank_toolbar_controller = StreamblankToolbarController(
            toolbar,
            win=self.win,
            uibuilder=self,
            warning_overlay=self.video_warning_overlay
        )

        self.misc_controller = MiscToolbarController(
            toolbar,
            win=self.win,
            uibuilder=self
        )

        self.rec_controller = RecordingToolbarController(
            toolbar,
            win=self.win,
            uibuilder=self
        )

        toolbar.insert(StudioClock(), len(toolbar.get_children()) - 1)

        # Setup Shortcuts window
        self.win.connect('key-press-event', self.handle_keypress)
        self.win.connect('window-state-event', self.handle_state)