more fixes

This commit is contained in:
Ryzerth
2020-12-04 20:12:36 +01:00
parent 9805e4a395
commit 92b77904f6
11 changed files with 52 additions and 26 deletions

View File

@ -114,24 +114,24 @@ private:
ImGui::EndGroup();
ImGui::Text("WFM Deemphasis");
ImGui::SameLine();
ImGui::PushItemWidth(menuColumnWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##_deemp_select_", _this->name), &_this->deemp, DEEMP_LIST)) {
_this->sigPath.setDeemphasis(_this->deemp);
if (_this->demod == 1) {
ImGui::Text("WFM Deemphasis");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuColumnWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##_deemp_select_", _this->name), &_this->deemp, DEEMP_LIST)) {
_this->sigPath.setDeemphasis(_this->deemp);
}
}
ImGui::PopItemWidth();
ImGui::Text("Bandwidth");
ImGui::SameLine();
ImGui::PushItemWidth(menuColumnWidth - ImGui::GetCursorPosX());
ImGui::SetNextItemWidth(menuColumnWidth - ImGui::GetCursorPosX());
if (ImGui::InputInt(CONCAT("##_bw_select_", _this->name), &_this->bandWidth, 100, 1000)) {
_this->bandWidth = std::clamp<int>(_this->bandWidth, _this->bandWidthMin, _this->bandWidthMax);
_this->sigPath.setBandwidth(_this->bandWidth);
}
ImGui::PopItemWidth();
ImGui::Text("Snap Interval");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuColumnWidth - ImGui::GetCursorPosX());

View File

@ -84,12 +84,15 @@ void SigPath::setDemodulator(int demId, float bandWidth) {
amDemod.stop();
}
else if (_demod == DEMOD_USB) {
agc.stop();
ssbDemod.stop();
}
else if (_demod == DEMOD_LSB) {
agc.stop();
ssbDemod.stop();
}
else if (_demod == DEMOD_DSB) {
agc.stop();
ssbDemod.stop();
}
else {
@ -139,6 +142,7 @@ void SigPath::setDemodulator(int demId, float bandWidth) {
else if (demId == DEMOD_AM) {
demodOutputSamplerate = 125000;
vfo->setSampleRate(12500, bandwidth);
agc.setInput(&amDemod.out);
audioResamp.setInput(&agc.out);
audioBw = std::min<float>(bandwidth, outputSampleRate / 2.0f);
@ -157,7 +161,8 @@ void SigPath::setDemodulator(int demId, float bandWidth) {
demodOutputSamplerate = 6000;
vfo->setSampleRate(6000, bandwidth);
ssbDemod.setMode(dsp::SSBDemod::MODE_USB);
audioResamp.setInput(&ssbDemod.out);
agc.setInput(&ssbDemod.out);
audioResamp.setInput(&agc.out);
audioBw = std::min<float>(bandwidth, outputSampleRate / 2.0f);
audioResamp.setInSampleRate(6000);
@ -168,13 +173,15 @@ void SigPath::setDemodulator(int demId, float bandWidth) {
deemp.bypass = true;
vfo->setReference(ImGui::WaterfallVFO::REF_LOWER);
agc.start();
ssbDemod.start();
}
else if (demId == DEMOD_LSB) {
demodOutputSamplerate = 6000;
vfo->setSampleRate(6000, bandwidth);
ssbDemod.setMode(dsp::SSBDemod::MODE_LSB);
audioResamp.setInput(&ssbDemod.out);
agc.setInput(&ssbDemod.out);
audioResamp.setInput(&agc.out);
audioBw = std::min<float>(bandwidth, outputSampleRate / 2.0f);
audioResamp.setInSampleRate(6000);
@ -185,13 +192,15 @@ void SigPath::setDemodulator(int demId, float bandWidth) {
deemp.bypass = true;
vfo->setReference(ImGui::WaterfallVFO::REF_UPPER);
agc.start();
ssbDemod.start();
}
else if (demId == DEMOD_DSB) {
demodOutputSamplerate = 6000;
vfo->setSampleRate(6000, bandwidth);
ssbDemod.setMode(dsp::SSBDemod::MODE_DSB);
audioResamp.setInput(&ssbDemod.out);
agc.setInput(&ssbDemod.out);
audioResamp.setInput(&agc.out);
audioBw = std::min<float>(bandwidth, outputSampleRate / 2.0f);
audioResamp.setInSampleRate(6000);
@ -202,6 +211,7 @@ void SigPath::setDemodulator(int demId, float bandWidth) {
deemp.bypass = true;
vfo->setReference(ImGui::WaterfallVFO::REF_CENTER);
agc.start();
ssbDemod.start();
}
else {