Made the file source set the frequency of the waterfall

This commit is contained in:
Ryzerth
2021-07-21 04:08:28 +02:00
parent 5f1a94c267
commit fb32b4d55a
7 changed files with 67 additions and 6 deletions

View File

@@ -173,6 +173,7 @@ void FrequencySelect::draw() {
for (int j = i; j < 12; j++) {
digits[j] = 0;
}
frequencyChanged = true;
}
if (ImGui::IsKeyPressed(GLFW_KEY_UP)) {
@@ -214,7 +215,15 @@ void FrequencySelect::draw() {
for (int i = 0; i < 12; i++) {
freq += digits[i] * pow(10, 11 - i);
}
frequency = freq;
uint64_t orig = freq;
freq = std::clamp<uint64_t>(freq, minFreq, maxFreq);
if (freq != orig && limitFreq) {
setFrequency(freq);
}
else {
frequency = orig;
}
ImGui::PopFont();