# Path: vocto/port.py
# class Port(object):
# 
#     NONE = 0
# 
#     IN = 1
#     OUT = 2
# 
#     OFFSET_PREVIEW = 100
#     # core listening port
#     CORE_LISTENING = 9999
#     # input ports
#     SOURCES_IN = 10000
#     SOURCES_BACKGROUND = 16000
#     SOURCE_OVERLAY= 14000
#     SOURCES_BLANK = 17000
#     AUDIO_SOURCE_BLANK = 18000
#     # output ports
#     MIX_OUT = 11000
#     MIX_PREVIEW = MIX_OUT+OFFSET_PREVIEW
#     SOURCES_OUT = 13000
#     SOURCES_PREVIEW = SOURCES_OUT+OFFSET_PREVIEW
#     LIVE_OUT = 15000
#     LIVE_PREVIEW = LIVE_OUT+OFFSET_PREVIEW
# 
#     def __init__(self, name, source=None, audio=None, video=None):
#         self.name = name
#         self.source = source
#         self.audio = audio
#         self.video = video
#         self.update()
# 
#     def todict(self):
#         return {
#             'name': self.name,
#             'port': self.port,
#             'audio': self.audio,
#             'video': self.video,
#             'io': self.io,
#             'connections': self.connections
#         }
# 
#     def update(self):
#         if self.source:
#             self.port = self.source.port()
#             self.audio = self.source.audio_channels()
#             self.video = self.source.video_channels()
#             self.io = self.IN if self.source.is_input() else self.OUT
#             self.connections = self.source.num_connections()
# 
#     def from_str(_str):
#         p = Port(_str['name'])
#         p.port = _str['port']
#         p.audio = _str['audio']
#         p.video = _str['video']
#         p.io = _str['io']
#         p.connections = _str['connections']
#         return p
# 
#     def is_input(self):
#         return self.io == Port.IN
# 
#     def is_output(self):
#         return self.io == Port.OUT


import logging
from gi.repository import Gtk, Gdk
from lib.config import Config
from lib.uibuilder import UiBuilder
from lib.videodisplay import VideoDisplay
from lib.audioleveldisplay import AudioLevelDisplay
from lib.audiodisplay import AudioDisplay
from lib.videopreviews import VideoPreviewsController
from lib.queues import QueuesWindowController
from lib.ports import PortsWindowController
from lib.toolbar.mix import MixToolbarController
from lib.toolbar.preview import PreviewToolbarController
from lib.toolbar.overlay import OverlayToolbarController
from lib.toolbar.blinder import BlinderToolbarController
from lib.toolbar.misc import MiscToolbarController
from lib.studioclock import StudioClock
from vocto.port import Port
            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.getWindowSize():
                # set window size
                self.win.set_size_request(*Config.getWindowSize())
                self.win.set_resizable(False)

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

        output_aspect_ratio = self.find_widget_recursive(
            self.win, 'output_aspect_ratio')
        output_aspect_ratio.props.ratio = Config.getVideoRatio()

        audio_box = self.find_widget_recursive(self.win, 'audio_box')

        # Setup Preview Controller
        self.video_previews = VideoPreviewsController(
            self.find_widget_recursive(self.win, 'preview_box'),
            audio_box,
            win=self.win,
            uibuilder=self
        )
        if Config.getPreviewsEnabled():
            for idx, source in enumerate(Config.getSources()):
                self.video_previews.addPreview(self, source,

# Path: vocto/port.py
# class Port(object):
# 
#     NONE = 0
# 
#     IN = 1
#     OUT = 2
# 
#     OFFSET_PREVIEW = 100
#     # core listening port
#     CORE_LISTENING = 9999
#     # input ports
#     SOURCES_IN = 10000
#     SOURCES_BACKGROUND = 16000
#     SOURCE_OVERLAY= 14000
#     SOURCES_BLANK = 17000
#     AUDIO_SOURCE_BLANK = 18000
#     # output ports
#     MIX_OUT = 11000
#     MIX_PREVIEW = MIX_OUT+OFFSET_PREVIEW
#     SOURCES_OUT = 13000
#     SOURCES_PREVIEW = SOURCES_OUT+OFFSET_PREVIEW
#     LIVE_OUT = 15000
#     LIVE_PREVIEW = LIVE_OUT+OFFSET_PREVIEW
# 
#     def __init__(self, name, source=None, audio=None, video=None):
#         self.name = name
#         self.source = source
#         self.audio = audio
#         self.video = video
#         self.update()
# 
#     def todict(self):
#         return {
#             'name': self.name,
#             'port': self.port,
#             'audio': self.audio,
#             'video': self.video,
#             'io': self.io,
#             'connections': self.connections
#         }
# 
#     def update(self):
#         if self.source:
#             self.port = self.source.port()
#             self.audio = self.source.audio_channels()
#             self.video = self.source.video_channels()
#             self.io = self.IN if self.source.is_input() else self.OUT
#             self.connections = self.source.num_connections()
# 
#     def from_str(_str):
#         p = Port(_str['name'])
#         p.port = _str['port']
#         p.audio = _str['audio']
#         p.video = _str['video']
#         p.io = _str['io']
#         p.connections = _str['connections']
#         return p
# 
#     def is_input(self):
#         return self.io == Port.IN
# 
#     def is_output(self):
#         return self.io == Port.OUT


# Path: voctogui/lib/ui.py
import logging
from gi.repository import Gtk, Gdk
from lib.config import Config
from lib.uibuilder import UiBuilder
from lib.videodisplay import VideoDisplay
from lib.audioleveldisplay import AudioLevelDisplay
from lib.audiodisplay import AudioDisplay
from lib.videopreviews import VideoPreviewsController
from lib.queues import QueuesWindowController
from lib.ports import PortsWindowController
from lib.toolbar.mix import MixToolbarController
from lib.toolbar.preview import PreviewToolbarController
from lib.toolbar.overlay import OverlayToolbarController
from lib.toolbar.blinder import BlinderToolbarController
from lib.toolbar.misc import MiscToolbarController
from lib.studioclock import StudioClock
from vocto.port import Port

            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.getWindowSize():
                # set window size
                self.win.set_size_request(*Config.getWindowSize())
                self.win.set_resizable(False)

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

        output_aspect_ratio = self.find_widget_recursive(
            self.win, 'output_aspect_ratio')
        output_aspect_ratio.props.ratio = Config.getVideoRatio()

        audio_box = self.find_widget_recursive(self.win, 'audio_box')

        # Setup Preview Controller
        self.video_previews = VideoPreviewsController(
            self.find_widget_recursive(self.win, 'preview_box'),
            audio_box,
            win=self.win,
            uibuilder=self
        )
        if Config.getPreviewsEnabled():
            for idx, source in enumerate(Config.getSources()):
                self.video_previews.addPreview(self, source,

                                               Port.SOURCES_PREVIEW + idx)