Settings to disable side-stepping center frequency and audio recording.

This commit is contained in:
Marat Fayzullin 2023-05-20 18:04:48 -04:00
parent 59380bd3f5
commit 15bcd0d3fb
3 changed files with 15 additions and 2 deletions

View File

@ -157,6 +157,8 @@ defaultConfig = PropertyLayer(
waterfall_auto_min_range=50,
ui_opacity=100,
ui_frame=False,
allow_center_freq_changes=False,
allow_audio_recording=True,
tuning_precision=2,
squelch_auto_margin=10,
google_maps_api_key="",

View File

@ -139,6 +139,8 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
"tuning_precision",
"ui_opacity",
"ui_frame",
"allow_center_freq_changes",
"allow_audio_recording",
]
def __init__(self, conn):
@ -297,8 +299,9 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
self.sdr.activateProfile(profile[1])
elif message["type"] == "setfrequency":
if "params" in message and "frequency" in message["params"]:
frequency = message["params"]["frequency"]
self.sdr.setCenterFreq(frequency)
if self.stack["allow_center_freq_changes"]:
frequency = message["params"]["frequency"]
self.sdr.setCenterFreq(frequency)
elif message["type"] == "connectionproperties":
if "params" in message:
self.connectionProperties = message["params"]

View File

@ -91,6 +91,14 @@ class GeneralSettingsController(SettingsFormController):
infotext="Specifies web page describing receiver usage policy "
+ "and shown when a client session times out.",
),
CheckboxInput(
"allow_center_freq_changes",
"Allow users to change center frequency",
),
CheckboxInput(
"allow_audio_recording",
"Allow users to record received audio",
),
),
Section(
"Receiver listings",