From d2254b6ddd6217d260c832546c4f3055bf844b78 Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Mon, 13 Nov 2023 21:22:05 +0000 Subject: [PATCH] WIP V3: Use config settings for warning timers --- app/config.py | 2 ++ app/musicmuster.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/config.py b/app/config.py index 38d60a3..e421b78 100644 --- a/app/config.py +++ b/app/config.py @@ -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 diff --git a/app/musicmuster.py b/app/musicmuster.py index 1349e66..d5a736a 100755 --- a/app/musicmuster.py +++ b/app/musicmuster.py @@ -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}" )