diff --git a/file_manager.py b/file_manager.py index 06af766..df8ea47 100644 --- a/file_manager.py +++ b/file_manager.py @@ -29,6 +29,14 @@ class FileManager: current_process().name = process_title terminator = Terminator() + + self.normalisation_mode = server_config.get()["normalisation_mode"] + + if self.normalisation_mode != "on": + self.logger.log.info("Normalisation is disabled.") + else: + self.logger.log.info("Normalisation is enabled.") + self.channel_count = len(channel_from_q) self.channel_received = None self.last_known_show_plan = [[]] * self.channel_count @@ -211,6 +219,10 @@ class FileManager: # If we've preloaded everything, get to work normalising tracks before playback. def do_normalise(self): + + if self.normalisation_mode != "on": + return False + # Some channels still have files to preload, do nothing. if self.known_channels_preloaded != [True] * self.channel_count: return False # Didn't normalise diff --git a/server.py b/server.py index 4734dd4..3987933 100644 --- a/server.py +++ b/server.py @@ -71,6 +71,7 @@ class BAPSicleServer: "myradio_api_tracklist_source": "", "running_state": "running", "tracklist_mode": "off", + "normalisation_mode": "off", } player_to_q: List[Queue] = [] diff --git a/ui-templates/config_server.html b/ui-templates/config_server.html index 6c9ee7f..18a2852 100644 --- a/ui-templates/config_server.html +++ b/ui-templates/config_server.html @@ -48,6 +48,16 @@ Delayed tracklisting is 20s, to account for cueing with fader down.
Fader Live means if a BAPS Controller is present with support, tracklists will trigger only if fader is up.

+ + +

+ Normalisation requests significant CPU requirements, if you're finding the CPU usuage is too high / causing audio glitches, disable this feature. ffmpeg or avconf required. +


diff --git a/web_server.py b/web_server.py index c1acdd7..955de46 100644 --- a/web_server.py +++ b/web_server.py @@ -196,6 +196,7 @@ def ui_config_server(request): "state": server_state.get(), "ser_ports": DeviceManager.getSerialPorts(), "tracklist_modes": ["off", "on", "delayed", "fader-live"], + "normalisation_modes": ["off", "on"], } return render_template("config_server.html", data=data) @@ -227,6 +228,7 @@ def ui_config_server_update(request): "myradio_api_tracklist_source") ) server_state.update("tracklist_mode", request.form.get("tracklist_mode")) + server_state.update("normalisation_mode", request.form.get("normalisation_mode")) return redirect("/restart")