WIP V3: Use config settings for warning timers

This commit is contained in:
Keith Edmunds 2023-11-13 21:22:05 +00:00
parent 0d2dad9f3c
commit d2254b6ddd
2 changed files with 5 additions and 3 deletions

View File

@ -96,4 +96,6 @@ class Config(object):
TRACK_TIME_FORMAT = "%H:%M:%S"
VOLUME_VLC_DEFAULT = 75
VOLUME_VLC_DROP3db = 65
WARNING_MS_BEFORE_FADE = 5500
WARNING_MS_BEFORE_SILENCE = 5500
WEB_ZOOM_FACTOR = 1.2

View File

@ -1597,7 +1597,7 @@ class Window(QMainWindow, Ui_MainWindow):
self.lblTOD.setText(datetime.now().strftime(Config.TOD_TIME_FORMAT))
# Update carts
self.cart_tick()
# self.cart_tick()
def tick_1000ms(self) -> None:
"""
@ -1643,7 +1643,7 @@ class Window(QMainWindow, Ui_MainWindow):
# If silent in the next 5 seconds, put warning colour on
# time to silence box and enable play controls
if time_to_silence <= 5500:
if time_to_silence <= Config.WARNING_MS_BEFORE_SILENCE:
css_silence = f"background: {Config.COLOUR_ENDING_TIMER}"
if self.frame_silent.styleSheet() != css_silence:
self.frame_silent.setStyleSheet(css_silence)
@ -1655,7 +1655,7 @@ class Window(QMainWindow, Ui_MainWindow):
self.frame_silent.setStyleSheet(css_fade)
# Five seconds before fade starts, set warning colour on
# time to silence box and enable play controls
elif time_to_fade <= 5500:
elif time_to_fade <= Config.WARNING_MS_BEFORE_FADE:
self.frame_fade.setStyleSheet(
f"background: {Config.COLOUR_WARNING_TIMER}"
)