From b86f0ac1b7eea1291f73df83f6744cac9f970c0b Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Sun, 5 May 2024 17:52:38 +0100 Subject: [PATCH] Unifty format of VLC config variables --- app/config.py | 6 ++++-- app/music.py | 5 +++-- app/musicmuster.py | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/config.py b/app/config.py index 48f4706..0519444 100644 --- a/app/config.py +++ b/app/config.py @@ -89,8 +89,10 @@ class Config(object): TEXT_NO_TRACK_NO_NOTE = "[Section header]" TOD_TIME_FORMAT = "%H:%M:%S" TRACK_TIME_FORMAT = "%H:%M:%S" - VOLUME_VLC_DEFAULT = 75 - VOLUME_VLC_DROP3db = 65 + VLC_MAIN_PLAYER_NAME = "MusicMuster Main Player" + VLC_PREVIEW_PLAYER_NAME = "MusicMuster Preview Player" + VLC_VOLUME_DEFAULT = 75 + VLC_VOLUME_DROP3db = 65 WARNING_MS_BEFORE_FADE = 5500 WARNING_MS_BEFORE_SILENCE = 5500 WEB_ZOOM_FACTOR = 1.2 diff --git a/app/music.py b/app/music.py index 453eb24..18b6197 100644 --- a/app/music.py +++ b/app/music.py @@ -60,8 +60,9 @@ class Music: def __init__(self) -> None: self.VLC = vlc.Instance() + self.VLC.set_user_agent = (Config.VLC_MAIN_PLAYER_NAME, Config.VLC_MAIN_PLAYER_NAME) self.player = None - self.max_volume = Config.VOLUME_VLC_DEFAULT + self.max_volume = Config.VLC_VOLUME_DEFAULT self.start_dt: Optional[dt.datetime] = None def fade(self, fade_seconds: int = Config.FADEOUT_SECONDS) -> None: @@ -162,7 +163,7 @@ class Music: self.max_volume = volume if volume is None: - volume = Config.VOLUME_VLC_DEFAULT + volume = Config.VLC_VOLUME_DEFAULT self.player.audio_set_volume(volume) # Ensure volume correct diff --git a/app/musicmuster.py b/app/musicmuster.py index 1dcce5f..c26aefc 100755 --- a/app/musicmuster.py +++ b/app/musicmuster.py @@ -715,7 +715,7 @@ class Window(QMainWindow, Ui_MainWindow): """Drop music level by 3db if button checked""" if self.btnDrop3db.isChecked(): - self.music.set_volume(Config.VOLUME_VLC_DROP3db, set_default=False) + self.music.set_volume(Config.VLC_VOLUME_DROP3db, set_default=False) else: self.music.set_volume(Config.VOLUME_VLC_DEFAULT, set_default=False)