summaryrefslogtreecommitdiff
path: root/window.py
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2025-06-16 21:50:38 -0500
committerTim Keller <tjk@tjkeller.xyz>2025-06-16 21:50:38 -0500
commitb8df4605b42d9a61bb4ae4731efabbdc38166063 (patch)
treed0044ca3c47c00442d15a99da6e309c08601b99e /window.py
parentcd1657ece1fa199964abd6544b81b394ab9369aa (diff)
downloadimmich-frame-b8df4605b42d9a61bb4ae4731efabbdc38166063.tar.xz
immich-frame-b8df4605b42d9a61bb4ae4731efabbdc38166063.zip
add config and add application thread manager
Diffstat (limited to 'window.py')
-rw-r--r--window.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/window.py b/window.py
index 1523f85..f422381 100644
--- a/window.py
+++ b/window.py
@@ -5,7 +5,7 @@ from time import time
from queue import Queue
from renderer import ImageRenderer, TransitionMix
-
+from manager import PixMan
class PixDisplay:
def __init__(self, textures):
@@ -18,13 +18,14 @@ class PixDisplay:
self.renderer = None
self.win_w = 0
self.win_h = 0
- self.max_framerate = 30
- self.image_duration = 2.0
- self.transition_duration = 0.5
- self.auto_transition = True
- self.transition_reverse = False
+ config = PixMan().config
+ self.max_framerate = config.max_framerate
+ self.image_duration = config.image_duration
+ self.transition_duration = config.transition_duration
+ self.auto_transition = config.auto_transition
+ self.transition_reverse = False
self.text_prev = None
self.tex = None
@@ -33,12 +34,13 @@ class PixDisplay:
@property
def max_framerate(self):
- return self._max_fps
+ #return int(1000/int(1000/self.frame_time))
+ return self.frame_time
@max_framerate.setter
def max_framerate(self, max_fps):
self._max_fps = max_fps # This is just for the getter since otherwise e.g. int(1000/int(1000/60)) would round to 62
- self.frame_time = int(1000 / 60) # In ms
+ self.frame_time = int(1000 / max_fps) # In ms
def increment_texture_index(self, increment):
self.transition_reverse = increment < 0