Skip to content

Commit

Permalink
Fades are working! Wahoooo
Browse files Browse the repository at this point in the history
  • Loading branch information
btelliot committed Jan 1, 2025
1 parent 597261b commit a6a9456
Show file tree
Hide file tree
Showing 5 changed files with 12,661 additions and 12,583 deletions.
13 changes: 13 additions & 0 deletions obplayer/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,20 @@ def validate_setting(self, setting_name, setting_value, settings=None):
):
return "station_override_passwords_invalid"

if setting_name == "fade_duration":
try:
fade_value = float(setting_value)
if fade_value < 0:
return "fade_duration_invalid"
if fade_value > 20:
return "fade_duration_too_long"
except ValueError:
return "fade_duration_not_numeric"

return None



"""
def set(self, setting_name, setting_value):
settings = {}
Expand All @@ -440,6 +452,7 @@ def check_defaults(self):
"audio_caps",
"audio/x-raw,channels=2,rate=44100,format=S16LE,layout=interleaved",
)
self.add_setting("fade_duration", "10.0", "float")
self.add_setting("audio_out_mode", "auto", "text")
self.add_setting("audio_out_alsa_device", "default", "text")
self.add_setting("audio_out_jack_name", "", "text")
Expand Down
Loading

0 comments on commit a6a9456

Please sign in to comment.