Set default volume

This commit is contained in:
Keith Edmunds 2021-05-02 23:34:03 +01:00
parent 3a7d332649
commit ada25eaa26
3 changed files with 7 additions and 3 deletions

View File

@ -34,7 +34,7 @@ class Config(object):
ROOT = "/home/kae/music"
TESTMODE = True
TIMER_MS = 500
VOLUME_VLC_MAX = 80
VOLUME_VLC_DEFAULT = 81
config = Config

View File

@ -14,13 +14,13 @@ class Music:
Manage the playing of music tracks
"""
def __init__(self, max_volume=100):
def __init__(self):
self.current_track_start_time = None
self.fading = False
self.VLC = vlc.Instance()
self.player = None
self.track_path = None
self.max_volume = max_volume
self.max_volume = Config.VOLUME_VLC_DEFAULT
def fade(self):
"""
@ -127,6 +127,9 @@ class Music:
def set_volume(self, volume):
"Set maximum volume used for player"
if not self.player:
return
self.max_volume = volume
self.player.audio_set_volume(volume)

View File

@ -49,6 +49,7 @@ class Window(QMainWindow, Ui_MainWindow):
self.next_track = None
self.previous_track = None
self.previous_track_position = None
self.spnVolume.setValue(Config.VOLUME_VLC_DEFAULT)
self.menuTest.menuAction().setVisible(Config.TESTMODE)
self.set_main_window_size()