Skip to content

Commit de27618

Browse files
committed
show fade-out setting in http admin (implementation todo still)
1 parent 5fb8164 commit de27618

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.3.0-20240601
1+
5.3.0-20250525

obplayer/data.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,16 @@ def validate_setting(self, setting_name, setting_value, settings=None):
425425
):
426426
return "station_override_passwords_invalid"
427427

428+
if setting_name == "fade_duration":
429+
try:
430+
fade_value = float(setting_value)
431+
if fade_value < 0:
432+
return "fade_duration_invalid"
433+
if fade_value > 20:
434+
return "fade_duration_too_long"
435+
except ValueError:
436+
return "fade_duration_not_numeric"
437+
428438
return None
429439

430440
"""
@@ -440,6 +450,7 @@ def check_defaults(self):
440450
"audio_caps",
441451
"audio/x-raw,channels=2,rate=44100,format=S16LE,layout=interleaved",
442452
)
453+
self.add_setting("fade_duration", "5.0", "float")
443454
self.add_setting("audio_out_mode", "auto", "text")
444455
self.add_setting("audio_out_alsa_device", "default", "text")
445456
self.add_setting("audio_out_jack_name", "", "text")

obplayer/httpadmin/http/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,6 +1368,17 @@ <h4>Sources List</h4>
13681368

13691369
<div style="display: none;" id="content-outputs" data-tns="Outputs Tab">
13701370

1371+
<h4 data-t>Show Fade Settings</h4>
1372+
1373+
<table class="settings">
1374+
<tbody>
1375+
<tr>
1376+
<td title="fade_duration_tooltip" data-t>fade_duration</td>
1377+
<td><input type="text" name="fade_duration" value="<%= obplayer.Config.setting('fade_duration', True) %>"></td>
1378+
</tr>
1379+
</tbody>
1380+
</table>
1381+
13711382
<h4 data-t>Audio Output Settings</h4>
13721383

13731384
<table class="settings">

obplayer/httpadmin/strings/default/outputs_tab.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Outputs Tab
33

44
Outputs: Outputs
55

6+
Show Fade Settings: Show Fade Settings
7+
fade_duration: Fade Out Duration (seconds)
8+
fade_duration_tooltip: End-of-show fade duration, if needed to prevent abrupt cut-off. 0 to disable.
9+
610
Audio Output Settings: Audio Output Settings
711

812
audio_out_mode: Audio Output Mode

0 commit comments

Comments
 (0)