summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--config.toml21
-rw-r--r--switcher.py10
3 files changed, 23 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore
index f7275bb..39882e8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,5 @@
+*.swp
+*.swo
+__pycache__/
venv/
+env/
diff --git a/config.toml b/config.toml
index 4e3f0ea..31289ab 100644
--- a/config.toml
+++ b/config.toml
@@ -1,15 +1,18 @@
[atem]
-ip = '10.73.96.40'
-video_mode = '1080p50'
+ip = "10.73.4.40"
+video_mode = "1080p25"
-[atem.settings]
+[atem.settings.inputs]
+hdmi1 = "Laptop"
+hdmi2 = "Kamera"
+hdmi3 = "VGA"
+hdmi4 = "Infobeamer"
+[gtk-settings]
+gtk-application-prefer-dark-theme = true
+gtk-theme-name = "Adwaita"
[logging]
-# see https://docs.python.org/3/library/logging.html#levels
-level = 10
-format = '%(name)25s [%(levelname)-8s] %(message)s'
+format = "%(name)25s [%(levelname)-8s] %(message)s"
+level = "DEBUG"
-[gtk-settings]
-gtk-theme-name = "Adwaita"
-gtk-application-prefer-dark-theme = true
diff --git a/switcher.py b/switcher.py
index c025ce7..6454850 100644
--- a/switcher.py
+++ b/switcher.py
@@ -63,9 +63,6 @@ class PyATEMSwitcher:
def _push_config(self):
conf = self.config.get('settings', {})
-
- # TODO setInputLongName
- # TODO setInputShortName
# TODO media upload to MP1
if 'video_mode' in self.config:
@@ -75,6 +72,13 @@ class PyATEMSwitcher:
)
if self.atem.videoMode.format != video_mode:
self.atem.setVideoModeFormat(video_mode)
+
+ if conf.get('inputs', None):
+ for i in range(1,5):
+ input_name = conf['inputs'][f'hdmi{i}']
+ self.log.debug(f"setting input {i} to name '{input_name}'")
+ self.atem.setInputLongName(i, input_name)
+ self.atem.setInputShortName(i, input_name[0:3])
def _validate_config(self):
if 'ip' not in self.config: