mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-24 00:34:44 +01:00
fix source/samplerate selection bugs
This commit is contained in:
parent
ea0362b927
commit
a93bb9d468
@ -152,7 +152,6 @@ public:
|
|||||||
|
|
||||||
// Update samplerate from ID
|
// Update samplerate from ID
|
||||||
sampleRate = sampleRates[srId];
|
sampleRate = sampleRates[srId];
|
||||||
core::setInputSampleRate(sampleRate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -232,6 +231,7 @@ private:
|
|||||||
if (SmGui::Combo(CONCAT("##_audio_dev_sel_", _this->name), &_this->devId, _this->devices.txt)) {
|
if (SmGui::Combo(CONCAT("##_audio_dev_sel_", _this->name), &_this->devId, _this->devices.txt)) {
|
||||||
std::string dev = _this->devices.key(_this->devId);
|
std::string dev = _this->devices.key(_this->devId);
|
||||||
_this->select(dev);
|
_this->select(dev);
|
||||||
|
core::setInputSampleRate(_this->sampleRate);
|
||||||
config.acquire();
|
config.acquire();
|
||||||
config.conf["device"] = dev;
|
config.conf["device"] = dev;
|
||||||
config.release(true);
|
config.release(true);
|
||||||
@ -253,6 +253,7 @@ private:
|
|||||||
if (SmGui::Button(CONCAT("Refresh##_audio_refr_", _this->name))) {
|
if (SmGui::Button(CONCAT("Refresh##_audio_refr_", _this->name))) {
|
||||||
_this->refresh();
|
_this->refresh();
|
||||||
_this->select(_this->selectedDevice);
|
_this->select(_this->selectedDevice);
|
||||||
|
core::setInputSampleRate(_this->sampleRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_this->running) { SmGui::EndDisabled(); }
|
if (_this->running) { SmGui::EndDisabled(); }
|
||||||
|
@ -304,6 +304,7 @@ private:
|
|||||||
SmGui::ForceSync();
|
SmGui::ForceSync();
|
||||||
if (SmGui::Combo(CONCAT("##_hackrf_dev_sel_", _this->name), &_this->devId, _this->devListTxt.c_str())) {
|
if (SmGui::Combo(CONCAT("##_hackrf_dev_sel_", _this->name), &_this->devId, _this->devListTxt.c_str())) {
|
||||||
_this->selectBySerial(_this->devList[_this->devId]);
|
_this->selectBySerial(_this->devList[_this->devId]);
|
||||||
|
core::setInputSampleRate(_this->sampleRate);
|
||||||
config.acquire();
|
config.acquire();
|
||||||
config.conf["device"] = _this->selectedSerial;
|
config.conf["device"] = _this->selectedSerial;
|
||||||
config.release(true);
|
config.release(true);
|
||||||
|
@ -118,7 +118,6 @@ private:
|
|||||||
|
|
||||||
// Update host samplerate
|
// Update host samplerate
|
||||||
sampleRate = samplerates.key(srId);
|
sampleRate = samplerates.key(srId);
|
||||||
core::setInputSampleRate(sampleRate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void menuSelected(void* ctx) {
|
static void menuSelected(void* ctx) {
|
||||||
@ -199,6 +198,7 @@ private:
|
|||||||
SmGui::ForceSync();
|
SmGui::ForceSync();
|
||||||
if (SmGui::Combo(CONCAT("##_hermes_dev_sel_", _this->name), &_this->devId, _this->devices.txt)) {
|
if (SmGui::Combo(CONCAT("##_hermes_dev_sel_", _this->name), &_this->devId, _this->devices.txt)) {
|
||||||
_this->selectMac(_this->devices.key(_this->devId));
|
_this->selectMac(_this->devices.key(_this->devId));
|
||||||
|
core::setInputSampleRate(_this->sampleRate);
|
||||||
if (!_this->selectedMac.empty()) {
|
if (!_this->selectedMac.empty()) {
|
||||||
config.acquire();
|
config.acquire();
|
||||||
config.conf["device"] = _this->devices.key(_this->devId);
|
config.conf["device"] = _this->devices.key(_this->devId);
|
||||||
@ -225,6 +225,7 @@ private:
|
|||||||
std::string mac = config.conf["device"];
|
std::string mac = config.conf["device"];
|
||||||
config.release();
|
config.release();
|
||||||
_this->selectMac(mac);
|
_this->selectMac(mac);
|
||||||
|
core::setInputSampleRate(_this->sampleRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_this->running) { SmGui::EndDisabled(); }
|
if (_this->running) { SmGui::EndDisabled(); }
|
||||||
|
@ -210,7 +210,6 @@ public:
|
|||||||
|
|
||||||
// Update samplerate
|
// Update samplerate
|
||||||
sampleRate = srList[srId];
|
sampleRate = srList[srId];
|
||||||
core::setInputSampleRate(sampleRate);
|
|
||||||
|
|
||||||
// Close device
|
// Close device
|
||||||
perseus_close(dev);
|
perseus_close(dev);
|
||||||
@ -329,6 +328,7 @@ private:
|
|||||||
if (SmGui::Combo(CONCAT("##_airspyhf_dev_sel_", _this->name), &_this->devId, _this->devList.txt)) {
|
if (SmGui::Combo(CONCAT("##_airspyhf_dev_sel_", _this->name), &_this->devId, _this->devList.txt)) {
|
||||||
std::string serial = _this->devList.key(_this->devId);
|
std::string serial = _this->devList.key(_this->devId);
|
||||||
_this->select(serial);
|
_this->select(serial);
|
||||||
|
core::setInputSampleRate(_this->sampleRate);
|
||||||
config.acquire();
|
config.acquire();
|
||||||
config.conf["device"] = serial;
|
config.conf["device"] = serial;
|
||||||
config.release(true);
|
config.release(true);
|
||||||
|
@ -244,9 +244,6 @@ private:
|
|||||||
bwId = 0;
|
bwId = 0;
|
||||||
bandwidth = bandwidths.value(bwId);
|
bandwidth = bandwidths.value(bwId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update core samplerate
|
|
||||||
core::setInputSampleRate(samplerate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void menuSelected(void* ctx) {
|
static void menuSelected(void* ctx) {
|
||||||
@ -351,6 +348,7 @@ private:
|
|||||||
SmGui::ForceSync();
|
SmGui::ForceSync();
|
||||||
if (SmGui::Combo("##plutosdr_dev_sel", &_this->devId, _this->devices.txt)) {
|
if (SmGui::Combo("##plutosdr_dev_sel", &_this->devId, _this->devices.txt)) {
|
||||||
_this->select(_this->devices.key(_this->devId));
|
_this->select(_this->devices.key(_this->devId));
|
||||||
|
core::setInputSampleRate(_this->samplerate);
|
||||||
config.acquire();
|
config.acquire();
|
||||||
config.conf["device"] = _this->devices.key(_this->devId);
|
config.conf["device"] = _this->devices.key(_this->devId);
|
||||||
config.release(true);
|
config.release(true);
|
||||||
@ -373,7 +371,7 @@ private:
|
|||||||
if (SmGui::Button(CONCAT("Refresh##_pluto_refr_", _this->name))) {
|
if (SmGui::Button(CONCAT("Refresh##_pluto_refr_", _this->name))) {
|
||||||
_this->refresh();
|
_this->refresh();
|
||||||
_this->select(_this->devDesc);
|
_this->select(_this->devDesc);
|
||||||
|
core::setInputSampleRate(_this->samplerate);
|
||||||
}
|
}
|
||||||
if (_this->running) { SmGui::EndDisabled(); }
|
if (_this->running) { SmGui::EndDisabled(); }
|
||||||
|
|
||||||
|
@ -120,7 +120,6 @@ private:
|
|||||||
|
|
||||||
// Update samplerate
|
// Update samplerate
|
||||||
sampleRate = samplerates.key(srId);
|
sampleRate = samplerates.key(srId);
|
||||||
core::setInputSampleRate(sampleRate);
|
|
||||||
|
|
||||||
// Save serial number
|
// Save serial number
|
||||||
selectedSerial = serial;
|
selectedSerial = serial;
|
||||||
@ -226,6 +225,7 @@ private:
|
|||||||
if (SmGui::Combo(CONCAT("##_rfnm_dev_sel_", _this->name), &_this->devId, _this->devices.txt)) {
|
if (SmGui::Combo(CONCAT("##_rfnm_dev_sel_", _this->name), &_this->devId, _this->devices.txt)) {
|
||||||
// TODO: Select
|
// TODO: Select
|
||||||
// TODO: Save
|
// TODO: Save
|
||||||
|
core::setInputSampleRate(_this->sampleRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SmGui::Combo(CONCAT("##_rfnm_sr_sel_", _this->name), &_this->srId, _this->samplerates.txt)) {
|
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))) {
|
if (SmGui::Button(CONCAT("Refresh##_rfnm_refr_", _this->name))) {
|
||||||
_this->refresh();
|
_this->refresh();
|
||||||
_this->select(_this->selectedSerial);
|
_this->select(_this->selectedSerial);
|
||||||
|
core::setInputSampleRate(_this->sampleRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_this->running) { SmGui::EndDisabled(); }
|
if (_this->running) { SmGui::EndDisabled(); }
|
||||||
|
@ -411,8 +411,6 @@ public:
|
|||||||
agcSetPoint = config.conf["devices"][selectedName]["agcSetPoint"];
|
agcSetPoint = config.conf["devices"][selectedName]["agcSetPoint"];
|
||||||
}
|
}
|
||||||
|
|
||||||
core::setInputSampleRate(sampleRate);
|
|
||||||
|
|
||||||
// Per device options
|
// Per device options
|
||||||
if (openDev.hwVer == SDRPLAY_RSP1_ID) {
|
if (openDev.hwVer == SDRPLAY_RSP1_ID) {
|
||||||
// No config to load
|
// No config to load
|
||||||
@ -688,6 +686,7 @@ private:
|
|||||||
SmGui::ForceSync();
|
SmGui::ForceSync();
|
||||||
if (SmGui::Combo(CONCAT("##sdrplay_dev", _this->name), &_this->devId, _this->devListTxt.c_str())) {
|
if (SmGui::Combo(CONCAT("##sdrplay_dev", _this->name), &_this->devId, _this->devListTxt.c_str())) {
|
||||||
_this->selectById(_this->devId);
|
_this->selectById(_this->devId);
|
||||||
|
core::setInputSampleRate(_this->sampleRate);
|
||||||
config.acquire();
|
config.acquire();
|
||||||
config.conf["device"] = _this->devNameList[_this->devId];
|
config.conf["device"] = _this->devNameList[_this->devId];
|
||||||
config.release(true);
|
config.release(true);
|
||||||
@ -711,6 +710,7 @@ private:
|
|||||||
if (SmGui::Button(CONCAT("Refresh##sdrplay_refresh", _this->name))) {
|
if (SmGui::Button(CONCAT("Refresh##sdrplay_refresh", _this->name))) {
|
||||||
_this->refresh();
|
_this->refresh();
|
||||||
_this->selectByName(_this->selectedName);
|
_this->selectByName(_this->selectedName);
|
||||||
|
core::setInputSampleRate(_this->sampleRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
SmGui::LeftLabel("Bandwidth");
|
SmGui::LeftLabel("Bandwidth");
|
||||||
|
@ -194,7 +194,6 @@ public:
|
|||||||
|
|
||||||
// Set samplerate
|
// Set samplerate
|
||||||
samplerate = sampleRateList.value(srId);
|
samplerate = sampleRateList.value(srId);
|
||||||
core::setInputSampleRate(samplerate.effective);
|
|
||||||
|
|
||||||
// Close device
|
// Close device
|
||||||
AARTSAAPI_CloseDevice(&api, &dev);
|
AARTSAAPI_CloseDevice(&api, &dev);
|
||||||
@ -334,9 +333,10 @@ private:
|
|||||||
SmGui::FillWidth();
|
SmGui::FillWidth();
|
||||||
SmGui::ForceSync();
|
SmGui::ForceSync();
|
||||||
if (SmGui::Combo(CONCAT("##_spectran_dev_", _this->name), &_this->devId, _this->devList.txt)) {
|
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)) {
|
if (SmGui::Combo(CONCAT("##_spectran_sr_", _this->name), &_this->srId, _this->sampleRateList.txt)) {
|
||||||
_this->samplerate = _this->sampleRateList.value(_this->srId);
|
_this->samplerate = _this->sampleRateList.value(_this->srId);
|
||||||
core::setInputSampleRate(_this->samplerate.effective);
|
core::setInputSampleRate(_this->samplerate.effective);
|
||||||
|
@ -211,7 +211,6 @@ public:
|
|||||||
|
|
||||||
// Apply samplerate
|
// Apply samplerate
|
||||||
sampleRate = samplerates.key(srId);
|
sampleRate = samplerates.key(srId);
|
||||||
core::setInputSampleRate(sampleRate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setBandwidth(double bw) {
|
void setBandwidth(double bw) {
|
||||||
@ -335,6 +334,7 @@ private:
|
|||||||
SmGui::ForceSync();
|
SmGui::ForceSync();
|
||||||
if (SmGui::Combo(CONCAT("##_usrp_dev_sel_", _this->name), &_this->devId, _this->devices.txt)) {
|
if (SmGui::Combo(CONCAT("##_usrp_dev_sel_", _this->name), &_this->devId, _this->devices.txt)) {
|
||||||
_this->select(_this->devices.key(_this->devId));
|
_this->select(_this->devices.key(_this->devId));
|
||||||
|
core::setInputSampleRate(_this->sampleRate);
|
||||||
if (!_this->selectedSer.empty()) {
|
if (!_this->selectedSer.empty()) {
|
||||||
config.acquire();
|
config.acquire();
|
||||||
config.conf["device"] = _this->devices.key(_this->devId);
|
config.conf["device"] = _this->devices.key(_this->devId);
|
||||||
@ -357,10 +357,8 @@ private:
|
|||||||
SmGui::ForceSync();
|
SmGui::ForceSync();
|
||||||
if (SmGui::Button(CONCAT("Refresh##_usrp_refr_", _this->name))) {
|
if (SmGui::Button(CONCAT("Refresh##_usrp_refr_", _this->name))) {
|
||||||
_this->refresh();
|
_this->refresh();
|
||||||
config.acquire();
|
_this->select(_this->selectedSer);
|
||||||
std::string ser = config.conf["device"];
|
core::setInputSampleRate(_this->sampleRate);
|
||||||
config.release();
|
|
||||||
_this->select(ser);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_this->channels.size() > 1) {
|
if (_this->channels.size() > 1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user