Fix typo aquire -> acquire

https://en.wiktionary.org/wiki/aquire
This commit is contained in:
Maxime Biette 2021-07-09 14:24:07 -04:00
parent 91c6823e0c
commit ac04432453
45 changed files with 234 additions and 234 deletions

View File

@ -46,7 +46,7 @@ public:
} }
// Select device from config // Select device from config
config.aquire(); config.acquire();
std::string devSerial = config.conf["device"]; std::string devSerial = config.conf["device"];
config.release(); config.release();
selectByString(devSerial); selectByString(devSerial);
@ -142,7 +142,7 @@ public:
selectedSerStr = std::string(buf); selectedSerStr = std::string(buf);
// Load config here // Load config here
config.aquire(); config.acquire();
bool created = false; bool created = false;
if (!config.conf["devices"].contains(selectedSerStr)) { if (!config.conf["devices"].contains(selectedSerStr)) {
created = true; created = true;
@ -323,7 +323,7 @@ private:
_this->selectBySerial(_this->devList[_this->devId]); _this->selectBySerial(_this->devList[_this->devId]);
core::setInputSampleRate(_this->sampleRate); core::setInputSampleRate(_this->sampleRate);
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["device"] = _this->selectedSerStr; config.conf["device"] = _this->selectedSerStr;
config.release(true); config.release(true);
} }
@ -333,7 +333,7 @@ private:
_this->sampleRate = _this->sampleRateList[_this->srId]; _this->sampleRate = _this->sampleRateList[_this->srId];
core::setInputSampleRate(_this->sampleRate); core::setInputSampleRate(_this->sampleRate);
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerStr]["sampleRate"] = _this->sampleRate; config.conf["devices"][_this->selectedSerStr]["sampleRate"] = _this->sampleRate;
config.release(true); config.release(true);
} }
@ -343,7 +343,7 @@ private:
float refreshBtnWdith = menuWidth - ImGui::GetCursorPosX(); float refreshBtnWdith = menuWidth - ImGui::GetCursorPosX();
if (ImGui::Button(CONCAT("Refresh##_airspy_refr_", _this->name), ImVec2(refreshBtnWdith, 0))) { if (ImGui::Button(CONCAT("Refresh##_airspy_refr_", _this->name), ImVec2(refreshBtnWdith, 0))) {
_this->refresh(); _this->refresh();
config.aquire(); config.acquire();
std::string devSerial = config.conf["device"]; std::string devSerial = config.conf["device"];
config.release(); config.release();
_this->selectByString(devSerial); _this->selectByString(devSerial);
@ -362,7 +362,7 @@ private:
airspy_set_sensitivity_gain(_this->openDev, _this->sensitiveGain); airspy_set_sensitivity_gain(_this->openDev, _this->sensitiveGain);
} }
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerStr]["gainMode"] = 0; config.conf["devices"][_this->selectedSerStr]["gainMode"] = 0;
config.release(true); config.release(true);
} }
@ -376,7 +376,7 @@ private:
airspy_set_linearity_gain(_this->openDev, _this->linearGain); airspy_set_linearity_gain(_this->openDev, _this->linearGain);
} }
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerStr]["gainMode"] = 1; config.conf["devices"][_this->selectedSerStr]["gainMode"] = 1;
config.release(true); config.release(true);
} }
@ -402,7 +402,7 @@ private:
airspy_set_vga_gain(_this->openDev, _this->vgaGain); airspy_set_vga_gain(_this->openDev, _this->vgaGain);
} }
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerStr]["gainMode"] = 2; config.conf["devices"][_this->selectedSerStr]["gainMode"] = 2;
config.release(true); config.release(true);
} }
@ -421,7 +421,7 @@ private:
airspy_set_sensitivity_gain(_this->openDev, _this->sensitiveGain); airspy_set_sensitivity_gain(_this->openDev, _this->sensitiveGain);
} }
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerStr]["sensitiveGain"] = _this->sensitiveGain; config.conf["devices"][_this->selectedSerStr]["sensitiveGain"] = _this->sensitiveGain;
config.release(true); config.release(true);
} }
@ -436,7 +436,7 @@ private:
airspy_set_linearity_gain(_this->openDev, _this->linearGain); airspy_set_linearity_gain(_this->openDev, _this->linearGain);
} }
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerStr]["linearGain"] = _this->linearGain; config.conf["devices"][_this->selectedSerStr]["linearGain"] = _this->linearGain;
config.release(true); config.release(true);
} }
@ -456,7 +456,7 @@ private:
airspy_set_lna_gain(_this->openDev, _this->lnaGain); airspy_set_lna_gain(_this->openDev, _this->lnaGain);
} }
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerStr]["lnaGain"] = _this->lnaGain; config.conf["devices"][_this->selectedSerStr]["lnaGain"] = _this->lnaGain;
config.release(true); config.release(true);
} }
@ -473,7 +473,7 @@ private:
airspy_set_mixer_gain(_this->openDev, _this->mixerGain); airspy_set_mixer_gain(_this->openDev, _this->mixerGain);
} }
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerStr]["mixerGain"] = _this->mixerGain; config.conf["devices"][_this->selectedSerStr]["mixerGain"] = _this->mixerGain;
config.release(true); config.release(true);
} }
@ -489,7 +489,7 @@ private:
airspy_set_vga_gain(_this->openDev, _this->vgaGain); airspy_set_vga_gain(_this->openDev, _this->vgaGain);
} }
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerStr]["vgaGain"] = _this->vgaGain; config.conf["devices"][_this->selectedSerStr]["vgaGain"] = _this->vgaGain;
config.release(true); config.release(true);
} }
@ -507,7 +507,7 @@ private:
} }
} }
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerStr]["lnaAgc"] = _this->lnaAgc; config.conf["devices"][_this->selectedSerStr]["lnaAgc"] = _this->lnaAgc;
config.release(true); config.release(true);
} }
@ -523,7 +523,7 @@ private:
} }
} }
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerStr]["mixerAgc"] = _this->mixerAgc; config.conf["devices"][_this->selectedSerStr]["mixerAgc"] = _this->mixerAgc;
config.release(true); config.release(true);
} }
@ -537,7 +537,7 @@ private:
airspy_set_rf_bias(_this->openDev, _this->biasT); airspy_set_rf_bias(_this->openDev, _this->biasT);
} }
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerStr]["biasT"] = _this->biasT; config.conf["devices"][_this->selectedSerStr]["biasT"] = _this->biasT;
config.release(true); config.release(true);
} }

View File

@ -42,7 +42,7 @@ public:
refresh(); refresh();
config.aquire(); config.acquire();
std::string devSerial = config.conf["device"]; std::string devSerial = config.conf["device"];
config.release(); config.release();
selectByString(devSerial); selectByString(devSerial);
@ -145,7 +145,7 @@ public:
selectedSerStr = std::string(buf); selectedSerStr = std::string(buf);
// Load config here // Load config here
config.aquire(); config.acquire();
bool created = false; bool created = false;
if (!config.conf["devices"].contains(selectedSerStr)) { if (!config.conf["devices"].contains(selectedSerStr)) {
created = true; created = true;
@ -276,7 +276,7 @@ private:
_this->selectBySerial(_this->devList[_this->devId]); _this->selectBySerial(_this->devList[_this->devId]);
core::setInputSampleRate(_this->sampleRate); core::setInputSampleRate(_this->sampleRate);
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["device"] = _this->selectedSerStr; config.conf["device"] = _this->selectedSerStr;
config.release(true); config.release(true);
} }
@ -286,7 +286,7 @@ private:
_this->sampleRate = _this->sampleRateList[_this->srId]; _this->sampleRate = _this->sampleRateList[_this->srId];
core::setInputSampleRate(_this->sampleRate); core::setInputSampleRate(_this->sampleRate);
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerStr]["sampleRate"] = _this->sampleRate; config.conf["devices"][_this->selectedSerStr]["sampleRate"] = _this->sampleRate;
config.release(true); config.release(true);
} }
@ -296,7 +296,7 @@ private:
float refreshBtnWdith = menuWidth - ImGui::GetCursorPosX(); float refreshBtnWdith = menuWidth - ImGui::GetCursorPosX();
if (ImGui::Button(CONCAT("Refresh##_airspyhf_refr_", _this->name), ImVec2(refreshBtnWdith, 0))) { if (ImGui::Button(CONCAT("Refresh##_airspyhf_refr_", _this->name), ImVec2(refreshBtnWdith, 0))) {
_this->refresh(); _this->refresh();
config.aquire(); config.acquire();
std::string devSerial = config.conf["device"]; std::string devSerial = config.conf["device"];
config.release(); config.release();
_this->selectByString(devSerial); _this->selectByString(devSerial);
@ -316,7 +316,7 @@ private:
} }
} }
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerStr]["agcMode"] = _this->agcMode; config.conf["devices"][_this->selectedSerStr]["agcMode"] = _this->agcMode;
config.release(true); config.release(true);
} }
@ -329,7 +329,7 @@ private:
airspyhf_set_hf_lna(_this->openDev, _this->hfLNA); airspyhf_set_hf_lna(_this->openDev, _this->hfLNA);
} }
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerStr]["lna"] = _this->hfLNA; config.conf["devices"][_this->selectedSerStr]["lna"] = _this->hfLNA;
config.release(true); config.release(true);
} }
@ -343,7 +343,7 @@ private:
airspyhf_set_hf_att(_this->openDev, _this->atten / 6.0f); airspyhf_set_hf_att(_this->openDev, _this->atten / 6.0f);
} }
if (_this->selectedSerStr != "") { if (_this->selectedSerStr != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerStr]["attenuation"] = _this->atten; config.conf["devices"][_this->selectedSerStr]["attenuation"] = _this->atten;
config.release(true); config.release(true);
} }

View File

@ -33,7 +33,7 @@ public:
bool created = false; bool created = false;
std::string device = ""; std::string device = "";
config.aquire(); config.acquire();
if (!config.conf.contains(_streamName)) { if (!config.conf.contains(_streamName)) {
created = true; created = true;
config.conf[_streamName]["device"] = ""; config.conf[_streamName]["device"] = "";
@ -95,7 +95,7 @@ public:
void selectById(int id) { void selectById(int id) {
devId = id; devId = id;
bool created = false; bool created = false;
config.aquire(); config.acquire();
if (!config.conf[_streamName]["devices"].contains(devList[id].name)) { if (!config.conf[_streamName]["devices"].contains(devList[id].name)) {
created = true; created = true;
config.conf[_streamName]["devices"][devList[id].name] = devList[id].preferredSampleRate; config.conf[_streamName]["devices"][devList[id].name] = devList[id].preferredSampleRate;
@ -138,7 +138,7 @@ public:
ImGui::SetNextItemWidth(menuWidth); ImGui::SetNextItemWidth(menuWidth);
if (ImGui::Combo(("##_audio_sink_dev_"+_streamName).c_str(), &devId, txtDevList.c_str())) { if (ImGui::Combo(("##_audio_sink_dev_"+_streamName).c_str(), &devId, txtDevList.c_str())) {
selectById(devId); selectById(devId);
config.aquire(); config.acquire();
config.conf[_streamName]["device"] = devList[devId].name; config.conf[_streamName]["device"] = devList[devId].name;
config.release(true); config.release(true);
} }
@ -151,7 +151,7 @@ public:
doStop(); doStop();
doStart(); doStart();
} }
config.aquire(); config.acquire();
config.conf[_streamName]["devices"][devList[devId].name] = sampleRate; config.conf[_streamName]["devices"][devList[devId].name] = sampleRate;
config.release(true); config.release(true);
} }

View File

@ -46,7 +46,7 @@ public:
refresh(); refresh();
// Select device here // Select device here
config.aquire(); config.acquire();
std::string serial = config.conf["device"]; std::string serial = config.conf["device"];
config.release(); config.release();
selectBySerial(serial); selectBySerial(serial);
@ -129,7 +129,7 @@ public:
// Load the channelId if there are more than 1 channel // Load the channelId if there are more than 1 channel
if (reloadChannelId) { if (reloadChannelId) {
config.aquire(); config.acquire();
if (channelCount > 1 && config.conf["devices"].contains(info->serial)) { if (channelCount > 1 && config.conf["devices"].contains(info->serial)) {
if (config.conf["devices"][info->serial].contains("channelId")) { if (config.conf["devices"][info->serial].contains("channelId")) {
chanId = config.conf["devices"][info->serial]["channelId"]; chanId = config.conf["devices"][info->serial]["channelId"];
@ -200,7 +200,7 @@ public:
} }
// Load settings here // Load settings here
config.aquire(); config.acquire();
if (!config.conf["devices"].contains(selectedSerial)) { if (!config.conf["devices"].contains(selectedSerial)) {
config.conf["devices"][info->serial]["channelId"] = 0; config.conf["devices"][info->serial]["channelId"] = 0;
@ -400,7 +400,7 @@ private:
bladerf_devinfo info = _this->devInfoList[_this->devId]; bladerf_devinfo info = _this->devInfoList[_this->devId];
_this->selectByInfo(&info); _this->selectByInfo(&info);
core::setInputSampleRate(_this->sampleRate); core::setInputSampleRate(_this->sampleRate);
config.aquire(); config.acquire();
config.conf["device"] = _this->selectedSerial; config.conf["device"] = _this->selectedSerial;
config.release(true); config.release(true);
} }
@ -409,7 +409,7 @@ private:
_this->sampleRate = _this->sampleRates[_this->srId]; _this->sampleRate = _this->sampleRates[_this->srId];
core::setInputSampleRate(_this->sampleRate); core::setInputSampleRate(_this->sampleRate);
if (_this->selectedSerial != "") { if (_this->selectedSerial != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerial]["sampleRate"] = _this->sampleRates[_this->srId]; config.conf["devices"][_this->selectedSerial]["sampleRate"] = _this->sampleRates[_this->srId];
config.release(true); config.release(true);
} }
@ -431,7 +431,7 @@ private:
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
ImGui::Combo(CONCAT("##_balderf_ch_sel_", _this->name), &_this->chanId, _this->channelNamesTxt.c_str()); ImGui::Combo(CONCAT("##_balderf_ch_sel_", _this->name), &_this->chanId, _this->channelNamesTxt.c_str());
if (_this->selectedSerial != "") { if (_this->selectedSerial != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerial]["channelId"] = _this->chanId; config.conf["devices"][_this->selectedSerial]["channelId"] = _this->chanId;
config.release(true); config.release(true);
} }
@ -448,7 +448,7 @@ private:
std::clamp<uint64_t>(_this->sampleRate, _this->bwRange->min, _this->bwRange->max) : _this->bandwidths[_this->bwId], NULL); std::clamp<uint64_t>(_this->sampleRate, _this->bwRange->min, _this->bwRange->max) : _this->bandwidths[_this->bwId], NULL);
} }
if (_this->selectedSerial != "") { if (_this->selectedSerial != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerial]["bandwidth"] = _this->bwId; config.conf["devices"][_this->selectedSerial]["bandwidth"] = _this->bwId;
config.release(true); config.release(true);
} }
@ -467,7 +467,7 @@ private:
bladerf_set_gain(_this->openDev, BLADERF_CHANNEL_RX(_this->chanId), _this->overallGain); bladerf_set_gain(_this->openDev, BLADERF_CHANNEL_RX(_this->chanId), _this->overallGain);
} }
if (_this->selectedSerial != "") { if (_this->selectedSerial != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerial]["gainMode"] = _this->gainModeNames[_this->gainMode]; config.conf["devices"][_this->selectedSerial]["gainMode"] = _this->gainModeNames[_this->gainMode];
config.release(true); config.release(true);
} }
@ -483,7 +483,7 @@ private:
bladerf_set_gain(_this->openDev, BLADERF_CHANNEL_RX(_this->chanId), _this->overallGain); bladerf_set_gain(_this->openDev, BLADERF_CHANNEL_RX(_this->chanId), _this->overallGain);
} }
if (_this->selectedSerial != "") { if (_this->selectedSerial != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerial]["overallGain"] = _this->overallGain; config.conf["devices"][_this->selectedSerial]["overallGain"] = _this->overallGain;
config.release(true); config.release(true);
} }

View File

@ -66,7 +66,7 @@ void ConfigManager::disableAutoSave() {
} }
} }
void ConfigManager::aquire() { void ConfigManager::acquire() {
mtx.lock(); mtx.lock();
} }

View File

@ -16,7 +16,7 @@ public:
void save(bool lock = true); void save(bool lock = true);
void enableAutoSave(); void enableAutoSave();
void disableAutoSave(); void disableAutoSave();
void aquire(); void acquire();
void release(bool changed = false); void release(bool changed = false);
json conf; json conf;

View File

@ -214,7 +214,7 @@ int sdrpp_main(int argc, char *argv[]) {
core::configManager.enableAutoSave(); core::configManager.enableAutoSave();
core::configManager.aquire(); core::configManager.acquire();
// Fix missing elements in config // Fix missing elements in config
for (auto const& item : defConfig.items()) { for (auto const& item : defConfig.items()) {
if (!core::configManager.conf.contains(item.key())) { if (!core::configManager.conf.contains(item.key())) {
@ -254,7 +254,7 @@ int sdrpp_main(int argc, char *argv[]) {
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
#endif #endif
core::configManager.aquire(); core::configManager.acquire();
int winWidth = core::configManager.conf["windowSize"]["w"]; int winWidth = core::configManager.conf["windowSize"]["w"];
int winHeight = core::configManager.conf["windowSize"]["h"]; int winHeight = core::configManager.conf["windowSize"]["h"];
maximized = core::configManager.conf["maximized"]; maximized = core::configManager.conf["maximized"];
@ -375,7 +375,7 @@ int sdrpp_main(int argc, char *argv[]) {
if (_maximized != maximized) { if (_maximized != maximized) {
_maximized = maximized; _maximized = maximized;
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["maximized"]= _maximized; core::configManager.conf["maximized"]= _maximized;
if (!maximized) { if (!maximized) {
glfwSetWindowSize(core::window, core::configManager.conf["windowSize"]["w"], core::configManager.conf["windowSize"]["h"]); glfwSetWindowSize(core::window, core::configManager.conf["windowSize"]["w"], core::configManager.conf["windowSize"]["h"]);
@ -405,7 +405,7 @@ int sdrpp_main(int argc, char *argv[]) {
if ((_winWidth != winWidth || _winHeight != winHeight) && !maximized && _winWidth > 0 && _winHeight > 0) { if ((_winWidth != winWidth || _winHeight != winHeight) && !maximized && _winWidth > 0 && _winHeight > 0) {
winWidth = _winWidth; winWidth = _winWidth;
winHeight = _winHeight; winHeight = _winHeight;
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["windowSize"]["w"] = winWidth; core::configManager.conf["windowSize"]["w"] = winWidth;
core::configManager.conf["windowSize"]["h"] = winHeight; core::configManager.conf["windowSize"]["h"] = winHeight;
core::configManager.release(true); core::configManager.release(true);

View File

@ -70,7 +70,7 @@ namespace dsp {
while (run() >= 0); while (run() >= 0);
} }
void aquire() { void acquire() {
ctrlMtx.lock(); ctrlMtx.lock();
} }

View File

@ -44,7 +44,7 @@ void MainWindow::init() {
credits::init(); credits::init();
core::configManager.aquire(); core::configManager.acquire();
json menuElements = core::configManager.conf["menuElements"]; json menuElements = core::configManager.conf["menuElements"];
std::string modulesDir = core::configManager.conf["modulesDirectory"]; std::string modulesDir = core::configManager.conf["modulesDirectory"];
std::string resourcesDir = core::configManager.conf["resourcesDirectory"]; std::string resourcesDir = core::configManager.conf["resourcesDirectory"];
@ -109,7 +109,7 @@ void MainWindow::init() {
} }
// Read module config // Read module config
core::configManager.aquire(); core::configManager.acquire();
std::vector<std::string> modules = core::configManager.conf["modules"]; std::vector<std::string> modules = core::configManager.conf["modules"];
std::map<std::string, std::string> modList = core::configManager.conf["moduleInstances"]; std::map<std::string, std::string> modList = core::configManager.conf["moduleInstances"];
core::configManager.release(); core::configManager.release();
@ -162,7 +162,7 @@ void MainWindow::init() {
// Update UI settings // Update UI settings
LoadingScreen::show("Loading configuration"); LoadingScreen::show("Loading configuration");
core::configManager.aquire(); core::configManager.acquire();
fftMin = core::configManager.conf["min"]; fftMin = core::configManager.conf["min"];
fftMax = core::configManager.conf["max"]; fftMax = core::configManager.conf["max"];
gui::waterfall.setFFTMin(fftMin); gui::waterfall.setFFTMin(fftMin);
@ -223,7 +223,7 @@ void MainWindow::fftHandler(dsp::complex_t* samples, int count, void* ctx) {
void MainWindow::vfoAddedHandler(VFOManager::VFO* vfo, void* ctx) { void MainWindow::vfoAddedHandler(VFOManager::VFO* vfo, void* ctx) {
MainWindow* _this = (MainWindow*)ctx; MainWindow* _this = (MainWindow*)ctx;
std::string name = vfo->getName(); std::string name = vfo->getName();
core::configManager.aquire(); core::configManager.acquire();
if (!core::configManager.conf["vfoOffsets"].contains(name)) { if (!core::configManager.conf["vfoOffsets"].contains(name)) {
core::configManager.release(); core::configManager.release();
return; return;
@ -249,7 +249,7 @@ void MainWindow::draw() {
} }
gui::freqSelect.setFrequency(gui::waterfall.getCenterFrequency() + vfo->generalOffset); gui::freqSelect.setFrequency(gui::waterfall.getCenterFrequency() + vfo->generalOffset);
gui::freqSelect.frequencyChanged = false; gui::freqSelect.frequencyChanged = false;
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["vfoOffsets"][gui::waterfall.selectedVFO] = vfo->generalOffset; core::configManager.conf["vfoOffsets"][gui::waterfall.selectedVFO] = vfo->generalOffset;
core::configManager.release(true); core::configManager.release(true);
} }
@ -273,7 +273,7 @@ void MainWindow::draw() {
vfo->lowerOffsetChanged = false; vfo->lowerOffsetChanged = false;
vfo->upperOffsetChanged = false; vfo->upperOffsetChanged = false;
} }
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["frequency"] = gui::waterfall.getCenterFrequency(); core::configManager.conf["frequency"] = gui::waterfall.getCenterFrequency();
if (vfo != NULL) { if (vfo != NULL) {
core::configManager.conf["vfoOffsets"][gui::waterfall.selectedVFO] = vfo->generalOffset; core::configManager.conf["vfoOffsets"][gui::waterfall.selectedVFO] = vfo->generalOffset;
@ -291,7 +291,7 @@ void MainWindow::draw() {
else { else {
gui::freqSelect.setFrequency(gui::waterfall.getCenterFrequency()); gui::freqSelect.setFrequency(gui::waterfall.getCenterFrequency());
} }
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["frequency"] = gui::waterfall.getCenterFrequency(); core::configManager.conf["frequency"] = gui::waterfall.getCenterFrequency();
core::configManager.release(true); core::configManager.release(true);
} }
@ -299,7 +299,7 @@ void MainWindow::draw() {
int _fftHeight = gui::waterfall.getFFTHeight(); int _fftHeight = gui::waterfall.getFFTHeight();
if (fftHeight != _fftHeight) { if (fftHeight != _fftHeight) {
fftHeight = _fftHeight; fftHeight = _fftHeight;
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["fftHeight"] = fftHeight; core::configManager.conf["fftHeight"] = fftHeight;
core::configManager.release(true); core::configManager.release(true);
} }
@ -314,7 +314,7 @@ void MainWindow::draw() {
ImGui::PushID(ImGui::GetID("sdrpp_menu_btn")); ImGui::PushID(ImGui::GetID("sdrpp_menu_btn"));
if (ImGui::ImageButton(icons::MENU, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5) || ImGui::IsKeyPressed(GLFW_KEY_MENU, false)) { if (ImGui::ImageButton(icons::MENU, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5) || ImGui::IsKeyPressed(GLFW_KEY_MENU, false)) {
showMenu = !showMenu; showMenu = !showMenu;
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["showMenu"] = showMenu; core::configManager.conf["showMenu"] = showMenu;
core::configManager.release(true); core::configManager.release(true);
} }
@ -357,7 +357,7 @@ void MainWindow::draw() {
ImGui::PushID(ImGui::GetID("sdrpp_ena_st_btn")); ImGui::PushID(ImGui::GetID("sdrpp_ena_st_btn"));
if (ImGui::ImageButton(icons::CENTER_TUNING, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5)) { if (ImGui::ImageButton(icons::CENTER_TUNING, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5)) {
tuningMode = tuner::TUNER_MODE_NORMAL; tuningMode = tuner::TUNER_MODE_NORMAL;
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["centerTuning"] = false; core::configManager.conf["centerTuning"] = false;
core::configManager.release(true); core::configManager.release(true);
} }
@ -368,7 +368,7 @@ void MainWindow::draw() {
if (ImGui::ImageButton(icons::NORMAL_TUNING, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5)) { if (ImGui::ImageButton(icons::NORMAL_TUNING, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5)) {
tuningMode = tuner::TUNER_MODE_CENTER; tuningMode = tuner::TUNER_MODE_CENTER;
tuner::tune(tuner::TUNER_MODE_CENTER, gui::waterfall.selectedVFO, gui::freqSelect.frequency); tuner::tune(tuner::TUNER_MODE_CENTER, gui::waterfall.selectedVFO, gui::freqSelect.frequency);
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["centerTuning"] = true; core::configManager.conf["centerTuning"] = true;
core::configManager.release(true); core::configManager.release(true);
} }
@ -421,7 +421,7 @@ void MainWindow::draw() {
if(!down && grabbingMenu) { if(!down && grabbingMenu) {
grabbingMenu = false; grabbingMenu = false;
menuWidth = newWidth; menuWidth = newWidth;
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["menuWidth"] = menuWidth; core::configManager.conf["menuWidth"] = menuWidth;
core::configManager.release(true); core::configManager.release(true);
} }
@ -439,7 +439,7 @@ void MainWindow::draw() {
float menuColumnWidth = ImGui::GetContentRegionAvailWidth(); float menuColumnWidth = ImGui::GetContentRegionAvailWidth();
if (gui::menu.draw(firstMenuRender)) { if (gui::menu.draw(firstMenuRender)) {
core::configManager.aquire(); core::configManager.acquire();
json arr = json::array(); json arr = json::array();
for (int i = 0; i < gui::menu.order.size(); i++) { for (int i = 0; i < gui::menu.order.size(); i++) {
arr[i]["name"] = gui::menu.order[i].name; arr[i]["name"] = gui::menu.order[i].name;
@ -513,7 +513,7 @@ void MainWindow::draw() {
nfreq = roundl(nfreq / vfo->snapInterval) * vfo->snapInterval; nfreq = roundl(nfreq / vfo->snapInterval) * vfo->snapInterval;
tuner::tune(tuningMode, gui::waterfall.selectedVFO, nfreq); tuner::tune(tuningMode, gui::waterfall.selectedVFO, nfreq);
} }
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["frequency"] = gui::waterfall.getCenterFrequency(); core::configManager.conf["frequency"] = gui::waterfall.getCenterFrequency();
if (vfo != NULL) { if (vfo != NULL) {
core::configManager.conf["vfoOffsets"][gui::waterfall.selectedVFO] = vfo->generalOffset; core::configManager.conf["vfoOffsets"][gui::waterfall.selectedVFO] = vfo->generalOffset;
@ -534,7 +534,7 @@ void MainWindow::draw() {
} }
tuner::tune(tuningMode, gui::waterfall.selectedVFO, nfreq); tuner::tune(tuningMode, gui::waterfall.selectedVFO, nfreq);
gui::freqSelect.setFrequency(nfreq); gui::freqSelect.setFrequency(nfreq);
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["frequency"] = gui::waterfall.getCenterFrequency(); core::configManager.conf["frequency"] = gui::waterfall.getCenterFrequency();
if (vfo != NULL) { if (vfo != NULL) {
core::configManager.conf["vfoOffsets"][gui::waterfall.selectedVFO] = vfo->generalOffset; core::configManager.conf["vfoOffsets"][gui::waterfall.selectedVFO] = vfo->generalOffset;
@ -563,7 +563,7 @@ void MainWindow::draw() {
ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - 10); ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - 10);
if (ImGui::VSliderFloat("##_8_", ImVec2(20.0, 150.0), &fftMax, 0.0, -160.0f, "")) { if (ImGui::VSliderFloat("##_8_", ImVec2(20.0, 150.0), &fftMax, 0.0, -160.0f, "")) {
fftMax = std::max<float>(fftMax, fftMin + 10); fftMax = std::max<float>(fftMax, fftMin + 10);
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["max"] = fftMax; core::configManager.conf["max"] = fftMax;
core::configManager.release(true); core::configManager.release(true);
} }
@ -575,7 +575,7 @@ void MainWindow::draw() {
ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - 10); ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - 10);
if (ImGui::VSliderFloat("##_9_", ImVec2(20.0, 150.0), &fftMin, 0.0, -160.0f, "")) { if (ImGui::VSliderFloat("##_9_", ImVec2(20.0, 150.0), &fftMin, 0.0, -160.0f, "")) {
fftMin = std::min<float>(fftMax - 10, fftMin); fftMin = std::min<float>(fftMax - 10, fftMin);
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["min"] = fftMin; core::configManager.conf["min"] = fftMin;
core::configManager.release(true); core::configManager.release(true);
} }

View File

@ -38,7 +38,7 @@ namespace bandplanmenu {
ImGui::PushItemWidth(menuColumnWidth); ImGui::PushItemWidth(menuColumnWidth);
if (ImGui::Combo("##_bandplan_name_", &bandplanId, bandplan::bandplanNameTxt.c_str())) { if (ImGui::Combo("##_bandplan_name_", &bandplanId, bandplan::bandplanNameTxt.c_str())) {
gui::waterfall.bandplan = &bandplan::bandplans[bandplan::bandplanNames[bandplanId]]; gui::waterfall.bandplan = &bandplan::bandplans[bandplan::bandplanNames[bandplanId]];
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["bandPlan"] = bandplan::bandplanNames[bandplanId]; core::configManager.conf["bandPlan"] = bandplan::bandplanNames[bandplanId];
core::configManager.release(true); core::configManager.release(true);
} }
@ -49,14 +49,14 @@ namespace bandplanmenu {
ImGui::SetNextItemWidth(menuColumnWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuColumnWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##_bandplan_pos_", &bandPlanPos, bandPlanPosTxt)) { if (ImGui::Combo("##_bandplan_pos_", &bandPlanPos, bandPlanPosTxt)) {
gui::waterfall.setBandPlanPos(bandPlanPos); gui::waterfall.setBandPlanPos(bandPlanPos);
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["bandPlanPos"] = bandPlanPos; core::configManager.conf["bandPlanPos"] = bandPlanPos;
core::configManager.release(true); core::configManager.release(true);
} }
if (ImGui::Checkbox("Enabled", &bandPlanEnabled)) { if (ImGui::Checkbox("Enabled", &bandPlanEnabled)) {
bandPlanEnabled ? gui::waterfall.showBandplan() : gui::waterfall.hideBandplan(); bandPlanEnabled ? gui::waterfall.showBandplan() : gui::waterfall.hideBandplan();
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["bandPlanEnabled"] = bandPlanEnabled; core::configManager.conf["bandPlanEnabled"] = bandPlanEnabled;
core::configManager.release(true); core::configManager.release(true);
} }

View File

@ -80,21 +80,21 @@ namespace displaymenu {
if (ImGui::Checkbox("Show Waterfall##_sdrpp", &showWaterfall) || ImGui::IsKeyPressed(GLFW_KEY_HOME, false)) { if (ImGui::Checkbox("Show Waterfall##_sdrpp", &showWaterfall) || ImGui::IsKeyPressed(GLFW_KEY_HOME, false)) {
if (ImGui::IsKeyPressed(GLFW_KEY_HOME, false)) { showWaterfall = !showWaterfall; } if (ImGui::IsKeyPressed(GLFW_KEY_HOME, false)) { showWaterfall = !showWaterfall; }
showWaterfall ? gui::waterfall.showWaterfall() : gui::waterfall.hideWaterfall(); showWaterfall ? gui::waterfall.showWaterfall() : gui::waterfall.hideWaterfall();
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["showWaterfall"] = showWaterfall; core::configManager.conf["showWaterfall"] = showWaterfall;
core::configManager.release(true); core::configManager.release(true);
} }
if (ImGui::Checkbox("Fast FFT##_sdrpp", &fastFFT)) { if (ImGui::Checkbox("Fast FFT##_sdrpp", &fastFFT)) {
gui::waterfall.setFastFFT(fastFFT); gui::waterfall.setFastFFT(fastFFT);
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["fastFFT"] = fastFFT; core::configManager.conf["fastFFT"] = fastFFT;
core::configManager.release(true); core::configManager.release(true);
} }
if (ImGui::Checkbox("Full Waterfall Update##_sdrpp", &fullWaterfallUpdate)) { if (ImGui::Checkbox("Full Waterfall Update##_sdrpp", &fullWaterfallUpdate)) {
gui::waterfall.setFullWaterfallUpdate(fullWaterfallUpdate); gui::waterfall.setFullWaterfallUpdate(fullWaterfallUpdate);
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["fullWaterfallUpdate"] = fullWaterfallUpdate; core::configManager.conf["fullWaterfallUpdate"] = fullWaterfallUpdate;
core::configManager.release(true); core::configManager.release(true);
} }
@ -104,7 +104,7 @@ namespace displaymenu {
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##sdrpp_fft_size", &fftSizeId, FFTSizesStr)) { if (ImGui::Combo("##sdrpp_fft_size", &fftSizeId, FFTSizesStr)) {
gui::mainWindow.setFFTSize(FFTSizes[fftSizeId]); gui::mainWindow.setFFTSize(FFTSizes[fftSizeId]);
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["fftSize"] = FFTSizes[fftSizeId]; core::configManager.conf["fftSize"] = FFTSizes[fftSizeId];
core::configManager.release(true); core::configManager.release(true);
} }
@ -114,7 +114,7 @@ namespace displaymenu {
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##sdrpp_fft_window", &selectedWindow, "Rectangular\0Blackman\0")) { if (ImGui::Combo("##sdrpp_fft_window", &selectedWindow, "Rectangular\0Blackman\0")) {
gui::mainWindow.setFFTWindow(selectedWindow); gui::mainWindow.setFFTWindow(selectedWindow);
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["fftWindow"] = selectedWindow; core::configManager.conf["fftWindow"] = selectedWindow;
core::configManager.release(true); core::configManager.release(true);
} }
@ -126,7 +126,7 @@ namespace displaymenu {
if (ImGui::Combo("##_sdrpp_color_map_sel", &colorMapId, colorMapNamesTxt.c_str())) { if (ImGui::Combo("##_sdrpp_color_map_sel", &colorMapId, colorMapNamesTxt.c_str())) {
colormaps::Map map = colormaps::maps[colorMapNames[colorMapId]]; colormaps::Map map = colormaps::maps[colorMapNames[colorMapId]];
gui::waterfall.updatePalletteFromArray(map.map, map.entryCount); gui::waterfall.updatePalletteFromArray(map.map, map.entryCount);
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["colorMap"] = colorMapNames[colorMapId]; core::configManager.conf["colorMap"] = colorMapNames[colorMapId];
core::configManager.release(true); core::configManager.release(true);
colorMapAuthor = map.author; colorMapAuthor = map.author;

View File

@ -4,7 +4,7 @@
namespace sinkmenu { namespace sinkmenu {
void init() { void init() {
core::configManager.aquire(); core::configManager.acquire();
sigpath::sinkManager.loadSinksFromConfig(); sigpath::sinkManager.loadSinksFromConfig();
core::configManager.release(); core::configManager.release();
} }

View File

@ -43,7 +43,7 @@ namespace sourecmenu {
} }
void init() { void init() {
core::configManager.aquire(); core::configManager.acquire();
std::string name = core::configManager.conf["source"]; std::string name = core::configManager.conf["source"];
auto it = std::find(sigpath::sourceManager.sourceNames.begin(), sigpath::sourceManager.sourceNames.end(), name); auto it = std::find(sigpath::sourceManager.sourceNames.begin(), sigpath::sourceManager.sourceNames.end(), name);
if (it != sigpath::sourceManager.sourceNames.end()) { if (it != sigpath::sourceManager.sourceNames.end()) {
@ -75,7 +75,7 @@ namespace sourecmenu {
ImGui::SetNextItemWidth(itemWidth); ImGui::SetNextItemWidth(itemWidth);
if (ImGui::Combo("##source", &sourceId, items.c_str())) { if (ImGui::Combo("##source", &sourceId, items.c_str())) {
sigpath::sourceManager.selectSource(sigpath::sourceManager.sourceNames[sourceId]); sigpath::sourceManager.selectSource(sigpath::sourceManager.sourceNames[sourceId]);
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["source"] = sigpath::sourceManager.sourceNames[sourceId]; core::configManager.conf["source"] = sigpath::sourceManager.sourceNames[sourceId];
core::configManager.release(true); core::configManager.release(true);
} }
@ -89,7 +89,7 @@ namespace sourecmenu {
ImGui::SetNextItemWidth(itemWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(itemWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##_sdrpp_offset_mode", &offsetMode, offsetModesTxt)) { if (ImGui::Combo("##_sdrpp_offset_mode", &offsetMode, offsetModesTxt)) {
updateOffset(); updateOffset();
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["offsetMode"] = offsetMode; core::configManager.conf["offsetMode"] = offsetMode;
core::configManager.release(true); core::configManager.release(true);
} }
@ -100,7 +100,7 @@ namespace sourecmenu {
if (offsetMode == OFFSET_MODE_CUSTOM) { if (offsetMode == OFFSET_MODE_CUSTOM) {
if (ImGui::InputDouble("##freq_offset", &customOffset, 1.0, 100.0)) { if (ImGui::InputDouble("##freq_offset", &customOffset, 1.0, 100.0)) {
updateOffset(); updateOffset();
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["offset"] = customOffset; core::configManager.conf["offset"] = customOffset;
core::configManager.release(true); core::configManager.release(true);
} }

View File

@ -11,7 +11,7 @@ namespace thememenu {
void init(std::string resDir) { void init(std::string resDir) {
// TODO: Not hardcode theme directory // TODO: Not hardcode theme directory
gui::themeManager.loadThemesFromDir(resDir + "/themes/"); gui::themeManager.loadThemesFromDir(resDir + "/themes/");
core::configManager.aquire(); core::configManager.acquire();
std::string selectedThemeName = core::configManager.conf["theme"]; std::string selectedThemeName = core::configManager.conf["theme"];
core::configManager.release(); core::configManager.release();
@ -39,7 +39,7 @@ namespace thememenu {
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##theme_select_combo", &themeId, themeNamesTxt.c_str())) { if (ImGui::Combo("##theme_select_combo", &themeId, themeNamesTxt.c_str())) {
gui::themeManager.applyTheme(themeNames[themeId]); gui::themeManager.applyTheme(themeNames[themeId]);
core::configManager.aquire(); core::configManager.acquire();
core::configManager.conf["theme"] = themeNames[themeId]; core::configManager.conf["theme"] = themeNames[themeId];
core::configManager.release(true); core::configManager.release(true);
} }

View File

@ -25,7 +25,7 @@ namespace vfo_color_menu {
void init() { void init() {
// Load colors from config // Load colors from config
bool modified = false; bool modified = false;
core::configManager.aquire(); core::configManager.acquire();
json conf = core::configManager.conf["vfoColors"]; json conf = core::configManager.conf["vfoColors"];
for (auto& [name, val] : conf.items()) { for (auto& [name, val] : conf.items()) {
// If not a string, repair with default // If not a string, repair with default
@ -90,7 +90,7 @@ namespace vfo_color_menu {
vfoColors[name] = ImVec4(r, g, b, 1.0f); vfoColors[name] = ImVec4(r, g, b, 1.0f);
vfo->color = IM_COL32((int)roundf(r * 255), (int)roundf(g * 255), (int)roundf(b * 255), 50); vfo->color = IM_COL32((int)roundf(r * 255), (int)roundf(g * 255), (int)roundf(b * 255), 50);
hue += delta; hue += delta;
core::configManager.aquire(); core::configManager.acquire();
char buf[16]; char buf[16];
sprintf(buf, "#%02X%02X%02X", (int)roundf(r * 255), (int)roundf(g * 255), (int)roundf(b * 255)); sprintf(buf, "#%02X%02X%02X", (int)roundf(r * 255), (int)roundf(g * 255), (int)roundf(b * 255));
core::configManager.conf["vfoColors"][name] = buf; core::configManager.conf["vfoColors"][name] = buf;
@ -103,7 +103,7 @@ namespace vfo_color_menu {
for (auto& [name, vfo] : gui::waterfall.vfos) { for (auto& [name, vfo] : gui::waterfall.vfos) {
vfoColors[name] = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); vfoColors[name] = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
vfo->color = IM_COL32(255, 255, 255, 50); vfo->color = IM_COL32(255, 255, 255, 50);
core::configManager.aquire(); core::configManager.acquire();
char buf[16]; char buf[16];
core::configManager.conf["vfoColors"][name] = "#FFFFFF"; core::configManager.conf["vfoColors"][name] = "#FFFFFF";
core::configManager.release(true); core::configManager.release(true);
@ -123,7 +123,7 @@ namespace vfo_color_menu {
if (ImGui::ColorEdit3(("##vfo_color_"+name).c_str(), (float*)&col, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel)) { if (ImGui::ColorEdit3(("##vfo_color_"+name).c_str(), (float*)&col, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel)) {
vfoColors[name] = col; vfoColors[name] = col;
vfo->color = IM_COL32((int)roundf(col.x * 255), (int)roundf(col.y * 255), (int)roundf(col.z * 255), 50); vfo->color = IM_COL32((int)roundf(col.x * 255), (int)roundf(col.y * 255), (int)roundf(col.z * 255), 50);
core::configManager.aquire(); core::configManager.acquire();
char buf[16]; char buf[16];
sprintf(buf, "#%02X%02X%02X", (int)roundf(col.x * 255), (int)roundf(col.y * 255), (int)roundf(col.z * 255)); sprintf(buf, "#%02X%02X%02X", (int)roundf(col.x * 255), (int)roundf(col.y * 255), (int)roundf(col.z * 255));
core::configManager.conf["vfoColors"][name] = buf; core::configManager.conf["vfoColors"][name] = buf;

View File

@ -30,7 +30,7 @@ namespace ImGui {
} }
} }
dsp::complex_t* ConstellationDiagram::aquireBuffer() { dsp::complex_t* ConstellationDiagram::acquireBuffer() {
bufferMtx.lock(); bufferMtx.lock();
return buffer; return buffer;
} }

View File

@ -13,7 +13,7 @@ namespace ImGui {
void draw(const ImVec2& size_arg = ImVec2(0, 0)); void draw(const ImVec2& size_arg = ImVec2(0, 0));
dsp::complex_t* aquireBuffer(); dsp::complex_t* acquireBuffer();
void releaseBuffer(); void releaseBuffer();

View File

@ -42,7 +42,7 @@ namespace ImGui {
window->DrawList->AddImage((void*)(intptr_t)textureId, min, ImVec2(min.x + width, min.y + height)); window->DrawList->AddImage((void*)(intptr_t)textureId, min, ImVec2(min.x + width, min.y + height));
} }
uint8_t* LinePushImage::aquireNextLine(int count) { uint8_t* LinePushImage::acquireNextLine(int count) {
bufferMtx.lock(); bufferMtx.lock();
int oldLineCount = _lineCount; int oldLineCount = _lineCount;

View File

@ -13,7 +13,7 @@ namespace ImGui {
void draw(const ImVec2& size_arg = ImVec2(0, 0)); void draw(const ImVec2& size_arg = ImVec2(0, 0));
uint8_t* aquireNextLine(int count = 1); uint8_t* acquireNextLine(int count = 1);
void releaseNextLine(); void releaseNextLine();

View File

@ -32,7 +32,7 @@ namespace ImGui {
} }
} }
float* SymbolDiagram::aquireBuffer() { float* SymbolDiagram::acquireBuffer() {
bufferMtx.lock(); bufferMtx.lock();
return buffer; return buffer;
} }

View File

@ -12,7 +12,7 @@ namespace ImGui {
void draw(const ImVec2& size_arg = ImVec2(0, 0)); void draw(const ImVec2& size_arg = ImVec2(0, 0));
float* aquireBuffer(); float* acquireBuffer();
void releaseBuffer(); void releaseBuffer();

View File

@ -110,7 +110,7 @@ void SinkManager::registerStream(std::string name, SinkManager::Stream* stream)
streamNames.push_back(name); streamNames.push_back(name);
// Load config // Load config
core::configManager.aquire(); core::configManager.acquire();
bool available = core::configManager.conf["streams"].contains(name); bool available = core::configManager.conf["streams"].contains(name);
core::configManager.release(); core::configManager.release();
if (available) { loadStreamConfig(name); } if (available) { loadStreamConfig(name); }
@ -206,7 +206,7 @@ void SinkManager::showVolumeSlider(std::string name, std::string prefix, float w
ImGui::PushID(ImGui::GetID(("sdrpp_unmute_btn_" + name).c_str())); ImGui::PushID(ImGui::GetID(("sdrpp_unmute_btn_" + name).c_str()));
if (ImGui::ImageButton(icons::MUTED, ImVec2(height, height), ImVec2(0, 0), ImVec2(1, 1), btwBorder)) { if (ImGui::ImageButton(icons::MUTED, ImVec2(height, height), ImVec2(0, 0), ImVec2(1, 1), btwBorder)) {
stream->volumeAjust.setMuted(false); stream->volumeAjust.setMuted(false);
core::configManager.aquire(); core::configManager.acquire();
saveStreamConfig(name); saveStreamConfig(name);
core::configManager.release(true); core::configManager.release(true);
} }
@ -216,7 +216,7 @@ void SinkManager::showVolumeSlider(std::string name, std::string prefix, float w
ImGui::PushID(ImGui::GetID(("sdrpp_mute_btn_" + name).c_str())); ImGui::PushID(ImGui::GetID(("sdrpp_mute_btn_" + name).c_str()));
if (ImGui::ImageButton(icons::UNMUTED, ImVec2(height, height), ImVec2(0, 0), ImVec2(1, 1), btwBorder)) { if (ImGui::ImageButton(icons::UNMUTED, ImVec2(height, height), ImVec2(0, 0), ImVec2(1, 1), btwBorder)) {
stream->volumeAjust.setMuted(true); stream->volumeAjust.setMuted(true);
core::configManager.aquire(); core::configManager.acquire();
saveStreamConfig(name); saveStreamConfig(name);
core::configManager.release(true); core::configManager.release(true);
} }
@ -229,7 +229,7 @@ void SinkManager::showVolumeSlider(std::string name, std::string prefix, float w
ImGui::SetCursorPosY(ypos + ((height - sliderHeight) / 2.0f) + btwBorder); ImGui::SetCursorPosY(ypos + ((height - sliderHeight) / 2.0f) + btwBorder);
if (ImGui::SliderFloat((prefix + name).c_str(), &stream->guiVolume, 0.0f, 1.0f, "")) { if (ImGui::SliderFloat((prefix + name).c_str(), &stream->guiVolume, 0.0f, 1.0f, "")) {
stream->setVolume(stream->guiVolume); stream->setVolume(stream->guiVolume);
core::configManager.aquire(); core::configManager.acquire();
saveStreamConfig(name); saveStreamConfig(name);
core::configManager.release(true); core::configManager.release(true);
} }
@ -267,7 +267,7 @@ void SinkManager::saveStreamConfig(std::string name) {
core::configManager.conf["streams"][name] = conf; core::configManager.conf["streams"][name] = conf;
} }
// Note: aquire and release config before running this // Note: acquire and release config before running this
void SinkManager::loadSinksFromConfig() { void SinkManager::loadSinksFromConfig() {
for (auto const& [name, stream] : streams) { for (auto const& [name, stream] : streams) {
if (!core::configManager.conf["streams"].contains(name)) { continue; } if (!core::configManager.conf["streams"].contains(name)) { continue; }
@ -301,7 +301,7 @@ void SinkManager::showMenu() {
if (stream->running) { if (stream->running) {
stream->sink->start(); stream->sink->start();
} }
core::configManager.aquire(); core::configManager.acquire();
saveStreamConfig(name); saveStreamConfig(name);
core::configManager.release(true); core::configManager.release(true);
} }

View File

@ -204,7 +204,7 @@ private:
static void symSinkHandler(float* data, int count, void* ctx) { static void symSinkHandler(float* data, int count, void* ctx) {
Falcon9DecoderModule* _this = (Falcon9DecoderModule*)ctx; Falcon9DecoderModule* _this = (Falcon9DecoderModule*)ctx;
float* buf = _this->symDiag.aquireBuffer(); float* buf = _this->symDiag.acquireBuffer();
memcpy(buf, data, 1024*sizeof(float)); memcpy(buf, data, 1024*sizeof(float));
_this->symDiag.releaseBuffer(); _this->symDiag.releaseBuffer();
} }

View File

@ -25,7 +25,7 @@ public:
FileSourceModule(std::string name) : fileSelect("", {"Wav IQ Files (*.wav)", "*.wav", "All Files", "*"}) { FileSourceModule(std::string name) : fileSelect("", {"Wav IQ Files (*.wav)", "*.wav", "All Files", "*"}) {
this->name = name; this->name = name;
config.aquire(); config.acquire();
fileSelect.setPath(config.conf["path"], true); fileSelect.setPath(config.conf["path"], true);
config.release(); config.release();
@ -114,7 +114,7 @@ private:
core::setInputSampleRate(_this->sampleRate); core::setInputSampleRate(_this->sampleRate);
} }
catch (std::exception e) {} catch (std::exception e) {}
config.aquire(); config.acquire();
config.conf["path"] = _this->fileSelect.path; config.conf["path"] = _this->fileSelect.path;
config.release(true); config.release(true);
} }

View File

@ -62,7 +62,7 @@ public:
FrequencyManagerModule(std::string name) { FrequencyManagerModule(std::string name) {
this->name = name; this->name = name;
config.aquire(); config.acquire();
std::string selList = config.conf["selectedList"]; std::string selList = config.conf["selectedList"];
bookmarkDisplayMode = config.conf["bookmarkDisplayMode"]; bookmarkDisplayMode = config.conf["bookmarkDisplayMode"];
config.release(); config.release();
@ -243,7 +243,7 @@ private:
if (ImGui::Button("Apply")) { if (ImGui::Button("Apply")) {
open = false; open = false;
config.aquire(); config.acquire();
if (renameListOpen) { if (renameListOpen) {
config.conf["lists"][editedListName] = config.conf["lists"][firstEditedListName]; config.conf["lists"][editedListName] = config.conf["lists"][firstEditedListName];
config.conf["lists"].erase(firstEditedListName); config.conf["lists"].erase(firstEditedListName);
@ -282,7 +282,7 @@ private:
for (auto [listName, list] : config.conf["lists"].items()) { for (auto [listName, list] : config.conf["lists"].items()) {
bool shown = list["showOnWaterfall"]; bool shown = list["showOnWaterfall"];
if (ImGui::Checkbox((listName+"##freq_manager_sel_list_").c_str(), &shown)) { if (ImGui::Checkbox((listName+"##freq_manager_sel_list_").c_str(), &shown)) {
config.aquire(); config.acquire();
config.conf["lists"][listName]["showOnWaterfall"] = shown; config.conf["lists"][listName]["showOnWaterfall"] = shown;
refreshWaterfallBookmarks(false); refreshWaterfallBookmarks(false);
config.release(true); config.release(true);
@ -301,7 +301,7 @@ private:
listNames.clear(); listNames.clear();
listNamesTxt = ""; listNamesTxt = "";
config.aquire(); config.acquire();
for (auto [_name, list] : config.conf["lists"].items()) { for (auto [_name, list] : config.conf["lists"].items()) {
listNames.push_back(_name); listNames.push_back(_name);
listNamesTxt += _name; listNamesTxt += _name;
@ -311,7 +311,7 @@ private:
} }
void refreshWaterfallBookmarks(bool lockConfig = true) { void refreshWaterfallBookmarks(bool lockConfig = true) {
if (lockConfig) { config.aquire(); } if (lockConfig) { config.acquire(); }
waterfallBookmarks.clear(); waterfallBookmarks.clear();
for (auto [listName, list] : config.conf["lists"].items()) { for (auto [listName, list] : config.conf["lists"].items()) {
if (!((bool)list["showOnWaterfall"])) { continue; } if (!((bool)list["showOnWaterfall"])) { continue; }
@ -348,7 +348,7 @@ private:
} }
selectedListId = std::distance(listNames.begin(), std::find(listNames.begin(), listNames.end(), listName)); selectedListId = std::distance(listNames.begin(), std::find(listNames.begin(), listNames.end(), listName));
selectedListName = listName; selectedListName = listName;
config.aquire(); config.acquire();
for (auto [bmName, bm] : config.conf["lists"][listName]["bookmarks"].items()) { for (auto [bmName, bm] : config.conf["lists"][listName]["bookmarks"].items()) {
FrequencyBookmark fbm; FrequencyBookmark fbm;
fbm.frequency = bm["frequency"]; fbm.frequency = bm["frequency"];
@ -361,7 +361,7 @@ private:
} }
void saveByName(std::string listName) { void saveByName(std::string listName) {
config.aquire(); config.acquire();
config.conf["lists"][listName]["bookmarks"] = json::object(); config.conf["lists"][listName]["bookmarks"] = json::object();
for (auto [bmName, bm] : bookmarks) { for (auto [bmName, bm] : bookmarks) {
config.conf["lists"][listName]["bookmarks"][bmName]["frequency"] = bm.frequency; config.conf["lists"][listName]["bookmarks"][bmName]["frequency"] = bm.frequency;
@ -386,7 +386,7 @@ private:
ImGui::SetNextItemWidth(menuWidth - 24 - (2*lineHeight) - btnSize); ImGui::SetNextItemWidth(menuWidth - 24 - (2*lineHeight) - btnSize);
if (ImGui::Combo(("##freq_manager_list_sel"+_this->name).c_str(), &_this->selectedListId, _this->listNamesTxt.c_str())) { if (ImGui::Combo(("##freq_manager_list_sel"+_this->name).c_str(), &_this->selectedListId, _this->listNamesTxt.c_str())) {
_this->loadByName(_this->listNames[_this->selectedListId]); _this->loadByName(_this->listNames[_this->selectedListId]);
config.aquire(); config.acquire();
config.conf["selectedList"] = _this->selectedListName; config.conf["selectedList"] = _this->selectedListName;
config.release(true); config.release(true);
} }
@ -418,7 +418,7 @@ private:
if (_this->selectedListName == "") { style::beginDisabled(); } if (_this->selectedListName == "") { style::beginDisabled(); }
if (ImGui::Button(("-##_freq_mgr_del_lst_" + _this->name).c_str(), ImVec2(lineHeight, 0))) { if (ImGui::Button(("-##_freq_mgr_del_lst_" + _this->name).c_str(), ImVec2(lineHeight, 0))) {
if (_this->selectedListName == "") { style::endDisabled(); } if (_this->selectedListName == "") { style::endDisabled(); }
config.aquire(); config.acquire();
config.conf["lists"].erase(_this->selectedListName); config.conf["lists"].erase(_this->selectedListName);
_this->refreshWaterfallBookmarks(false); _this->refreshWaterfallBookmarks(false);
config.release(true); config.release(true);
@ -542,7 +542,7 @@ private:
if (selectedNames.size() == 0 && _this->selectedListName != "") { style::beginDisabled(); } if (selectedNames.size() == 0 && _this->selectedListName != "") { style::beginDisabled(); }
if (ImGui::Button(("Export##_freq_mgr_exp_" + _this->name).c_str(), ImVec2(ImGui::GetContentRegionAvailWidth(), 0)) && !_this->exportOpen) { if (ImGui::Button(("Export##_freq_mgr_exp_" + _this->name).c_str(), ImVec2(ImGui::GetContentRegionAvailWidth(), 0)) && !_this->exportOpen) {
_this->exportedBookmarks = json::object(); _this->exportedBookmarks = json::object();
config.aquire(); config.acquire();
for (auto& _name : selectedNames) { for (auto& _name : selectedNames) {
_this->exportedBookmarks["bookmarks"][_name] = config.conf["lists"][_this->selectedListName]["bookmarks"][_name]; _this->exportedBookmarks["bookmarks"][_name] = config.conf["lists"][_this->selectedListName]["bookmarks"][_name];
} }
@ -561,7 +561,7 @@ private:
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(("##_freq_mgr_dms_" + _this->name).c_str(), &_this->bookmarkDisplayMode, bookmarkDisplayModesTxt)) { if (ImGui::Combo(("##_freq_mgr_dms_" + _this->name).c_str(), &_this->bookmarkDisplayMode, bookmarkDisplayModesTxt)) {
config.aquire(); config.acquire();
config.conf["bookmarkDisplayMode"] = _this->bookmarkDisplayMode; config.conf["bookmarkDisplayMode"] = _this->bookmarkDisplayMode;
config.release(true); config.release(true);
} }
@ -835,7 +835,7 @@ MOD_EXPORT void _INIT_() {
config.enableAutoSave(); config.enableAutoSave();
// Check if of list and convert if they're the old type // Check if of list and convert if they're the old type
config.aquire(); config.acquire();
if (!config.conf.contains("bookmarkDisplayMode")) { if (!config.conf.contains("bookmarkDisplayMode")) {
config.conf["bookmarkDisplayMode"] = BOOKMARK_DISP_MODE_TOP; config.conf["bookmarkDisplayMode"] = BOOKMARK_DISP_MODE_TOP;
} }

View File

@ -95,7 +95,7 @@ public:
refresh(); refresh();
config.aquire(); config.acquire();
std::string confSerial = config.conf["device"]; std::string confSerial = config.conf["device"];
config.release(); config.release();
selectBySerial(confSerial); selectBySerial(confSerial);
@ -151,7 +151,7 @@ public:
} }
bool created = false; bool created = false;
config.aquire(); config.acquire();
if (!config.conf["devices"].contains(serial)) { if (!config.conf["devices"].contains(serial)) {
config.conf["devices"][serial]["sampleRate"] = 2000000; config.conf["devices"][serial]["sampleRate"] = 2000000;
config.conf["devices"][serial]["biasT"] = false; config.conf["devices"][serial]["biasT"] = false;
@ -280,7 +280,7 @@ private:
ImGui::SetNextItemWidth(menuWidth); ImGui::SetNextItemWidth(menuWidth);
if (ImGui::Combo(CONCAT("##_hackrf_dev_sel_", _this->name), &_this->devId, _this->devListTxt.c_str())) { if (ImGui::Combo(CONCAT("##_hackrf_dev_sel_", _this->name), &_this->devId, _this->devListTxt.c_str())) {
_this->selectedSerial = _this->devList[_this->devId]; _this->selectedSerial = _this->devList[_this->devId];
config.aquire(); config.acquire();
config.conf["device"] = _this->selectedSerial; config.conf["device"] = _this->selectedSerial;
config.release(true); config.release(true);
} }
@ -288,7 +288,7 @@ private:
if (ImGui::Combo(CONCAT("##_hackrf_sr_sel_", _this->name), &_this->srId, sampleRatesTxt)) { if (ImGui::Combo(CONCAT("##_hackrf_sr_sel_", _this->name), &_this->srId, sampleRatesTxt)) {
_this->sampleRate = sampleRates[_this->srId]; _this->sampleRate = sampleRates[_this->srId];
core::setInputSampleRate(_this->sampleRate); core::setInputSampleRate(_this->sampleRate);
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerial]["sampleRate"] = _this->sampleRate; config.conf["devices"][_this->selectedSerial]["sampleRate"] = _this->sampleRate;
config.release(true); config.release(true);
} }
@ -309,7 +309,7 @@ private:
if (_this->running) { if (_this->running) {
hackrf_set_baseband_filter_bandwidth(_this->openDev, _this->bandwidthIdToBw(_this->bwId)); hackrf_set_baseband_filter_bandwidth(_this->openDev, _this->bandwidthIdToBw(_this->bwId));
} }
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerial]["bandwidth"] = _this->bwId; config.conf["devices"][_this->selectedSerial]["bandwidth"] = _this->bwId;
config.release(true); config.release(true);
} }
@ -318,7 +318,7 @@ private:
if (_this->running) { if (_this->running) {
hackrf_set_antenna_enable(_this->openDev, _this->biasT); hackrf_set_antenna_enable(_this->openDev, _this->biasT);
} }
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerial]["biasT"] = _this->biasT; config.conf["devices"][_this->selectedSerial]["biasT"] = _this->biasT;
config.release(true); config.release(true);
} }
@ -327,7 +327,7 @@ private:
if (_this->running) { if (_this->running) {
hackrf_set_amp_enable(_this->openDev, _this->amp); hackrf_set_amp_enable(_this->openDev, _this->amp);
} }
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerial]["amp"] = _this->amp; config.conf["devices"][_this->selectedSerial]["amp"] = _this->amp;
config.release(true); config.release(true);
} }
@ -339,7 +339,7 @@ private:
if (_this->running) { if (_this->running) {
hackrf_set_lna_gain(_this->openDev, _this->lna); hackrf_set_lna_gain(_this->openDev, _this->lna);
} }
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerial]["lnaGain"] = (int)_this->lna; config.conf["devices"][_this->selectedSerial]["lnaGain"] = (int)_this->lna;
config.release(true); config.release(true);
} }
@ -351,7 +351,7 @@ private:
if (_this->running) { if (_this->running) {
hackrf_set_vga_gain(_this->openDev, _this->vga); hackrf_set_vga_gain(_this->openDev, _this->vga);
} }
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedSerial]["vgaGain"] = (int)_this->vga; config.conf["devices"][_this->selectedSerial]["vgaGain"] = (int)_this->vga;
config.release(true); config.release(true);
} }

View File

@ -127,7 +127,7 @@ public:
channelNamesTxt += '\0'; channelNamesTxt += '\0';
} }
config.aquire(); config.acquire();
if (config.conf["devices"].contains(selectedDevName)) { if (config.conf["devices"].contains(selectedDevName)) {
if (config.conf["devices"][selectedDevName].contains("channel")) { if (config.conf["devices"][selectedDevName].contains("channel")) {
chanId = config.conf["devices"][selectedDevName]["channel"]; chanId = config.conf["devices"][selectedDevName]["channel"];
@ -186,7 +186,7 @@ public:
bandwidthsTxt += "Auto"; bandwidthsTxt += "Auto";
bandwidthsTxt += '\0'; bandwidthsTxt += '\0';
config.aquire(); config.acquire();
if (!config.conf["devices"].contains(selectedDevName)) { if (!config.conf["devices"].contains(selectedDevName)) {
config.conf["devices"][selectedDevName]["sampleRate"] = sampleRates[0]; config.conf["devices"][selectedDevName]["sampleRate"] = sampleRates[0];
@ -388,7 +388,7 @@ private:
if (ImGui::Combo("##limesdr_dev_sel", &_this->devId, _this->devListTxt.c_str())) { if (ImGui::Combo("##limesdr_dev_sel", &_this->devId, _this->devListTxt.c_str())) {
_this->selectByInfoStr(_this->devList[_this->devId]); _this->selectByInfoStr(_this->devList[_this->devId]);
core::setInputSampleRate(_this->sampleRate); core::setInputSampleRate(_this->sampleRate);
config.aquire(); config.acquire();
config.conf["device"] = _this->selectedDevName; config.conf["device"] = _this->selectedDevName;
config.release(true); config.release(true);
} }
@ -397,7 +397,7 @@ private:
_this->sampleRate = _this->sampleRates[_this->srId]; _this->sampleRate = _this->sampleRates[_this->srId];
core::setInputSampleRate(_this->sampleRate); core::setInputSampleRate(_this->sampleRate);
if (_this->selectedDevName != "") { if (_this->selectedDevName != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedDevName]["sampleRate"] = _this->sampleRates[_this->srId]; config.conf["devices"][_this->selectedDevName]["sampleRate"] = _this->sampleRates[_this->srId];
config.release(true); config.release(true);
} }
@ -417,7 +417,7 @@ private:
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##limesdr_ch_sel", &_this->chanId, _this->channelNamesTxt.c_str()) && _this->selectedDevName != "") { if (ImGui::Combo("##limesdr_ch_sel", &_this->chanId, _this->channelNamesTxt.c_str()) && _this->selectedDevName != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedDevName]["channel"] = _this->chanId; config.conf["devices"][_this->selectedDevName]["channel"] = _this->chanId;
config.release(true); config.release(true);
} }
@ -433,7 +433,7 @@ private:
LMS_SetAntenna(_this->openDev, false, _this->chanId, _this->antennaId); LMS_SetAntenna(_this->openDev, false, _this->chanId, _this->antennaId);
} }
if (_this->selectedDevName != "") { if (_this->selectedDevName != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedDevName]["antenna"] = _this->antennaNameList[_this->antennaId]; config.conf["devices"][_this->selectedDevName]["antenna"] = _this->antennaNameList[_this->antennaId];
config.release(true); config.release(true);
} }
@ -447,7 +447,7 @@ private:
LMS_SetLPFBW(_this->openDev, false, _this->chanId, (_this->bwId == _this->bandwidths.size()) ? _this->getBestBandwidth(_this->sampleRate) : _this->bandwidths[_this->bwId]); LMS_SetLPFBW(_this->openDev, false, _this->chanId, (_this->bwId == _this->bandwidths.size()) ? _this->getBestBandwidth(_this->sampleRate) : _this->bandwidths[_this->bwId]);
} }
if (_this->selectedDevName != "") { if (_this->selectedDevName != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedDevName]["bandwidth"] = _this->bwId; config.conf["devices"][_this->selectedDevName]["bandwidth"] = _this->bwId;
config.release(true); config.release(true);
} }
@ -461,7 +461,7 @@ private:
LMS_SetGaindB(_this->openDev, false, _this->chanId, _this->gain); LMS_SetGaindB(_this->openDev, false, _this->chanId, _this->gain);
} }
if (_this->selectedDevName != "") { if (_this->selectedDevName != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedDevName]["gain"] = _this->gain; config.conf["devices"][_this->selectedDevName]["gain"] = _this->gain;
config.release(true); config.release(true);
} }

View File

@ -51,7 +51,7 @@ public:
writeBuffer = new int8_t[STREAM_BUFFER_SIZE]; writeBuffer = new int8_t[STREAM_BUFFER_SIZE];
// Load config // Load config
config.aquire(); config.acquire();
bool created = false; bool created = false;
if (!config.conf.contains(name)) { if (!config.conf.contains(name)) {
config.conf[name]["recPath"] = "%ROOT%/recordings"; config.conf[name]["recPath"] = "%ROOT%/recordings";
@ -136,7 +136,7 @@ private:
if (_this->folderSelect.render("##meteor-recorder-" + _this->name)) { if (_this->folderSelect.render("##meteor-recorder-" + _this->name)) {
if (_this->folderSelect.pathIsValid()) { if (_this->folderSelect.pathIsValid()) {
config.aquire(); config.acquire();
config.conf[_this->name]["recPath"] = _this->folderSelect.path; config.conf[_this->name]["recPath"] = _this->folderSelect.path;
config.release(true); config.release(true);
} }
@ -178,7 +178,7 @@ private:
static void symSinkHandler(dsp::complex_t* data, int count, void* ctx) { static void symSinkHandler(dsp::complex_t* data, int count, void* ctx) {
MeteorDemodulatorModule* _this = (MeteorDemodulatorModule*)ctx; MeteorDemodulatorModule* _this = (MeteorDemodulatorModule*)ctx;
dsp::complex_t* buf = _this->constDiagram.aquireBuffer(); dsp::complex_t* buf = _this->constDiagram.acquireBuffer();
memcpy(buf, data, 1024 * sizeof(dsp::complex_t)); memcpy(buf, data, 1024 * sizeof(dsp::complex_t));
_this->constDiagram.releaseBuffer(); _this->constDiagram.releaseBuffer();
} }

View File

@ -33,7 +33,7 @@ public:
PlutoSDRSourceModule(std::string name) { PlutoSDRSourceModule(std::string name) {
this->name = name; this->name = name;
config.aquire(); config.acquire();
std::string _ip = config.conf["IP"]; std::string _ip = config.conf["IP"];
strcpy(&ip[3], _ip.c_str()); strcpy(&ip[3], _ip.c_str());
sampleRate = config.conf["sampleRate"]; sampleRate = config.conf["sampleRate"];
@ -160,7 +160,7 @@ private:
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputText(CONCAT("##_pluto_ip_", _this->name), &_this->ip[3], 16)) { if (ImGui::InputText(CONCAT("##_pluto_ip_", _this->name), &_this->ip[3], 16)) {
config.aquire(); config.acquire();
config.conf["IP"] = &_this->ip[3]; config.conf["IP"] = &_this->ip[3];
config.release(true); config.release(true);
} }
@ -172,7 +172,7 @@ private:
if (ImGui::InputFloat(CONCAT("##_samplerate_select_", _this->name), &_this->sampleRate, 1, 1000, 0)) { if (ImGui::InputFloat(CONCAT("##_samplerate_select_", _this->name), &_this->sampleRate, 1, 1000, 0)) {
_this->sampleRate = std::clamp<float>(_this->sampleRate, 500000, 61000000); _this->sampleRate = std::clamp<float>(_this->sampleRate, 500000, 61000000);
core::setInputSampleRate(_this->sampleRate); core::setInputSampleRate(_this->sampleRate);
config.aquire(); config.acquire();
config.conf["sampleRate"] = _this->sampleRate; config.conf["sampleRate"] = _this->sampleRate;
config.release(true); config.release(true);
} }
@ -185,7 +185,7 @@ private:
if (_this->running) { if (_this->running) {
iio_channel_attr_write(iio_device_find_channel(_this->phy, "voltage0", false), "gain_control_mode", gainModes[_this->gainMode]); iio_channel_attr_write(iio_device_find_channel(_this->phy, "voltage0", false), "gain_control_mode", gainModes[_this->gainMode]);
} }
config.aquire(); config.acquire();
config.conf["gainMode"] = _this->gainMode; config.conf["gainMode"] = _this->gainMode;
config.release(true); config.release(true);
} }
@ -198,7 +198,7 @@ private:
if (_this->running) { if (_this->running) {
iio_channel_attr_write_longlong(iio_device_find_channel(_this->phy, "voltage0", false),"hardwaregain", round(_this->gain)); iio_channel_attr_write_longlong(iio_device_find_channel(_this->phy, "voltage0", false),"hardwaregain", round(_this->gain));
} }
config.aquire(); config.acquire();
config.conf["gain"] = _this->gain; config.conf["gain"] = _this->gain;
config.release(true); config.release(true);
} }

View File

@ -23,7 +23,7 @@ public:
bw = bandWidth; bw = bandWidth;
_config = config; _config = config;
_config->aquire(); _config->acquire();
if(_config->conf.contains(prefix)) { if(_config->conf.contains(prefix)) {
if(!_config->conf[prefix].contains("AM")) { if(!_config->conf[prefix].contains("AM")) {
_config->conf[prefix]["AM"]["bandwidth"] = bw; _config->conf[prefix]["AM"]["bandwidth"] = bw;
@ -126,7 +126,7 @@ public:
if (ImGui::InputFloat(("##_radio_am_bw_" + uiPrefix).c_str(), &bw, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_am_bw_" + uiPrefix).c_str(), &bw, 1, 100, "%.0f", 0)) {
bw = std::clamp<float>(bw, bwMin, bwMax); bw = std::clamp<float>(bw, bwMin, bwMax);
setBandwidth(bw); setBandwidth(bw);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["AM"]["bandwidth"] = bw; _config->conf[uiPrefix]["AM"]["bandwidth"] = bw;
_config->release(true); _config->release(true);
} }
@ -134,7 +134,7 @@ public:
if (_vfo->getBandwidthChanged()) { if (_vfo->getBandwidthChanged()) {
bw = _vfo->getBandwidth(); bw = _vfo->getBandwidth();
setBandwidth(bw, false); setBandwidth(bw, false);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["AM"]["bandwidth"] = bw; _config->conf[uiPrefix]["AM"]["bandwidth"] = bw;
_config->release(true); _config->release(true);
} }
@ -146,7 +146,7 @@ public:
if (ImGui::InputFloat(("##_radio_am_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_am_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; } if (snapInterval < 1) { snapInterval = 1; }
setSnapInterval(snapInterval); setSnapInterval(snapInterval);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["AM"]["snapInterval"] = snapInterval; _config->conf[uiPrefix]["AM"]["snapInterval"] = snapInterval;
_config->release(true); _config->release(true);
} }
@ -156,7 +156,7 @@ public:
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_am_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { if (ImGui::SliderFloat(("##_radio_am_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) {
squelch.setLevel(squelchLevel); squelch.setLevel(squelchLevel);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["AM"]["squelchLevel"] = squelchLevel; _config->conf[uiPrefix]["AM"]["squelchLevel"] = squelchLevel;
_config->release(true); _config->release(true);
} }

View File

@ -26,7 +26,7 @@ public:
bw = bandWidth; bw = bandWidth;
_config = config; _config = config;
_config->aquire(); _config->acquire();
if(_config->conf.contains(prefix)) { if(_config->conf.contains(prefix)) {
if(!_config->conf[prefix].contains("CW")) { if(!_config->conf[prefix].contains("CW")) {
_config->conf[prefix]["CW"]["bandwidth"] = bw; _config->conf[prefix]["CW"]["bandwidth"] = bw;
@ -134,14 +134,14 @@ public:
if (ImGui::InputFloat(("##_radio_cw_bw_" + uiPrefix).c_str(), &bw, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_cw_bw_" + uiPrefix).c_str(), &bw, 1, 100, "%.0f", 0)) {
bw = std::clamp<float>(bw, bwMin, bwMax); bw = std::clamp<float>(bw, bwMin, bwMax);
setBandwidth(bw); setBandwidth(bw);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["CW"]["bandwidth"] = bw; _config->conf[uiPrefix]["CW"]["bandwidth"] = bw;
_config->release(true); _config->release(true);
}if (running) { }if (running) {
if (_vfo->getBandwidthChanged()) { if (_vfo->getBandwidthChanged()) {
bw = _vfo->getBandwidth(); bw = _vfo->getBandwidth();
setBandwidth(bw, false); setBandwidth(bw, false);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["CW"]["bandwidth"] = bw; _config->conf[uiPrefix]["CW"]["bandwidth"] = bw;
_config->release(true); _config->release(true);
} }
@ -153,7 +153,7 @@ public:
if (ImGui::InputFloat(("##_radio_cw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_cw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; } if (snapInterval < 1) { snapInterval = 1; }
setSnapInterval(snapInterval); setSnapInterval(snapInterval);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["CW"]["snapInterval"] = snapInterval; _config->conf[uiPrefix]["CW"]["snapInterval"] = snapInterval;
_config->release(true); _config->release(true);
} }
@ -163,7 +163,7 @@ public:
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_cw_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { if (ImGui::SliderFloat(("##_radio_cw_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) {
squelch.setLevel(squelchLevel); squelch.setLevel(squelchLevel);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["CW"]["squelchLevel"] = squelchLevel; _config->conf[uiPrefix]["CW"]["squelchLevel"] = squelchLevel;
_config->release(true); _config->release(true);
} }

View File

@ -23,7 +23,7 @@ public:
bw = bandWidth; bw = bandWidth;
_config = config; _config = config;
_config->aquire(); _config->acquire();
if(_config->conf.contains(prefix)) { if(_config->conf.contains(prefix)) {
if(!_config->conf[prefix].contains("DSB")) { if(!_config->conf[prefix].contains("DSB")) {
_config->conf[prefix]["DSB"]["bandwidth"] = bw; _config->conf[prefix]["DSB"]["bandwidth"] = bw;
@ -126,7 +126,7 @@ public:
if (ImGui::InputFloat(("##_radio_dsb_bw_" + uiPrefix).c_str(), &bw, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_dsb_bw_" + uiPrefix).c_str(), &bw, 1, 100, "%.0f", 0)) {
bw = std::clamp<float>(bw, bwMin, bwMax); bw = std::clamp<float>(bw, bwMin, bwMax);
setBandwidth(bw); setBandwidth(bw);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["DSB"]["bandwidth"] = bw; _config->conf[uiPrefix]["DSB"]["bandwidth"] = bw;
_config->release(true); _config->release(true);
} }
@ -134,7 +134,7 @@ public:
if (_vfo->getBandwidthChanged()) { if (_vfo->getBandwidthChanged()) {
bw = _vfo->getBandwidth(); bw = _vfo->getBandwidth();
setBandwidth(bw, false); setBandwidth(bw, false);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["DSB"]["bandwidth"] = bw; _config->conf[uiPrefix]["DSB"]["bandwidth"] = bw;
_config->release(true); _config->release(true);
} }
@ -146,7 +146,7 @@ public:
if (ImGui::InputFloat(("##_radio_dsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_dsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; } if (snapInterval < 1) { snapInterval = 1; }
setSnapInterval(snapInterval); setSnapInterval(snapInterval);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["DSB"]["snapInterval"] = snapInterval; _config->conf[uiPrefix]["DSB"]["snapInterval"] = snapInterval;
_config->release(true); _config->release(true);
} }
@ -156,7 +156,7 @@ public:
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_dsb_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { if (ImGui::SliderFloat(("##_radio_dsb_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) {
squelch.setLevel(squelchLevel); squelch.setLevel(squelchLevel);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["DSB"]["squelchLevel"] = squelchLevel; _config->conf[uiPrefix]["DSB"]["squelchLevel"] = squelchLevel;
_config->release(true); _config->release(true);
} }

View File

@ -23,7 +23,7 @@ public:
bw = bandWidth; bw = bandWidth;
_config = config; _config = config;
_config->aquire(); _config->acquire();
if(_config->conf.contains(prefix)) { if(_config->conf.contains(prefix)) {
if(!_config->conf[prefix].contains("FM")) { if(!_config->conf[prefix].contains("FM")) {
_config->conf[prefix]["FM"]["bandwidth"] = bw; _config->conf[prefix]["FM"]["bandwidth"] = bw;
@ -118,7 +118,7 @@ public:
if (ImGui::InputFloat(("##_radio_fm_bw_" + uiPrefix).c_str(), &bw, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_fm_bw_" + uiPrefix).c_str(), &bw, 1, 100, "%.0f", 0)) {
bw = std::clamp<float>(bw, bwMin, bwMax); bw = std::clamp<float>(bw, bwMin, bwMax);
setBandwidth(bw); setBandwidth(bw);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["FM"]["bandwidth"] = bw; _config->conf[uiPrefix]["FM"]["bandwidth"] = bw;
_config->release(true); _config->release(true);
} }
@ -126,7 +126,7 @@ public:
if (_vfo->getBandwidthChanged()) { if (_vfo->getBandwidthChanged()) {
bw = _vfo->getBandwidth(); bw = _vfo->getBandwidth();
setBandwidth(bw, false); setBandwidth(bw, false);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["FM"]["bandwidth"] = bw; _config->conf[uiPrefix]["FM"]["bandwidth"] = bw;
_config->release(true); _config->release(true);
} }
@ -138,7 +138,7 @@ public:
if (ImGui::InputFloat(("##_radio_fm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_fm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; } if (snapInterval < 1) { snapInterval = 1; }
setSnapInterval(snapInterval); setSnapInterval(snapInterval);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["FM"]["snapInterval"] = snapInterval; _config->conf[uiPrefix]["FM"]["snapInterval"] = snapInterval;
_config->release(true); _config->release(true);
} }
@ -148,7 +148,7 @@ public:
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_fm_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { if (ImGui::SliderFloat(("##_radio_fm_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) {
squelch.setLevel(squelchLevel); squelch.setLevel(squelchLevel);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["FM"]["squelchLevel"] = squelchLevel; _config->conf[uiPrefix]["FM"]["squelchLevel"] = squelchLevel;
_config->release(true); _config->release(true);
} }

View File

@ -23,7 +23,7 @@ public:
bw = bandWidth; bw = bandWidth;
_config = config; _config = config;
_config->aquire(); _config->acquire();
if(_config->conf.contains(prefix)) { if(_config->conf.contains(prefix)) {
if(!_config->conf[prefix].contains("LSB")) { if(!_config->conf[prefix].contains("LSB")) {
_config->conf[prefix]["LSB"]["bandwidth"] = bw; _config->conf[prefix]["LSB"]["bandwidth"] = bw;
@ -126,14 +126,14 @@ public:
if (ImGui::InputFloat(("##_radio_lsb_bw_" + uiPrefix).c_str(), &bw, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_lsb_bw_" + uiPrefix).c_str(), &bw, 1, 100, "%.0f", 0)) {
bw = std::clamp<float>(bw, bwMin, bwMax); bw = std::clamp<float>(bw, bwMin, bwMax);
setBandwidth(bw); setBandwidth(bw);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["LSB"]["bandwidth"] = bw; _config->conf[uiPrefix]["LSB"]["bandwidth"] = bw;
_config->release(true); _config->release(true);
}if (running) { }if (running) {
if (_vfo->getBandwidthChanged()) { if (_vfo->getBandwidthChanged()) {
bw = _vfo->getBandwidth(); bw = _vfo->getBandwidth();
setBandwidth(bw, false); setBandwidth(bw, false);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["LSB"]["bandwidth"] = bw; _config->conf[uiPrefix]["LSB"]["bandwidth"] = bw;
_config->release(true); _config->release(true);
} }
@ -145,7 +145,7 @@ public:
if (ImGui::InputFloat(("##_radio_lsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_lsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; } if (snapInterval < 1) { snapInterval = 1; }
setSnapInterval(snapInterval); setSnapInterval(snapInterval);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["LSB"]["snapInterval"] = snapInterval; _config->conf[uiPrefix]["LSB"]["snapInterval"] = snapInterval;
_config->release(true); _config->release(true);
} }
@ -155,7 +155,7 @@ public:
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_lsb_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { if (ImGui::SliderFloat(("##_radio_lsb_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) {
squelch.setLevel(squelchLevel); squelch.setLevel(squelchLevel);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["LSB"]["squelchLevel"] = squelchLevel; _config->conf[uiPrefix]["LSB"]["squelchLevel"] = squelchLevel;
_config->release(true); _config->release(true);
} }

View File

@ -38,7 +38,7 @@ public:
ns.init(vfo->output); ns.init(vfo->output);
config.aquire(); config.acquire();
if (!config.conf.contains(name)) { if (!config.conf.contains(name)) {
config.conf[name]["selectedDemodId"] = 1; config.conf[name]["selectedDemodId"] = 1;
} }
@ -200,7 +200,7 @@ private:
if (id == 5) { selectDemod(&cwDemod); } if (id == 5) { selectDemod(&cwDemod); }
if (id == 6) { selectDemod(&lsbDemod); } if (id == 6) { selectDemod(&lsbDemod); }
if (id == 7) { selectDemod(&rawDemod); } if (id == 7) { selectDemod(&rawDemod); }
config.aquire(); config.acquire();
config.conf[name]["selectedDemodId"] = demodId; config.conf[name]["selectedDemodId"] = demodId;
config.release(true); config.release(true);
} }

View File

@ -23,7 +23,7 @@ public:
bw = bandWidth; bw = bandWidth;
_config = config; _config = config;
_config->aquire(); _config->acquire();
if(_config->conf.contains(prefix)) { if(_config->conf.contains(prefix)) {
if(!_config->conf[prefix].contains("CW")) { if(!_config->conf[prefix].contains("CW")) {
_config->conf[prefix]["CW"]["snapInterval"] = snapInterval; _config->conf[prefix]["CW"]["snapInterval"] = snapInterval;
@ -100,7 +100,7 @@ public:
if (ImGui::InputFloat(("##_radio_raw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_raw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; } if (snapInterval < 1) { snapInterval = 1; }
setSnapInterval(snapInterval); setSnapInterval(snapInterval);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["RAW"]["snapInterval"] = snapInterval; _config->conf[uiPrefix]["RAW"]["snapInterval"] = snapInterval;
_config->release(true); _config->release(true);
} }
@ -110,7 +110,7 @@ public:
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_raw_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { if (ImGui::SliderFloat(("##_radio_raw_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) {
squelch.setLevel(squelchLevel); squelch.setLevel(squelchLevel);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["RAW"]["squelchLevel"] = squelchLevel; _config->conf[uiPrefix]["RAW"]["squelchLevel"] = squelchLevel;
_config->release(true); _config->release(true);
} }

View File

@ -23,7 +23,7 @@ public:
bw = bandWidth; bw = bandWidth;
_config = config; _config = config;
_config->aquire(); _config->acquire();
if(_config->conf.contains(prefix)) { if(_config->conf.contains(prefix)) {
if(!_config->conf[prefix].contains("USB")) { if(!_config->conf[prefix].contains("USB")) {
_config->conf[prefix]["USB"]["bandwidth"] = bw; _config->conf[prefix]["USB"]["bandwidth"] = bw;
@ -126,14 +126,14 @@ public:
if (ImGui::InputFloat(("##_radio_usb_bw_" + uiPrefix).c_str(), &bw, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_usb_bw_" + uiPrefix).c_str(), &bw, 1, 100, "%.0f", 0)) {
bw = std::clamp<float>(bw, bwMin, bwMax); bw = std::clamp<float>(bw, bwMin, bwMax);
setBandwidth(bw); setBandwidth(bw);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["USB"]["bandwidth"] = bw; _config->conf[uiPrefix]["USB"]["bandwidth"] = bw;
_config->release(true); _config->release(true);
}if (running) { }if (running) {
if (_vfo->getBandwidthChanged()) { if (_vfo->getBandwidthChanged()) {
bw = _vfo->getBandwidth(); bw = _vfo->getBandwidth();
setBandwidth(bw, false); setBandwidth(bw, false);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["USB"]["bandwidth"] = bw; _config->conf[uiPrefix]["USB"]["bandwidth"] = bw;
_config->release(true); _config->release(true);
} }
@ -145,7 +145,7 @@ public:
if (ImGui::InputFloat(("##_radio_usb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_usb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; } if (snapInterval < 1) { snapInterval = 1; }
setSnapInterval(snapInterval); setSnapInterval(snapInterval);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["USB"]["snapInterval"] = snapInterval; _config->conf[uiPrefix]["USB"]["snapInterval"] = snapInterval;
_config->release(true); _config->release(true);
} }
@ -155,7 +155,7 @@ public:
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_usb_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { if (ImGui::SliderFloat(("##_radio_usb_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) {
squelch.setLevel(squelchLevel); squelch.setLevel(squelchLevel);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["USB"]["squelchLevel"] = squelchLevel; _config->conf[uiPrefix]["USB"]["squelchLevel"] = squelchLevel;
_config->release(true); _config->release(true);
} }

View File

@ -23,7 +23,7 @@ public:
bw = bandWidth; bw = bandWidth;
_config = config; _config = config;
_config->aquire(); _config->acquire();
if(_config->conf.contains(prefix)) { if(_config->conf.contains(prefix)) {
if(!_config->conf[prefix].contains("WFM")) { if(!_config->conf[prefix].contains("WFM")) {
if (!_config->conf[prefix]["WFM"].contains("bandwidth")) { _config->conf[prefix]["WFM"]["bandwidth"] = bw; } if (!_config->conf[prefix]["WFM"].contains("bandwidth")) { _config->conf[prefix]["WFM"]["bandwidth"] = bw; }
@ -131,7 +131,7 @@ public:
if (ImGui::InputFloat(("##_radio_wfm_bw_" + uiPrefix).c_str(), &bw, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_wfm_bw_" + uiPrefix).c_str(), &bw, 1, 100, "%.0f", 0)) {
bw = std::clamp<float>(bw, bwMin, bwMax); bw = std::clamp<float>(bw, bwMin, bwMax);
setBandwidth(bw); setBandwidth(bw);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["WFM"]["bandwidth"] = bw; _config->conf[uiPrefix]["WFM"]["bandwidth"] = bw;
_config->release(true); _config->release(true);
} }
@ -139,7 +139,7 @@ public:
if (_vfo->getBandwidthChanged()) { if (_vfo->getBandwidthChanged()) {
bw = _vfo->getBandwidth(); bw = _vfo->getBandwidth();
setBandwidth(bw, false); setBandwidth(bw, false);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["WFM"]["bandwidth"] = bw; _config->conf[uiPrefix]["WFM"]["bandwidth"] = bw;
_config->release(true); _config->release(true);
} }
@ -151,7 +151,7 @@ public:
if (ImGui::InputFloat(("##_radio_wfm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_wfm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; } if (snapInterval < 1) { snapInterval = 1; }
setSnapInterval(snapInterval); setSnapInterval(snapInterval);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["WFM"]["snapInterval"] = snapInterval; _config->conf[uiPrefix]["WFM"]["snapInterval"] = snapInterval;
_config->release(true); _config->release(true);
} }
@ -162,7 +162,7 @@ public:
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(("##_radio_wfm_deemp_" + uiPrefix).c_str(), &deempId, deempModes)) { if (ImGui::Combo(("##_radio_wfm_deemp_" + uiPrefix).c_str(), &deempId, deempModes)) {
setDeempIndex(deempId); setDeempIndex(deempId);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["WFM"]["deempMode"] = deempId; _config->conf[uiPrefix]["WFM"]["deempMode"] = deempId;
_config->release(true); _config->release(true);
} }
@ -172,7 +172,7 @@ public:
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_wfm_sqelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { if (ImGui::SliderFloat(("##_radio_wfm_sqelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) {
squelch.setLevel(squelchLevel); squelch.setLevel(squelchLevel);
_config->aquire(); _config->acquire();
_config->conf[uiPrefix]["WFM"]["squelchLevel"] = squelchLevel; _config->conf[uiPrefix]["WFM"]["squelchLevel"] = squelchLevel;
_config->release(true); _config->release(true);
} }

View File

@ -50,7 +50,7 @@ public:
this->name = name; this->name = name;
// Load config // Load config
config.aquire(); config.acquire();
bool created = false; bool created = false;
// Create config if it doesn't exist // Create config if it doesn't exist
@ -173,14 +173,14 @@ private:
ImGui::Columns(2, CONCAT("AirspyGainModeColumns##_", _this->name), false); ImGui::Columns(2, CONCAT("AirspyGainModeColumns##_", _this->name), false);
if (ImGui::RadioButton(CONCAT("Baseband##_recmode_", _this->name), _this->recMode == 0)) { if (ImGui::RadioButton(CONCAT("Baseband##_recmode_", _this->name), _this->recMode == 0)) {
_this->recMode = 0; _this->recMode = 0;
config.aquire(); config.acquire();
config.conf[_this->name]["mode"] = _this->recMode; config.conf[_this->name]["mode"] = _this->recMode;
config.release(true); config.release(true);
} }
ImGui::NextColumn(); ImGui::NextColumn();
if (ImGui::RadioButton(CONCAT("Audio##_recmode_", _this->name), _this->recMode == 1)) { if (ImGui::RadioButton(CONCAT("Audio##_recmode_", _this->name), _this->recMode == 1)) {
_this->recMode = 1; _this->recMode = 1;
config.aquire(); config.acquire();
config.conf[_this->name]["mode"] = _this->recMode; config.conf[_this->name]["mode"] = _this->recMode;
config.release(true); config.release(true);
} }
@ -191,7 +191,7 @@ private:
// Recording path // Recording path
if (_this->folderSelect.render("##_recorder_fold_" + _this->name)) { if (_this->folderSelect.render("##_recorder_fold_" + _this->name)) {
if (_this->folderSelect.pathIsValid()) { if (_this->folderSelect.pathIsValid()) {
config.aquire(); config.acquire();
config.conf[_this->name]["recPath"] = _this->folderSelect.path; config.conf[_this->name]["recPath"] = _this->folderSelect.path;
config.release(true); config.release(true);
} }
@ -254,7 +254,7 @@ private:
if (recording) { style::beginDisabled(); } if (recording) { style::beginDisabled(); }
if (ImGui::Combo(CONCAT("##_recorder_strm_", name), &streamId, streamNamesTxt.c_str())) { if (ImGui::Combo(CONCAT("##_recorder_strm_", name), &streamId, streamNamesTxt.c_str())) {
selectStream(streamNames[streamId]); selectStream(streamNames[streamId]);
config.aquire(); config.acquire();
config.conf[name]["audioStream"] = streamNames[streamId]; config.conf[name]["audioStream"] = streamNames[streamId];
config.release(true); config.release(true);
} }

View File

@ -77,7 +77,7 @@ public:
refresh(); refresh();
config.aquire(); config.acquire();
if (!config.conf["device"].is_string()) { if (!config.conf["device"].is_string()) {
selectedDevName = ""; selectedDevName = "";
config.conf["device"] = ""; config.conf["device"] = "";
@ -156,7 +156,7 @@ public:
std::sort(gainList.begin(), gainList.end()); std::sort(gainList.begin(), gainList.end());
bool created = false; bool created = false;
config.aquire(); config.acquire();
if (!config.conf["devices"].contains(selectedDevName)) { if (!config.conf["devices"].contains(selectedDevName)) {
created = true; created = true;
config.conf["devices"][selectedDevName]["sampleRate"] = sampleRate; config.conf["devices"][selectedDevName]["sampleRate"] = sampleRate;
@ -313,7 +313,7 @@ private:
_this->selectById(_this->devId); _this->selectById(_this->devId);
core::setInputSampleRate(_this->sampleRate); core::setInputSampleRate(_this->sampleRate);
if (_this->selectedDevName != "") { if (_this->selectedDevName != "") {
config.aquire(); config.acquire();
config.conf["device"] = _this->selectedDevName; config.conf["device"] = _this->selectedDevName;
config.release(true); config.release(true);
} }
@ -323,7 +323,7 @@ private:
_this->sampleRate = sampleRates[_this->srId]; _this->sampleRate = sampleRates[_this->srId];
core::setInputSampleRate(_this->sampleRate); core::setInputSampleRate(_this->sampleRate);
if (_this->selectedDevName != "") { if (_this->selectedDevName != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedDevName]["sampleRate"] = _this->sampleRate; config.conf["devices"][_this->selectedDevName]["sampleRate"] = _this->sampleRate;
config.release(true); config.release(true);
} }
@ -360,7 +360,7 @@ private:
} }
} }
if (_this->selectedDevName != "") { if (_this->selectedDevName != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedDevName]["directSampling"] = _this->directSamplingMode; config.conf["devices"][_this->selectedDevName]["directSampling"] = _this->directSamplingMode;
config.release(true); config.release(true);
} }
@ -371,7 +371,7 @@ private:
rtlsdr_set_bias_tee(_this->openDev, _this->biasT); rtlsdr_set_bias_tee(_this->openDev, _this->biasT);
} }
if (_this->selectedDevName != "") { if (_this->selectedDevName != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedDevName]["biasT"] = _this->biasT; config.conf["devices"][_this->selectedDevName]["biasT"] = _this->biasT;
config.release(true); config.release(true);
} }
@ -382,7 +382,7 @@ private:
rtlsdr_set_offset_tuning(_this->openDev, _this->offsetTuning); rtlsdr_set_offset_tuning(_this->openDev, _this->offsetTuning);
} }
if (_this->selectedDevName != "") { if (_this->selectedDevName != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedDevName]["offsetTuning"] = _this->offsetTuning; config.conf["devices"][_this->selectedDevName]["offsetTuning"] = _this->offsetTuning;
config.release(true); config.release(true);
} }
@ -393,7 +393,7 @@ private:
rtlsdr_set_agc_mode(_this->openDev, _this->rtlAgc); rtlsdr_set_agc_mode(_this->openDev, _this->rtlAgc);
} }
if (_this->selectedDevName != "") { if (_this->selectedDevName != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedDevName]["rtlAgc"] = _this->rtlAgc; config.conf["devices"][_this->selectedDevName]["rtlAgc"] = _this->rtlAgc;
config.release(true); config.release(true);
} }
@ -410,7 +410,7 @@ private:
} }
} }
if (_this->selectedDevName != "") { if (_this->selectedDevName != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedDevName]["tunerAgc"] = _this->tunerAgc; config.conf["devices"][_this->selectedDevName]["tunerAgc"] = _this->tunerAgc;
config.release(true); config.release(true);
} }
@ -424,7 +424,7 @@ private:
rtlsdr_set_tuner_gain(_this->openDev, _this->gainList[_this->gainId]); rtlsdr_set_tuner_gain(_this->openDev, _this->gainList[_this->gainId]);
} }
if (_this->selectedDevName != "") { if (_this->selectedDevName != "") {
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedDevName]["gain"] = _this->gainId; config.conf["devices"][_this->selectedDevName]["gain"] = _this->gainId;
config.release(true); config.release(true);
} }

View File

@ -62,7 +62,7 @@ public:
} }
srId = 7; srId = 7;
config.aquire(); config.acquire();
std::string hostStr = config.conf["host"]; std::string hostStr = config.conf["host"];
port = config.conf["port"]; port = config.conf["port"];
directSamplingMode = config.conf["directSamplingMode"]; directSamplingMode = config.conf["directSamplingMode"];
@ -164,14 +164,14 @@ private:
ImGui::SetNextItemWidth(menuWidth - portWidth); ImGui::SetNextItemWidth(menuWidth - portWidth);
if (ImGui::InputText(CONCAT("##_ip_select_", _this->name), _this->ip, 1024)) { if (ImGui::InputText(CONCAT("##_ip_select_", _this->name), _this->ip, 1024)) {
config.aquire(); config.acquire();
config.conf["host"] = std::string(_this->ip); config.conf["host"] = std::string(_this->ip);
config.release(true); config.release(true);
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(portWidth); ImGui::SetNextItemWidth(portWidth);
if (ImGui::InputInt(CONCAT("##_port_select_", _this->name), &_this->port, 0)) { if (ImGui::InputInt(CONCAT("##_port_select_", _this->name), &_this->port, 0)) {
config.aquire(); config.acquire();
config.conf["port"] = _this->port; config.conf["port"] = _this->port;
config.release(true); config.release(true);
} }

View File

@ -135,7 +135,7 @@ public:
refresh(); refresh();
config.aquire(); config.acquire();
std::string confSelectDev = config.conf["device"]; std::string confSelectDev = config.conf["device"];
config.release(); config.release();
selectByName(confSelectDev); selectByName(confSelectDev);
@ -145,7 +145,7 @@ public:
// } // }
// Select device from config // Select device from config
// config.aquire(); // config.acquire();
// std::string devSerial = config.conf["device"]; // std::string devSerial = config.conf["device"];
// config.release(); // config.release();
// selectByString(devSerial); // selectByString(devSerial);
@ -284,7 +284,7 @@ public:
} }
bool created = false; bool created = false;
config.aquire(); config.acquire();
if (!config.conf["devices"].contains(selectedName)) { if (!config.conf["devices"].contains(selectedName)) {
created = true; created = true;
config.conf["devices"][selectedName]["sampleRate"] = sampleRates[0]; config.conf["devices"][selectedName]["sampleRate"] = sampleRates[0];
@ -478,7 +478,7 @@ private:
return; return;
} }
// First, aquire device // First, acquire device
sdrplay_api_ErrT err; sdrplay_api_ErrT err;
_this->openDev.tuner = sdrplay_api_Tuner_A; _this->openDev.tuner = sdrplay_api_Tuner_A;
@ -630,7 +630,7 @@ private:
if (ImGui::Combo(CONCAT("##sdrplay_dev", _this->name), &_this->devId, _this->devListTxt.c_str())) { if (ImGui::Combo(CONCAT("##sdrplay_dev", _this->name), &_this->devId, _this->devListTxt.c_str())) {
_this->selectById(_this->devId); _this->selectById(_this->devId);
config.aquire(); config.acquire();
config.conf["device"] = _this->devNameList[_this->devId]; config.conf["device"] = _this->devNameList[_this->devId];
config.release(true); config.release(true);
} }
@ -642,7 +642,7 @@ private:
_this->bandwidth = preferedBandwidth[_this->srId]; _this->bandwidth = preferedBandwidth[_this->srId];
} }
core::setInputSampleRate(_this->sampleRate); core::setInputSampleRate(_this->sampleRate);
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedName]["sampleRate"] = _this->sampleRate; config.conf["devices"][_this->selectedName]["sampleRate"] = _this->sampleRate;
config.release(true); config.release(true);
} }
@ -663,7 +663,7 @@ private:
_this->channelParams->tunerParams.bwType = _this->bandwidth; _this->channelParams->tunerParams.bwType = _this->bandwidth;
sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Tuner_BwType, sdrplay_api_Update_Ext1_None); sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Tuner_BwType, sdrplay_api_Update_Ext1_None);
} }
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedName]["bwMode"] = _this->bandwidthId; config.conf["devices"][_this->selectedName]["bwMode"] = _this->bandwidthId;
config.release(true); config.release(true);
} }
@ -678,7 +678,7 @@ private:
_this->channelParams->tunerParams.gain.LNAstate = _this->lnaGain; _this->channelParams->tunerParams.gain.LNAstate = _this->lnaGain;
sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Tuner_Gr, sdrplay_api_Update_Ext1_None); sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Tuner_Gr, sdrplay_api_Update_Ext1_None);
} }
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedName]["lnaGain"] = _this->lnaGain; config.conf["devices"][_this->selectedName]["lnaGain"] = _this->lnaGain;
config.release(true); config.release(true);
} }
@ -692,7 +692,7 @@ private:
_this->channelParams->tunerParams.gain.gRdB = _this->gain; _this->channelParams->tunerParams.gain.gRdB = _this->gain;
sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Tuner_Gr, sdrplay_api_Update_Ext1_None); sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Tuner_Gr, sdrplay_api_Update_Ext1_None);
} }
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedName]["ifGain"] = _this->gain; config.conf["devices"][_this->selectedName]["ifGain"] = _this->gain;
config.release(true); config.release(true);
} }
@ -711,7 +711,7 @@ private:
sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Tuner_Gr, sdrplay_api_Update_Ext1_None); sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Tuner_Gr, sdrplay_api_Update_Ext1_None);
} }
} }
config.aquire(); config.acquire();
config.conf["devices"][_this->selectedName]["agc"] = _this->agc; config.conf["devices"][_this->selectedName]["agc"] = _this->agc;
config.release(true); config.release(true);
} }
@ -753,7 +753,7 @@ private:
openDevParams->devParams->rsp1aParams.rfNotchEnable = rsp1a_fmNotch; openDevParams->devParams->rsp1aParams.rfNotchEnable = rsp1a_fmNotch;
sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_Rsp1a_RfNotchControl, sdrplay_api_Update_Ext1_None); sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_Rsp1a_RfNotchControl, sdrplay_api_Update_Ext1_None);
} }
config.aquire(); config.acquire();
config.conf["devices"][selectedName]["fmNotch"] = rsp1a_fmNotch; config.conf["devices"][selectedName]["fmNotch"] = rsp1a_fmNotch;
config.release(true); config.release(true);
} }
@ -762,7 +762,7 @@ private:
openDevParams->devParams->rsp1aParams.rfNotchEnable = rsp1a_dabNotch; openDevParams->devParams->rsp1aParams.rfNotchEnable = rsp1a_dabNotch;
sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_Rsp1a_RfDabNotchControl, sdrplay_api_Update_Ext1_None); sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_Rsp1a_RfDabNotchControl, sdrplay_api_Update_Ext1_None);
} }
config.aquire(); config.acquire();
config.conf["devices"][selectedName]["dabNotch"] = rsp1a_dabNotch; config.conf["devices"][selectedName]["dabNotch"] = rsp1a_dabNotch;
config.release(true); config.release(true);
} }
@ -771,7 +771,7 @@ private:
channelParams->rsp1aTunerParams.biasTEnable = rsp1a_biasT; channelParams->rsp1aTunerParams.biasTEnable = rsp1a_biasT;
sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_Rsp1a_BiasTControl, sdrplay_api_Update_Ext1_None); sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_Rsp1a_BiasTControl, sdrplay_api_Update_Ext1_None);
} }
config.aquire(); config.acquire();
config.conf["devices"][selectedName]["biast"] = rsp1a_biasT; config.conf["devices"][selectedName]["biast"] = rsp1a_biasT;
config.release(true); config.release(true);
} }
@ -788,7 +788,7 @@ private:
sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_Rsp2_AntennaControl, sdrplay_api_Update_Ext1_None); sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_Rsp2_AntennaControl, sdrplay_api_Update_Ext1_None);
sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_Rsp2_AmPortSelect, sdrplay_api_Update_Ext1_None); sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_Rsp2_AmPortSelect, sdrplay_api_Update_Ext1_None);
} }
config.aquire(); config.acquire();
config.conf["devices"][selectedName]["antenna"] = rsp2_antennaPort; config.conf["devices"][selectedName]["antenna"] = rsp2_antennaPort;
config.release(true); config.release(true);
} }
@ -797,7 +797,7 @@ private:
channelParams->rsp2TunerParams.rfNotchEnable = rsp2_notch; channelParams->rsp2TunerParams.rfNotchEnable = rsp2_notch;
sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_Rsp2_RfNotchControl, sdrplay_api_Update_Ext1_None); sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_Rsp2_RfNotchControl, sdrplay_api_Update_Ext1_None);
} }
config.aquire(); config.acquire();
config.conf["devices"][selectedName]["notch"] = rsp2_notch; config.conf["devices"][selectedName]["notch"] = rsp2_notch;
config.release(true); config.release(true);
} }
@ -806,7 +806,7 @@ private:
channelParams->rsp2TunerParams.biasTEnable = rsp2_biasT; channelParams->rsp2TunerParams.biasTEnable = rsp2_biasT;
sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_Rsp2_BiasTControl, sdrplay_api_Update_Ext1_None); sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_Rsp2_BiasTControl, sdrplay_api_Update_Ext1_None);
} }
config.aquire(); config.acquire();
config.conf["devices"][selectedName]["biast"] = rsp2_biasT; config.conf["devices"][selectedName]["biast"] = rsp2_biasT;
config.release(true); config.release(true);
} }
@ -821,7 +821,7 @@ private:
if (running) { if (running) {
rspDuoSelectAntennaPort(rspduo_antennaPort); rspDuoSelectAntennaPort(rspduo_antennaPort);
} }
config.aquire(); config.acquire();
config.conf["devices"][selectedName]["antenna"] = rspduo_antennaPort; config.conf["devices"][selectedName]["antenna"] = rspduo_antennaPort;
config.release(true); config.release(true);
} }
@ -830,7 +830,7 @@ private:
channelParams->rspDuoTunerParams.rfNotchEnable = rspduo_fmNotch; channelParams->rspDuoTunerParams.rfNotchEnable = rspduo_fmNotch;
sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_RspDuo_RfNotchControl, sdrplay_api_Update_Ext1_None); sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_RspDuo_RfNotchControl, sdrplay_api_Update_Ext1_None);
} }
config.aquire(); config.acquire();
config.conf["devices"][selectedName]["fmNotch"] = rspduo_fmNotch; config.conf["devices"][selectedName]["fmNotch"] = rspduo_fmNotch;
config.release(true); config.release(true);
} }
@ -839,7 +839,7 @@ private:
channelParams->rspDuoTunerParams.rfDabNotchEnable = rspduo_dabNotch; channelParams->rspDuoTunerParams.rfDabNotchEnable = rspduo_dabNotch;
sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_RspDuo_RfDabNotchControl, sdrplay_api_Update_Ext1_None); sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_RspDuo_RfDabNotchControl, sdrplay_api_Update_Ext1_None);
} }
config.aquire(); config.acquire();
config.conf["devices"][selectedName]["dabNotch"] = rspduo_dabNotch; config.conf["devices"][selectedName]["dabNotch"] = rspduo_dabNotch;
config.release(true); config.release(true);
} }
@ -848,7 +848,7 @@ private:
channelParams->rspDuoTunerParams.tuner1AmNotchEnable = rspduo_amNotch; channelParams->rspDuoTunerParams.tuner1AmNotchEnable = rspduo_amNotch;
sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_RspDuo_Tuner1AmNotchControl, sdrplay_api_Update_Ext1_None); sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_RspDuo_Tuner1AmNotchControl, sdrplay_api_Update_Ext1_None);
} }
config.aquire(); config.acquire();
config.conf["devices"][selectedName]["amNotch"] = rspduo_amNotch; config.conf["devices"][selectedName]["amNotch"] = rspduo_amNotch;
config.release(true); config.release(true);
} }
@ -857,7 +857,7 @@ private:
channelParams->rspDuoTunerParams.biasTEnable = rspduo_biasT; channelParams->rspDuoTunerParams.biasTEnable = rspduo_biasT;
sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_RspDuo_BiasTControl, sdrplay_api_Update_Ext1_None); sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_RspDuo_BiasTControl, sdrplay_api_Update_Ext1_None);
} }
config.aquire(); config.acquire();
config.conf["devices"][selectedName]["biast"] = rspduo_biasT; config.conf["devices"][selectedName]["biast"] = rspduo_biasT;
config.release(true); config.release(true);
} }
@ -872,7 +872,7 @@ private:
openDevParams->devParams->rspDxParams.antennaSel = rspdx_antennaPorts[rspdx_antennaPort]; openDevParams->devParams->rspDxParams.antennaSel = rspdx_antennaPorts[rspdx_antennaPort];
sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_None, sdrplay_api_Update_RspDx_AntennaControl); sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_None, sdrplay_api_Update_RspDx_AntennaControl);
} }
config.aquire(); config.acquire();
config.conf["devices"][selectedName]["antenna"] = rspdx_antennaPort; config.conf["devices"][selectedName]["antenna"] = rspdx_antennaPort;
config.release(true); config.release(true);
} }
@ -882,7 +882,7 @@ private:
openDevParams->devParams->rspDxParams.rfNotchEnable = rspdx_fmNotch; openDevParams->devParams->rspDxParams.rfNotchEnable = rspdx_fmNotch;
sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_None, sdrplay_api_Update_RspDx_RfNotchControl); sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_None, sdrplay_api_Update_RspDx_RfNotchControl);
} }
config.aquire(); config.acquire();
config.conf["devices"][selectedName]["fmNotch"] = rspdx_fmNotch; config.conf["devices"][selectedName]["fmNotch"] = rspdx_fmNotch;
config.release(true); config.release(true);
} }
@ -891,7 +891,7 @@ private:
openDevParams->devParams->rspDxParams.rfDabNotchEnable = rspdx_dabNotch; openDevParams->devParams->rspDxParams.rfDabNotchEnable = rspdx_dabNotch;
sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_None, sdrplay_api_Update_RspDx_RfDabNotchControl); sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_None, sdrplay_api_Update_RspDx_RfDabNotchControl);
} }
config.aquire(); config.acquire();
config.conf["devices"][selectedName]["dabNotch"] = rspdx_dabNotch; config.conf["devices"][selectedName]["dabNotch"] = rspdx_dabNotch;
config.release(true); config.release(true);
} }
@ -900,7 +900,7 @@ private:
openDevParams->devParams->rspDxParams.biasTEnable = rspdx_biasT; openDevParams->devParams->rspDxParams.biasTEnable = rspdx_biasT;
sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_None, sdrplay_api_Update_RspDx_BiasTControl); sdrplay_api_Update(openDev.dev, openDev.tuner, sdrplay_api_Update_None, sdrplay_api_Update_RspDx_BiasTControl);
} }
config.aquire(); config.acquire();
config.conf["devices"][selectedName]["biast"] = rspdx_biasT; config.conf["devices"][selectedName]["biast"] = rspdx_biasT;
config.release(true); config.release(true);
} }

View File

@ -36,7 +36,7 @@ public:
refresh(); refresh();
// Select default device // Select default device
config.aquire(); config.acquire();
std::string devName = config.conf["device"]; std::string devName = config.conf["device"];
config.release(); config.release();
selectDevice(devName); selectDevice(devName);
@ -206,7 +206,7 @@ private:
SoapySDR::Device::unmake(dev); SoapySDR::Device::unmake(dev);
config.aquire(); config.acquire();
if (config.conf["devices"].contains(name)) { if (config.conf["devices"].contains(name)) {
if(config.conf["devices"][name].contains("antenna")) { if(config.conf["devices"][name].contains("antenna")) {
uiAntennaId = config.conf["devices"][name]["antenna"]; uiAntennaId = config.conf["devices"][name]["antenna"];
@ -273,7 +273,7 @@ private:
if (hasAgc) { if (hasAgc) {
conf["agc"] = agc; conf["agc"] = agc;
} }
config.aquire(); config.acquire();
config.conf["devices"][devArgs["label"]] = conf; config.conf["devices"][devArgs["label"]] = conf;
config.release(true); config.release(true);
} }
@ -363,7 +363,7 @@ private:
ImGui::SetNextItemWidth(menuWidth); ImGui::SetNextItemWidth(menuWidth);
if (ImGui::Combo(CONCAT("##_dev_select_", _this->name), &_this->devId, _this->txtDevList.c_str())) { if (ImGui::Combo(CONCAT("##_dev_select_", _this->name), &_this->devId, _this->txtDevList.c_str())) {
_this->selectDevice(_this->devList[_this->devId]["label"]); _this->selectDevice(_this->devList[_this->devId]["label"]);
config.aquire(); config.acquire();
config.conf["device"] = _this->devList[_this->devId]["label"]; config.conf["device"] = _this->devList[_this->devId]["label"];
config.release(true); config.release(true);
} }

View File

@ -199,7 +199,7 @@ void SpyServerClient::worker() {
spdlog::warn("Dev type: {0}", devInfo.DeviceType); spdlog::warn("Dev type: {0}", devInfo.DeviceType);
} }
// else if (type == MSG_TYPE_FLOAT_IQ) { // else if (type == MSG_TYPE_FLOAT_IQ) {
// //if (iqStream.aquire() < 0) { return; } // //if (iqStream.acquire() < 0) { return; }
// len = receiveSync(dummyBuf, msgHeader.BodySize); // len = receiveSync(dummyBuf, msgHeader.BodySize);
// //iqStream.write(msgHeader.BodySize); // //iqStream.write(msgHeader.BodySize);
// if (len < 0) { // if (len < 0) {

View File

@ -289,7 +289,7 @@ private:
if (compositeIn1.read() < 0) { return; } if (compositeIn1.read() < 0) { return; }
if (compositeIn2.read() < 0) { return; } if (compositeIn2.read() < 0) { return; }
uint8_t* buf = avhrrRGBImage.aquireNextLine(); uint8_t* buf = avhrrRGBImage.acquireNextLine();
float rg, b; float rg, b;
for (int i = 0; i < 2048; i++) { for (int i = 0; i < 2048; i++) {
b = ((float)compositeIn1.readBuf[i] * 255.0f) / 1024.0f; b = ((float)compositeIn1.readBuf[i] * 255.0f) / 1024.0f;
@ -308,7 +308,7 @@ private:
static void avhrr1Handler(uint16_t* data, int count, void* ctx) { static void avhrr1Handler(uint16_t* data, int count, void* ctx) {
NOAAHRPTDecoder* _this = (NOAAHRPTDecoder*)ctx; NOAAHRPTDecoder* _this = (NOAAHRPTDecoder*)ctx;
uint8_t* buf = _this->avhrr1Image.aquireNextLine(); uint8_t* buf = _this->avhrr1Image.acquireNextLine();
float val; float val;
for (int i = 0; i < 2048; i++) { for (int i = 0; i < 2048; i++) {
val = ((float)data[i] * 255.0f) / 1024.0f; val = ((float)data[i] * 255.0f) / 1024.0f;
@ -325,7 +325,7 @@ private:
static void avhrr2Handler(uint16_t* data, int count, void* ctx) { static void avhrr2Handler(uint16_t* data, int count, void* ctx) {
NOAAHRPTDecoder* _this = (NOAAHRPTDecoder*)ctx; NOAAHRPTDecoder* _this = (NOAAHRPTDecoder*)ctx;
uint8_t* buf = _this->avhrr2Image.aquireNextLine(); uint8_t* buf = _this->avhrr2Image.acquireNextLine();
float val; float val;
for (int i = 0; i < 2048; i++) { for (int i = 0; i < 2048; i++) {
val = ((float)data[i] * 255.0f) / 1024.0f; val = ((float)data[i] * 255.0f) / 1024.0f;
@ -342,7 +342,7 @@ private:
static void avhrr3Handler(uint16_t* data, int count, void* ctx) { static void avhrr3Handler(uint16_t* data, int count, void* ctx) {
NOAAHRPTDecoder* _this = (NOAAHRPTDecoder*)ctx; NOAAHRPTDecoder* _this = (NOAAHRPTDecoder*)ctx;
uint8_t* buf = _this->avhrr3Image.aquireNextLine(); uint8_t* buf = _this->avhrr3Image.acquireNextLine();
float val; float val;
for (int i = 0; i < 2048; i++) { for (int i = 0; i < 2048; i++) {
val = ((float)data[i] * 255.0f) / 1024.0f; val = ((float)data[i] * 255.0f) / 1024.0f;
@ -356,7 +356,7 @@ private:
static void avhrr4Handler(uint16_t* data, int count, void* ctx) { static void avhrr4Handler(uint16_t* data, int count, void* ctx) {
NOAAHRPTDecoder* _this = (NOAAHRPTDecoder*)ctx; NOAAHRPTDecoder* _this = (NOAAHRPTDecoder*)ctx;
uint8_t* buf = _this->avhrr4Image.aquireNextLine(); uint8_t* buf = _this->avhrr4Image.acquireNextLine();
float val; float val;
for (int i = 0; i < 2048; i++) { for (int i = 0; i < 2048; i++) {
val = ((float)data[i] * 255.0f) / 1024.0f; val = ((float)data[i] * 255.0f) / 1024.0f;
@ -370,7 +370,7 @@ private:
static void avhrr5Handler(uint16_t* data, int count, void* ctx) { static void avhrr5Handler(uint16_t* data, int count, void* ctx) {
NOAAHRPTDecoder* _this = (NOAAHRPTDecoder*)ctx; NOAAHRPTDecoder* _this = (NOAAHRPTDecoder*)ctx;
uint8_t* buf = _this->avhrr5Image.aquireNextLine(); uint8_t* buf = _this->avhrr5Image.acquireNextLine();
float val; float val;
for (int i = 0; i < 2048; i++) { for (int i = 0; i < 2048; i++) {
val = ((float)data[i] * 255.0f) / 1024.0f; val = ((float)data[i] * 255.0f) / 1024.0f;
@ -485,7 +485,7 @@ private:
static void visHandler(float* data, int count, void* ctx) { static void visHandler(float* data, int count, void* ctx) {
NOAAHRPTDecoder* _this = (NOAAHRPTDecoder*)ctx; NOAAHRPTDecoder* _this = (NOAAHRPTDecoder*)ctx;
memcpy(_this->symDiag.aquireBuffer(), data, 1024 * sizeof(float)); memcpy(_this->symDiag.acquireBuffer(), data, 1024 * sizeof(float));
_this->symDiag.releaseBuffer(); _this->symDiag.releaseBuffer();
} }