Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Volume goes below or above threshold #429

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pikaraoke/karaoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,9 @@ def volume_change(self, vol_level):

def vol_up(self):
self.volume += 0.1
if self.volume > 1.0:
self.volume = 1.0
logging.debug("max volume reached.")
logging.debug(f"Increasing volume by 10%: {self.volume}")
if self.is_file_playing():
self.now_playing_command = "vol_up"
Expand All @@ -686,6 +689,9 @@ def vol_up(self):

def vol_down(self):
self.volume -= 0.1
if self.volume < 0:
self.volume = 0
logging.debug("minimum volume reached.")
logging.debug(f"Decreasing volume by 10%: {self.volume}")
if self.is_file_playing():
self.now_playing_command = "vol_down"
Expand Down
Loading