mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-07-31 09:19:16 +02:00
add delayed antenna change option
This commit is contained in:
+13
-9
@@ -103,6 +103,7 @@ const proxy = httpProxy.createProxyServer({
|
|||||||
|
|
||||||
let currentUsers = 0;
|
let currentUsers = 0;
|
||||||
let serialport;
|
let serialport;
|
||||||
|
let timeoutAntenna;
|
||||||
|
|
||||||
app.use(bodyParser.urlencoded({ extended: true }));
|
app.use(bodyParser.urlencoded({ extended: true }));
|
||||||
const sessionMiddleware = session({
|
const sessionMiddleware = session({
|
||||||
@@ -526,15 +527,18 @@ wss.on('connection', (ws, request) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Handle Antenna selection
|
// Handle Antenna selection
|
||||||
if (serverConfig.antennaNoUnsers === "1") {
|
if (timeoutAntenna) clearTimeout(timeoutAntenna);
|
||||||
output.write("Z0\n");
|
timeoutAntenna = setTimeout(() => {
|
||||||
} else if (serverConfig.antennaNoUnsers === "2") {
|
if (serverConfig.antennaNoUsers === "1") {
|
||||||
output.write("Z1\n");
|
output.write("Z0\n");
|
||||||
} else if (serverConfig.antennaNoUnsers === "3") {
|
} else if (serverConfig.antennaNoUsers === "2") {
|
||||||
output.write("Z2\n");
|
output.write("Z1\n");
|
||||||
} else if (serverConfig.antennaNoUnsers === "4") {
|
} else if (serverConfig.antennaNoUsers === "3") {
|
||||||
output.write("Z3\n");
|
output.write("Z2\n");
|
||||||
}
|
} else if (serverConfig.antennaNoUsers === "4") {
|
||||||
|
output.write("Z3\n");
|
||||||
|
}
|
||||||
|
}, serverConfig.antennaNoUsersDelay ? 15000 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tunerLockTracker.has(ws)) {
|
if (tunerLockTracker.has(ws)) {
|
||||||
|
|||||||
@@ -115,7 +115,8 @@ let serverConfig = {
|
|||||||
stereoStartup: "0",
|
stereoStartup: "0",
|
||||||
stereoNoUsers: "0",
|
stereoNoUsers: "0",
|
||||||
antennaStartup: "0",
|
antennaStartup: "0",
|
||||||
antennaNoUnsers: "0"
|
antennaNoUsers: "0",
|
||||||
|
antennaNoUsersDelay: false
|
||||||
};
|
};
|
||||||
|
|
||||||
// Function to add missing fields without overwriting existing values
|
// Function to add missing fields without overwriting existing values
|
||||||
|
|||||||
+6
-4
@@ -227,7 +227,7 @@
|
|||||||
<p>Legacy option for Linux / macOS that could resolve audio issues, but will consume additional CPU and RAM usage.</p>
|
<p>Legacy option for Linux / macOS that could resolve audio issues, but will consume additional CPU and RAM usage.</p>
|
||||||
<%- include('_components', {component: 'checkbox', cssClass: '', label: 'Additional FFmpeg', id: 'audio-ffmpeg'}) %>
|
<%- include('_components', {component: 'checkbox', cssClass: '', label: 'Additional FFmpeg', id: 'audio-ffmpeg'}) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-50 p-botom-20 bottom-20">
|
<div class="panel-50 p-bottom-20 bottom-20">
|
||||||
<h3>Sample rate offset</h3>
|
<h3>Sample rate offset</h3>
|
||||||
<p>Using a negative value could eliminate audio buffering issues during long periods of listening. <br>
|
<p>Using a negative value could eliminate audio buffering issues during long periods of listening. <br>
|
||||||
However, a value that’s too low might increase the buffer over time.</p>
|
However, a value that’s too low might increase the buffer over time.</p>
|
||||||
@@ -479,7 +479,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
<div class="panel-100-real p-bottom-20 bottom-20" style="z-index: 9; padding-bottom: 160px;">
|
<div class="panel-100-real p-bottom-20 bottom-20" style="z-index: 9; padding-bottom: 180px;">
|
||||||
<h3>On no active users</h3>
|
<h3>On no active users</h3>
|
||||||
<h4>Settings take effect immediately after saving</h4>
|
<h4>Settings take effect immediately after saving</h4>
|
||||||
<div class="flex-container flex-center p-20">
|
<div class="flex-container flex-center p-20">
|
||||||
@@ -530,7 +530,8 @@
|
|||||||
}) %><br>
|
}) %><br>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-100-real p-bottom-20 no-bg">
|
<div class="panel-100-real p-bottom-20 no-bg">
|
||||||
<%- include('_components', { component: 'dropdown', id: 'antennaNoUnsers-dropdown', inputId: 'antennaNoUnsers', label: 'Antenna', cssClass: '', placeholder: 'Unchanged',
|
<%- include('_components', {component: 'checkbox', cssClass: '', label: 'Delayed Antenna Change', id: 'antennaNoUsersDelay'}) %><br>
|
||||||
|
<%- include('_components', { component: 'dropdown', id: 'antennaNoUsers-dropdown', inputId: 'antennaNoUsers', label: 'Antenna', cssClass: '', placeholder: 'Unchanged',
|
||||||
options: [
|
options: [
|
||||||
{ value: '0', label: 'Unchanged' },
|
{ value: '0', label: 'Unchanged' },
|
||||||
{ value: '1', label: 'Antenna 0' },
|
{ value: '1', label: 'Antenna 0' },
|
||||||
@@ -538,7 +539,8 @@
|
|||||||
{ value: '3', label: 'Antenna 2' },
|
{ value: '3', label: 'Antenna 2' },
|
||||||
{ value: '4', label: 'Antenna 3' },
|
{ value: '4', label: 'Antenna 3' },
|
||||||
]
|
]
|
||||||
}) %><br>
|
}) %>
|
||||||
|
<br>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user