Added the ability to configure the volume step.

This commit is contained in:
GuardKenzie
2021-04-28 12:46:56 +00:00
parent da7655cf51
commit 2486c137de
2 changed files with 8 additions and 3 deletions

View File

@ -18,7 +18,8 @@ if "player" not in config.sections():
config["player"] = {"music_directory": "~/Music", config["player"] = {"music_directory": "~/Music",
"font_width": 11, "font_width": 11,
"font_height": 24, "font_height": 24,
"image_method": "pixcat" "image_method": "pixcat",
"volume_step": 5
} }
if "mpd" not in config.sections(): if "mpd" not in config.sections():
@ -75,6 +76,9 @@ MPDPORT = mpd_config.getint("port", 6600)
# What to use to draw images # What to use to draw images
IMAGEMETHOD = player_config.get("image_method", "pixcat") IMAGEMETHOD = player_config.get("image_method", "pixcat")
# Volume step
VOLUMESTEP = player_config.getint("volume_step", 5)
def albumArtSize(album_space, window_width): def albumArtSize(album_space, window_width):
""" """
@ -347,10 +351,10 @@ class Player:
self.client.pause() self.client.pause()
elif action == "volume_up": elif action == "volume_up":
self.client.volume("5") self.client.volume(str(VOLUMESTEP))
elif action == "volume_down": elif action == "volume_down":
self.client.volume("-5") self.client.volume(str(-VOLUMESTEP))
elif action == "quit": elif action == "quit":
raise KeyboardInterrupt raise KeyboardInterrupt

View File

@ -3,6 +3,7 @@ music_directory = ~/Music
font_width = 11 font_width = 11
font_height = 24 font_height = 24
image_method = pixcat image_method = pixcat
volume_step = 5
[mpd] [mpd]
host = localhost host = localhost