| ${gpioEntry.group} | ${gpioEntry.name} | ${gpioEntry.gpio} | ${gpioEntry.fixed ? 'Fixed' : 'Configuration'} |
`
// );
// });
// }
// else {
// $('#pins').hide();
// }
}
function processSqueezeliteCommandLine(val: string) {
const parsed = parseSqueezeliteCommandLine(val);
if (parsed.output.toUpperCase().startsWith('I2S')) {
handleTemplateTypeRadio('i2s');
} else if (parsed.output.toUpperCase().startsWith('SPDIF')) {
handleTemplateTypeRadio('spdif');
} else if (parsed.output.toUpperCase().startsWith('BT')) {
if (parsed.otherOptions.btname) {
commandBTSinkName = parsed.otherOptions.btname;
}
handleTemplateTypeRadio('bt');
}
Object.keys(parsed.options).forEach(function (key) {
const option = parsed.options[key];
if (!$(`#cmd_opt_${key}`).hasOwnProperty('checked')) {
$(`#cmd_opt_${key}`).val(option);
} else {
if (typeof option === 'boolean') {
($(`#cmd_opt_${key}`)[0] as HTMLInputElement).checked = option;
}
}
});
if (parsed.options.hasOwnProperty('u')) {
// parse -u v[:i] and check the appropriate radio button with id #resample_v
const [resampleValue, resampleInterpolation] = parsed.options.u.split(':');
$(`#resample_${resampleValue}`).prop('checked', true);
// if resampleinterpolation is set, check resample_i checkbox
if (resampleInterpolation) {
$('#resample_i').prop('checked', true);
}
}
if (parsed.options.hasOwnProperty('s')) {
// parse -u v[:i] and check the appropriate radio button with id #resample_v
if (parsed.options.s === '-disable') {
($('#disable-squeezelite')[0] as HTMLInputElement).checked = true;
}
else {
($('#disable-squeezelite')[0] as HTMLInputElement).checked = false;
}
}
}
function inRange(x: number, min: number, max: number) {
return (x - min) * (x - max) <= 0;
}
function sleep(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));
}