File: camera.py

package info (click to toggle)
pyatem 0.13.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,776 kB
  • sloc: python: 15,193; xml: 435; ansic: 256; sh: 26; makefile: 20
file content (42 lines) | stat: -rw-r--r-- 1,458 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Copyright 2021 - 2022, Martijn Braam and the OpenAtem contributors
# SPDX-License-Identifier: GPL-3.0-only
import gi

from gtk_switcher.colorwheel import ColorWheelWidget
from pyatem.field import InputPropertiesField

gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GLib, GObject, Gio, Gdk

gi.require_version('Handy', '1')
from gi.repository import Handy


class CameraPage:
    def __init__(self, builder):
        self.camera_box = builder.get_object('camera_box')

    def on_camera_layout_change(self, data):
        inputs = self.connection.mixer.mixerstate['input-properties']

        for child in self.camera_box:
            child.destroy()

        for i in inputs.values():
            if i.port_type == InputPropertiesField.PORT_EXTERNAL:
                box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
                box.set_spacing(8)
                label = Gtk.Label(i.name)
                label.get_style_context().add_class('heading')
                box.pack_start(label, False, True, 0)
                camera_frame = Gtk.Frame()
                camera_frame.get_style_context().add_class('view')
                box.pack_start(camera_frame, True, True, 0)
                self.camera_box.pack_start(box, True, True, 0)

                grid = Gtk.Grid()
                grid.set_row_spacing(8)
                grid.set_column_spacing(8)
                camera_frame.add(grid)

        self.camera_box.show_all()