diff --git a/radio/src/am_demod.h b/radio/src/am_demod.h index 9941b185..c6effcfc 100644 --- a/radio/src/am_demod.h +++ b/radio/src/am_demod.h @@ -131,6 +131,7 @@ public: ImGui::SameLine(); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); if (ImGui::InputFloat(("##_radio_am_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { + if (snapInterval < 1) { snapInterval = 1; } setSnapInterval(snapInterval); _config->aquire(); _config->conf[uiPrefix]["AM"]["snapInterval"] = snapInterval; diff --git a/radio/src/cw_demod.h b/radio/src/cw_demod.h index 53c9689b..d106a0f5 100644 --- a/radio/src/cw_demod.h +++ b/radio/src/cw_demod.h @@ -139,6 +139,7 @@ public: ImGui::SameLine(); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); if (ImGui::InputFloat(("##_radio_cw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { + if (snapInterval < 1) { snapInterval = 1; } setSnapInterval(snapInterval); _config->aquire(); _config->conf[uiPrefix]["CW"]["snapInterval"] = snapInterval; diff --git a/radio/src/dsb_demod.h b/radio/src/dsb_demod.h index 82051c8c..4f40227a 100644 --- a/radio/src/dsb_demod.h +++ b/radio/src/dsb_demod.h @@ -41,7 +41,7 @@ public: squelch.init(_vfo->output, squelchLevel); - demod.init(&squelch.out, bbSampRate, bandWidth, dsp::SSBDemod::MODE_DSB); + demod.init(&squelch.out, bbSampRate, bw, dsp::SSBDemod::MODE_DSB); agc.init(&demod.out, 20.0f, bbSampRate); @@ -131,6 +131,7 @@ public: ImGui::SameLine(); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); if (ImGui::InputFloat(("##_radio_dsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { + if (snapInterval < 1) { snapInterval = 1; } setSnapInterval(snapInterval); _config->aquire(); _config->conf[uiPrefix]["DSB"]["snapInterval"] = snapInterval; diff --git a/radio/src/fm_demod.h b/radio/src/fm_demod.h index 431421c9..ec9b889f 100644 --- a/radio/src/fm_demod.h +++ b/radio/src/fm_demod.h @@ -41,7 +41,7 @@ public: squelch.init(_vfo->output, squelchLevel); - demod.init(&squelch.out, bbSampRate, bandWidth / 2.0f); + demod.init(&squelch.out, bbSampRate, bw / 2.0f); float audioBW = std::min(audioSampleRate / 2.0f, bw / 2.0f); win.init(audioBW, audioBW, bbSampRate); @@ -127,6 +127,7 @@ public: ImGui::SameLine(); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); if (ImGui::InputFloat(("##_radio_fm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { + if (snapInterval < 1) { snapInterval = 1; } setSnapInterval(snapInterval); _config->aquire(); _config->conf[uiPrefix]["FM"]["snapInterval"] = snapInterval; diff --git a/radio/src/lsb_demod.h b/radio/src/lsb_demod.h index 3bf8bf49..065ebf26 100644 --- a/radio/src/lsb_demod.h +++ b/radio/src/lsb_demod.h @@ -41,7 +41,7 @@ public: squelch.init(_vfo->output, squelchLevel); - demod.init(&squelch.out, bbSampRate, bandWidth, dsp::SSBDemod::MODE_LSB); + demod.init(&squelch.out, bbSampRate, bw, dsp::SSBDemod::MODE_LSB); agc.init(&demod.out, 20.0f, bbSampRate); @@ -131,6 +131,7 @@ public: ImGui::SameLine(); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); if (ImGui::InputFloat(("##_radio_lsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { + if (snapInterval < 1) { snapInterval = 1; } setSnapInterval(snapInterval); _config->aquire(); _config->conf[uiPrefix]["LSB"]["snapInterval"] = snapInterval; diff --git a/radio/src/raw_demod.h b/radio/src/raw_demod.h index f22f29ed..df91d7fa 100644 --- a/radio/src/raw_demod.h +++ b/radio/src/raw_demod.h @@ -94,6 +94,7 @@ public: ImGui::SameLine(); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); if (ImGui::InputFloat(("##_radio_raw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { + if (snapInterval < 1) { snapInterval = 1; } setSnapInterval(snapInterval); _config->aquire(); _config->conf[uiPrefix]["RAW"]["snapInterval"] = snapInterval; diff --git a/radio/src/usb_demod.h b/radio/src/usb_demod.h index 55a7808b..94accd2d 100644 --- a/radio/src/usb_demod.h +++ b/radio/src/usb_demod.h @@ -41,7 +41,7 @@ public: squelch.init(_vfo->output, squelchLevel); - demod.init(&squelch.out, bbSampRate, bandWidth, dsp::SSBDemod::MODE_USB); + demod.init(&squelch.out, bbSampRate, bw, dsp::SSBDemod::MODE_USB); agc.init(&demod.out, 20.0f, bbSampRate); @@ -131,6 +131,7 @@ public: ImGui::SameLine(); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); if (ImGui::InputFloat(("##_radio_usb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { + if (snapInterval < 1) { snapInterval = 1; } setSnapInterval(snapInterval); _config->aquire(); _config->conf[uiPrefix]["USB"]["snapInterval"] = snapInterval; diff --git a/radio/src/wfm_demod.h b/radio/src/wfm_demod.h index 46a93120..9c9d0cb1 100644 --- a/radio/src/wfm_demod.h +++ b/radio/src/wfm_demod.h @@ -47,7 +47,7 @@ public: squelch.init(_vfo->output, squelchLevel); - demod.init(&squelch.out, bbSampRate, bandWidth / 2.0f); + demod.init(&squelch.out, bbSampRate, bw / 2.0f); float audioBW = std::min(audioSampleRate / 2.0f, 16000.0f); win.init(audioBW, audioBW, bbSampRate); @@ -140,6 +140,7 @@ public: ImGui::SameLine(); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); if (ImGui::InputFloat(("##_radio_wfm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { + if (snapInterval < 1) { snapInterval = 1; } setSnapInterval(snapInterval); _config->aquire(); _config->conf[uiPrefix]["WFM"]["snapInterval"] = snapInterval;