Switched the place of the Sample rate and IF mode combos

This commit is contained in:
AlexandreRouma 2021-08-30 15:53:41 +02:00 committed by GitHub
parent e101c1ebd7
commit 7c1d1cad22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -681,26 +681,6 @@ private:
config.conf["device"] = _this->devNameList[_this->devId];
config.release(true);
}
ImGui::Text("IF Mode");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##sdrplay_ifmode", _this->name), &_this->ifModeId, ifModeTxt)) {
if(_this->ifModeId != 0){
_this->bandwidth = ifModes[_this->ifModeId].bw;
_this->sampleRate = ifModes[_this->ifModeId].effectiveSamplerate;
} else {
config.acquire();
_this->sampleRate = config.conf["devices"][_this->selectedName]["sampleRate"];
_this->bandwidthId = config.conf["devices"][_this->selectedName]["bwMode"];
config.release(false);
_this->bandwidth = (_this->bandwidthId == 8) ? preferedBandwidth[_this->srId] : bandwidths[_this->bandwidthId];
}
core::setInputSampleRate(_this->sampleRate);
config.acquire();
config.conf["devices"][_this->selectedName]["ifModeId"] = _this->ifModeId;
config.release(true);
}
if (_this->ifModeId == 0) {
if (ImGui::Combo(CONCAT("##sdrplay_sr", _this->name), &_this->srId, sampleRatesTxt)) {
@ -733,6 +713,26 @@ private:
config.release(true);
}
}
ImGui::Text("IF Mode");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##sdrplay_ifmode", _this->name), &_this->ifModeId, ifModeTxt)) {
if(_this->ifModeId != 0){
_this->bandwidth = ifModes[_this->ifModeId].bw;
_this->sampleRate = ifModes[_this->ifModeId].effectiveSamplerate;
} else {
config.acquire();
_this->sampleRate = config.conf["devices"][_this->selectedName]["sampleRate"];
_this->bandwidthId = config.conf["devices"][_this->selectedName]["bwMode"];
config.release(false);
_this->bandwidth = (_this->bandwidthId == 8) ? preferedBandwidth[_this->srId] : bandwidths[_this->bandwidthId];
}
core::setInputSampleRate(_this->sampleRate);
config.acquire();
config.conf["devices"][_this->selectedName]["ifModeId"] = _this->ifModeId;
config.release(true);
}
if (_this->running) { style::endDisabled(); }