diff --git a/source_modules/audio_source/src/main.cpp b/source_modules/audio_source/src/main.cpp index df4701e8..c2871b05 100644 --- a/source_modules/audio_source/src/main.cpp +++ b/source_modules/audio_source/src/main.cpp @@ -152,7 +152,6 @@ public: // Update samplerate from ID sampleRate = sampleRates[srId]; - core::setInputSampleRate(sampleRate); } private: @@ -232,6 +231,7 @@ private: if (SmGui::Combo(CONCAT("##_audio_dev_sel_", _this->name), &_this->devId, _this->devices.txt)) { std::string dev = _this->devices.key(_this->devId); _this->select(dev); + core::setInputSampleRate(_this->sampleRate); config.acquire(); config.conf["device"] = dev; config.release(true); @@ -253,6 +253,7 @@ private: if (SmGui::Button(CONCAT("Refresh##_audio_refr_", _this->name))) { _this->refresh(); _this->select(_this->selectedDevice); + core::setInputSampleRate(_this->sampleRate); } if (_this->running) { SmGui::EndDisabled(); } diff --git a/source_modules/hackrf_source/src/main.cpp b/source_modules/hackrf_source/src/main.cpp index abb4bcc5..bdd01cc8 100644 --- a/source_modules/hackrf_source/src/main.cpp +++ b/source_modules/hackrf_source/src/main.cpp @@ -304,6 +304,7 @@ private: SmGui::ForceSync(); if (SmGui::Combo(CONCAT("##_hackrf_dev_sel_", _this->name), &_this->devId, _this->devListTxt.c_str())) { _this->selectBySerial(_this->devList[_this->devId]); + core::setInputSampleRate(_this->sampleRate); config.acquire(); config.conf["device"] = _this->selectedSerial; config.release(true); diff --git a/source_modules/hermes_source/src/main.cpp b/source_modules/hermes_source/src/main.cpp index 8bf82d3d..cd70c578 100644 --- a/source_modules/hermes_source/src/main.cpp +++ b/source_modules/hermes_source/src/main.cpp @@ -118,7 +118,6 @@ private: // Update host samplerate sampleRate = samplerates.key(srId); - core::setInputSampleRate(sampleRate); } static void menuSelected(void* ctx) { @@ -199,6 +198,7 @@ private: SmGui::ForceSync(); if (SmGui::Combo(CONCAT("##_hermes_dev_sel_", _this->name), &_this->devId, _this->devices.txt)) { _this->selectMac(_this->devices.key(_this->devId)); + core::setInputSampleRate(_this->sampleRate); if (!_this->selectedMac.empty()) { config.acquire(); config.conf["device"] = _this->devices.key(_this->devId); @@ -225,6 +225,7 @@ private: std::string mac = config.conf["device"]; config.release(); _this->selectMac(mac); + core::setInputSampleRate(_this->sampleRate); } if (_this->running) { SmGui::EndDisabled(); } diff --git a/source_modules/perseus_source/src/main.cpp b/source_modules/perseus_source/src/main.cpp index fa1b8869..a273e054 100644 --- a/source_modules/perseus_source/src/main.cpp +++ b/source_modules/perseus_source/src/main.cpp @@ -210,7 +210,6 @@ public: // Update samplerate sampleRate = srList[srId]; - core::setInputSampleRate(sampleRate); // Close device perseus_close(dev); @@ -329,6 +328,7 @@ private: if (SmGui::Combo(CONCAT("##_airspyhf_dev_sel_", _this->name), &_this->devId, _this->devList.txt)) { std::string serial = _this->devList.key(_this->devId); _this->select(serial); + core::setInputSampleRate(_this->sampleRate); config.acquire(); config.conf["device"] = serial; config.release(true); diff --git a/source_modules/plutosdr_source/src/main.cpp b/source_modules/plutosdr_source/src/main.cpp index c0af537c..e612af2e 100644 --- a/source_modules/plutosdr_source/src/main.cpp +++ b/source_modules/plutosdr_source/src/main.cpp @@ -244,9 +244,6 @@ private: bwId = 0; bandwidth = bandwidths.value(bwId); } - - // Update core samplerate - core::setInputSampleRate(samplerate); } static void menuSelected(void* ctx) { @@ -351,6 +348,7 @@ private: SmGui::ForceSync(); if (SmGui::Combo("##plutosdr_dev_sel", &_this->devId, _this->devices.txt)) { _this->select(_this->devices.key(_this->devId)); + core::setInputSampleRate(_this->samplerate); config.acquire(); config.conf["device"] = _this->devices.key(_this->devId); config.release(true); @@ -373,7 +371,7 @@ private: if (SmGui::Button(CONCAT("Refresh##_pluto_refr_", _this->name))) { _this->refresh(); _this->select(_this->devDesc); - + core::setInputSampleRate(_this->samplerate); } if (_this->running) { SmGui::EndDisabled(); } diff --git a/source_modules/rfnm_source/src/main.cpp b/source_modules/rfnm_source/src/main.cpp index c1d5d808..e213d47f 100644 --- a/source_modules/rfnm_source/src/main.cpp +++ b/source_modules/rfnm_source/src/main.cpp @@ -120,7 +120,6 @@ private: // Update samplerate sampleRate = samplerates.key(srId); - core::setInputSampleRate(sampleRate); // Save serial number selectedSerial = serial; @@ -226,6 +225,7 @@ private: if (SmGui::Combo(CONCAT("##_rfnm_dev_sel_", _this->name), &_this->devId, _this->devices.txt)) { // TODO: Select // TODO: Save + core::setInputSampleRate(_this->sampleRate); } if (SmGui::Combo(CONCAT("##_rfnm_sr_sel_", _this->name), &_this->srId, _this->samplerates.txt)) { @@ -240,6 +240,7 @@ private: if (SmGui::Button(CONCAT("Refresh##_rfnm_refr_", _this->name))) { _this->refresh(); _this->select(_this->selectedSerial); + core::setInputSampleRate(_this->sampleRate); } if (_this->running) { SmGui::EndDisabled(); } diff --git a/source_modules/sdrplay_source/src/main.cpp b/source_modules/sdrplay_source/src/main.cpp index 63f5f7c4..4170ba65 100644 --- a/source_modules/sdrplay_source/src/main.cpp +++ b/source_modules/sdrplay_source/src/main.cpp @@ -411,8 +411,6 @@ public: agcSetPoint = config.conf["devices"][selectedName]["agcSetPoint"]; } - core::setInputSampleRate(sampleRate); - // Per device options if (openDev.hwVer == SDRPLAY_RSP1_ID) { // No config to load @@ -688,6 +686,7 @@ private: SmGui::ForceSync(); if (SmGui::Combo(CONCAT("##sdrplay_dev", _this->name), &_this->devId, _this->devListTxt.c_str())) { _this->selectById(_this->devId); + core::setInputSampleRate(_this->sampleRate); config.acquire(); config.conf["device"] = _this->devNameList[_this->devId]; config.release(true); @@ -711,6 +710,7 @@ private: if (SmGui::Button(CONCAT("Refresh##sdrplay_refresh", _this->name))) { _this->refresh(); _this->selectByName(_this->selectedName); + core::setInputSampleRate(_this->sampleRate); } SmGui::LeftLabel("Bandwidth"); diff --git a/source_modules/spectran_source/src/main.cpp b/source_modules/spectran_source/src/main.cpp index 4be1b354..96d75c3d 100644 --- a/source_modules/spectran_source/src/main.cpp +++ b/source_modules/spectran_source/src/main.cpp @@ -194,7 +194,6 @@ public: // Set samplerate samplerate = sampleRateList.value(srId); - core::setInputSampleRate(samplerate.effective); // Close device AARTSAAPI_CloseDevice(&api, &dev); @@ -334,9 +333,10 @@ private: SmGui::FillWidth(); SmGui::ForceSync(); if (SmGui::Combo(CONCAT("##_spectran_dev_", _this->name), &_this->devId, _this->devList.txt)) { - + _this->selectSerial(_this->devList.key(_this->devId)); + core::setInputSampleRate(_this->samplerate.effective); } - // TODO: SR sel + if (SmGui::Combo(CONCAT("##_spectran_sr_", _this->name), &_this->srId, _this->sampleRateList.txt)) { _this->samplerate = _this->sampleRateList.value(_this->srId); core::setInputSampleRate(_this->samplerate.effective); diff --git a/source_modules/usrp_source/src/main.cpp b/source_modules/usrp_source/src/main.cpp index 07ac2a73..781b0579 100644 --- a/source_modules/usrp_source/src/main.cpp +++ b/source_modules/usrp_source/src/main.cpp @@ -211,7 +211,6 @@ public: // Apply samplerate sampleRate = samplerates.key(srId); - core::setInputSampleRate(sampleRate); } void setBandwidth(double bw) { @@ -335,6 +334,7 @@ private: SmGui::ForceSync(); if (SmGui::Combo(CONCAT("##_usrp_dev_sel_", _this->name), &_this->devId, _this->devices.txt)) { _this->select(_this->devices.key(_this->devId)); + core::setInputSampleRate(_this->sampleRate); if (!_this->selectedSer.empty()) { config.acquire(); config.conf["device"] = _this->devices.key(_this->devId); @@ -357,10 +357,8 @@ private: SmGui::ForceSync(); if (SmGui::Button(CONCAT("Refresh##_usrp_refr_", _this->name))) { _this->refresh(); - config.acquire(); - std::string ser = config.conf["device"]; - config.release(); - _this->select(ser); + _this->select(_this->selectedSer); + core::setInputSampleRate(_this->sampleRate); } if (_this->channels.size() > 1) {