fix demodulator buttons

This commit is contained in:
Jakob Ketterl 2019-05-14 23:36:37 +02:00
parent 9812d38eee
commit 5e67f036b4
1 changed files with 21 additions and 23 deletions

View File

@ -2526,29 +2526,27 @@ function progressbar_set(obj,val,text,over)
function demodulator_buttons_update()
{
$(".openwebrx-demodulator-button").removeClass("highlighted");
if(secondary_demod) $("#openwebrx-button-dig").addClass("highlighted");
else switch(demodulators[0].subtype)
{
case "nfm":
$("#openwebrx-button-nfm").addClass("highlighted");
break;
case "am":
$("#openwebrx-button-am").addClass("highlighted");
break;
case "lsb":
case "usb":
case "cw":
if(demodulators[0].high_cut-demodulators[0].low_cut<300)
$("#openwebrx-button-cw").addClass("highlighted");
else
{
if(demodulators[0].high_cut<0)
$("#openwebrx-button-lsb").addClass("highlighted");
else if(demodulators[0].low_cut>0)
$("#openwebrx-button-usb").addClass("highlighted");
else $("#openwebrx-button-lsb, #openwebrx-button-usb").addClass("highlighted");
}
break;
if(secondary_demod) {
$("#openwebrx-button-dig").addClass("highlighted");
} else switch(demodulators[0].subtype) {
case "lsb":
case "usb":
case "cw":
if(demodulators[0].high_cut-demodulators[0].low_cut<300)
$("#openwebrx-button-cw").addClass("highlighted");
else
{
if(demodulators[0].high_cut<0)
$("#openwebrx-button-lsb").addClass("highlighted");
else if(demodulators[0].low_cut>0)
$("#openwebrx-button-usb").addClass("highlighted");
else $("#openwebrx-button-lsb, #openwebrx-button-usb").addClass("highlighted");
}
break;
default:
var mod = demodulators[0].subtype;
$("#openwebrx-button-" + mod).addClass("highlighted");
break;
}
}
function demodulator_analog_replace_last() { demodulator_analog_replace(last_analog_demodulator_subtype); }