WIP V3: Use config settings for warning timers
This commit is contained in:
parent
0d2dad9f3c
commit
d2254b6ddd
@ -96,4 +96,6 @@ class Config(object):
|
|||||||
TRACK_TIME_FORMAT = "%H:%M:%S"
|
TRACK_TIME_FORMAT = "%H:%M:%S"
|
||||||
VOLUME_VLC_DEFAULT = 75
|
VOLUME_VLC_DEFAULT = 75
|
||||||
VOLUME_VLC_DROP3db = 65
|
VOLUME_VLC_DROP3db = 65
|
||||||
|
WARNING_MS_BEFORE_FADE = 5500
|
||||||
|
WARNING_MS_BEFORE_SILENCE = 5500
|
||||||
WEB_ZOOM_FACTOR = 1.2
|
WEB_ZOOM_FACTOR = 1.2
|
||||||
|
|||||||
@ -1597,7 +1597,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
self.lblTOD.setText(datetime.now().strftime(Config.TOD_TIME_FORMAT))
|
self.lblTOD.setText(datetime.now().strftime(Config.TOD_TIME_FORMAT))
|
||||||
# Update carts
|
# Update carts
|
||||||
self.cart_tick()
|
# self.cart_tick()
|
||||||
|
|
||||||
def tick_1000ms(self) -> None:
|
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
|
# If silent in the next 5 seconds, put warning colour on
|
||||||
# time to silence box and enable play controls
|
# 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}"
|
css_silence = f"background: {Config.COLOUR_ENDING_TIMER}"
|
||||||
if self.frame_silent.styleSheet() != css_silence:
|
if self.frame_silent.styleSheet() != css_silence:
|
||||||
self.frame_silent.setStyleSheet(css_silence)
|
self.frame_silent.setStyleSheet(css_silence)
|
||||||
@ -1655,7 +1655,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
self.frame_silent.setStyleSheet(css_fade)
|
self.frame_silent.setStyleSheet(css_fade)
|
||||||
# Five seconds before fade starts, set warning colour on
|
# Five seconds before fade starts, set warning colour on
|
||||||
# time to silence box and enable play controls
|
# 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(
|
self.frame_fade.setStyleSheet(
|
||||||
f"background: {Config.COLOUR_WARNING_TIMER}"
|
f"background: {Config.COLOUR_WARNING_TIMER}"
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user