New features + waterfall code cleanup

This commit is contained in:
Ryzerth
2021-04-17 22:37:50 +02:00
parent d1e553f05a
commit d91934955b
18 changed files with 263 additions and 84 deletions

View File

@@ -80,6 +80,7 @@ public:
_vfo->setSampleRate(bbSampRate, bw);
_vfo->setSnapInterval(snapInterval);
_vfo->setReference(ImGui::WaterfallVFO::REF_CENTER);
_vfo->setBandwidthLimits(bwMin, bwMax, false);
}
void setVFO(VFOManager::VFO* vfo) {
@@ -126,6 +127,15 @@ public:
_config->conf[uiPrefix]["AM"]["bandwidth"] = bw;
_config->release(true);
}
if (running) {
if (_vfo->getBandwidthChanged()) {
bw = _vfo->getBandwidth();
setBandwidth(bw, false);
_config->aquire();
_config->conf[uiPrefix]["AM"]["bandwidth"] = bw;
_config->release(true);
}
}
ImGui::Text("Snap Interval");
ImGui::SameLine();
@@ -150,9 +160,9 @@ public:
}
private:
void setBandwidth(float bandWidth) {
void setBandwidth(float bandWidth, bool updateWaterfall = true) {
bw = bandWidth;
_vfo->setBandwidth(bw);
_vfo->setBandwidth(bw, updateWaterfall);
float audioBW = std::min<float>(audioSampRate / 2.0f, bw / 2.0f);
win.setSampleRate(bbSampRate * resamp.getInterpolation());
win.setCutoff(audioBW);