mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-25 20:07:51 +02:00
@ -66,7 +66,7 @@ void ConfigManager::disableAutoSave() {
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigManager::aquire() {
|
||||
void ConfigManager::acquire() {
|
||||
mtx.lock();
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ public:
|
||||
void save(bool lock = true);
|
||||
void enableAutoSave();
|
||||
void disableAutoSave();
|
||||
void aquire();
|
||||
void acquire();
|
||||
void release(bool changed = false);
|
||||
|
||||
json conf;
|
||||
|
@ -213,8 +213,8 @@ int sdrpp_main(int argc, char *argv[]) {
|
||||
core::configManager.load(defConfig);
|
||||
core::configManager.enableAutoSave();
|
||||
|
||||
|
||||
core::configManager.aquire();
|
||||
|
||||
core::configManager.acquire();
|
||||
// Fix missing elements in config
|
||||
for (auto const& item : defConfig.items()) {
|
||||
if (!core::configManager.conf.contains(item.key())) {
|
||||
@ -253,8 +253,8 @@ int sdrpp_main(int argc, char *argv[]) {
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
|
||||
#endif
|
||||
|
||||
core::configManager.aquire();
|
||||
|
||||
core::configManager.acquire();
|
||||
int winWidth = core::configManager.conf["windowSize"]["w"];
|
||||
int winHeight = core::configManager.conf["windowSize"]["h"];
|
||||
maximized = core::configManager.conf["maximized"];
|
||||
@ -375,7 +375,7 @@ int sdrpp_main(int argc, char *argv[]) {
|
||||
|
||||
if (_maximized != maximized) {
|
||||
_maximized = maximized;
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["maximized"]= _maximized;
|
||||
if (!maximized) {
|
||||
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) {
|
||||
winWidth = _winWidth;
|
||||
winHeight = _winHeight;
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["windowSize"]["w"] = winWidth;
|
||||
core::configManager.conf["windowSize"]["h"] = winHeight;
|
||||
core::configManager.release(true);
|
||||
|
@ -70,7 +70,7 @@ namespace dsp {
|
||||
while (run() >= 0);
|
||||
}
|
||||
|
||||
void aquire() {
|
||||
void acquire() {
|
||||
ctrlMtx.lock();
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ void MainWindow::init() {
|
||||
|
||||
credits::init();
|
||||
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
json menuElements = core::configManager.conf["menuElements"];
|
||||
std::string modulesDir = core::configManager.conf["modulesDirectory"];
|
||||
std::string resourcesDir = core::configManager.conf["resourcesDirectory"];
|
||||
@ -109,7 +109,7 @@ void MainWindow::init() {
|
||||
}
|
||||
|
||||
// Read module config
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
std::vector<std::string> modules = core::configManager.conf["modules"];
|
||||
std::map<std::string, std::string> modList = core::configManager.conf["moduleInstances"];
|
||||
core::configManager.release();
|
||||
@ -162,7 +162,7 @@ void MainWindow::init() {
|
||||
|
||||
// Update UI settings
|
||||
LoadingScreen::show("Loading configuration");
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
fftMin = core::configManager.conf["min"];
|
||||
fftMax = core::configManager.conf["max"];
|
||||
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) {
|
||||
MainWindow* _this = (MainWindow*)ctx;
|
||||
std::string name = vfo->getName();
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
if (!core::configManager.conf["vfoOffsets"].contains(name)) {
|
||||
core::configManager.release();
|
||||
return;
|
||||
@ -249,7 +249,7 @@ void MainWindow::draw() {
|
||||
}
|
||||
gui::freqSelect.setFrequency(gui::waterfall.getCenterFrequency() + vfo->generalOffset);
|
||||
gui::freqSelect.frequencyChanged = false;
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["vfoOffsets"][gui::waterfall.selectedVFO] = vfo->generalOffset;
|
||||
core::configManager.release(true);
|
||||
}
|
||||
@ -273,7 +273,7 @@ void MainWindow::draw() {
|
||||
vfo->lowerOffsetChanged = false;
|
||||
vfo->upperOffsetChanged = false;
|
||||
}
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["frequency"] = gui::waterfall.getCenterFrequency();
|
||||
if (vfo != NULL) {
|
||||
core::configManager.conf["vfoOffsets"][gui::waterfall.selectedVFO] = vfo->generalOffset;
|
||||
@ -291,7 +291,7 @@ void MainWindow::draw() {
|
||||
else {
|
||||
gui::freqSelect.setFrequency(gui::waterfall.getCenterFrequency());
|
||||
}
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["frequency"] = gui::waterfall.getCenterFrequency();
|
||||
core::configManager.release(true);
|
||||
}
|
||||
@ -299,7 +299,7 @@ void MainWindow::draw() {
|
||||
int _fftHeight = gui::waterfall.getFFTHeight();
|
||||
if (fftHeight != _fftHeight) {
|
||||
fftHeight = _fftHeight;
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["fftHeight"] = fftHeight;
|
||||
core::configManager.release(true);
|
||||
}
|
||||
@ -314,7 +314,7 @@ void MainWindow::draw() {
|
||||
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)) {
|
||||
showMenu = !showMenu;
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["showMenu"] = showMenu;
|
||||
core::configManager.release(true);
|
||||
}
|
||||
@ -357,7 +357,7 @@ void MainWindow::draw() {
|
||||
ImGui::PushID(ImGui::GetID("sdrpp_ena_st_btn"));
|
||||
if (ImGui::ImageButton(icons::CENTER_TUNING, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5)) {
|
||||
tuningMode = tuner::TUNER_MODE_NORMAL;
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["centerTuning"] = false;
|
||||
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)) {
|
||||
tuningMode = tuner::TUNER_MODE_CENTER;
|
||||
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.release(true);
|
||||
}
|
||||
@ -421,7 +421,7 @@ void MainWindow::draw() {
|
||||
if(!down && grabbingMenu) {
|
||||
grabbingMenu = false;
|
||||
menuWidth = newWidth;
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["menuWidth"] = menuWidth;
|
||||
core::configManager.release(true);
|
||||
}
|
||||
@ -439,7 +439,7 @@ void MainWindow::draw() {
|
||||
float menuColumnWidth = ImGui::GetContentRegionAvailWidth();
|
||||
|
||||
if (gui::menu.draw(firstMenuRender)) {
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
json arr = json::array();
|
||||
for (int i = 0; i < gui::menu.order.size(); i++) {
|
||||
arr[i]["name"] = gui::menu.order[i].name;
|
||||
@ -513,7 +513,7 @@ void MainWindow::draw() {
|
||||
nfreq = roundl(nfreq / vfo->snapInterval) * vfo->snapInterval;
|
||||
tuner::tune(tuningMode, gui::waterfall.selectedVFO, nfreq);
|
||||
}
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["frequency"] = gui::waterfall.getCenterFrequency();
|
||||
if (vfo != NULL) {
|
||||
core::configManager.conf["vfoOffsets"][gui::waterfall.selectedVFO] = vfo->generalOffset;
|
||||
@ -534,7 +534,7 @@ void MainWindow::draw() {
|
||||
}
|
||||
tuner::tune(tuningMode, gui::waterfall.selectedVFO, nfreq);
|
||||
gui::freqSelect.setFrequency(nfreq);
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["frequency"] = gui::waterfall.getCenterFrequency();
|
||||
if (vfo != NULL) {
|
||||
core::configManager.conf["vfoOffsets"][gui::waterfall.selectedVFO] = vfo->generalOffset;
|
||||
@ -563,7 +563,7 @@ void MainWindow::draw() {
|
||||
ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - 10);
|
||||
if (ImGui::VSliderFloat("##_8_", ImVec2(20.0, 150.0), &fftMax, 0.0, -160.0f, "")) {
|
||||
fftMax = std::max<float>(fftMax, fftMin + 10);
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["max"] = fftMax;
|
||||
core::configManager.release(true);
|
||||
}
|
||||
@ -575,7 +575,7 @@ void MainWindow::draw() {
|
||||
ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - 10);
|
||||
if (ImGui::VSliderFloat("##_9_", ImVec2(20.0, 150.0), &fftMin, 0.0, -160.0f, "")) {
|
||||
fftMin = std::min<float>(fftMax - 10, fftMin);
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["min"] = fftMin;
|
||||
core::configManager.release(true);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ namespace bandplanmenu {
|
||||
ImGui::PushItemWidth(menuColumnWidth);
|
||||
if (ImGui::Combo("##_bandplan_name_", &bandplanId, bandplan::bandplanNameTxt.c_str())) {
|
||||
gui::waterfall.bandplan = &bandplan::bandplans[bandplan::bandplanNames[bandplanId]];
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["bandPlan"] = bandplan::bandplanNames[bandplanId];
|
||||
core::configManager.release(true);
|
||||
}
|
||||
@ -49,14 +49,14 @@ namespace bandplanmenu {
|
||||
ImGui::SetNextItemWidth(menuColumnWidth - ImGui::GetCursorPosX());
|
||||
if (ImGui::Combo("##_bandplan_pos_", &bandPlanPos, bandPlanPosTxt)) {
|
||||
gui::waterfall.setBandPlanPos(bandPlanPos);
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["bandPlanPos"] = bandPlanPos;
|
||||
core::configManager.release(true);
|
||||
}
|
||||
|
||||
if (ImGui::Checkbox("Enabled", &bandPlanEnabled)) {
|
||||
bandPlanEnabled ? gui::waterfall.showBandplan() : gui::waterfall.hideBandplan();
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["bandPlanEnabled"] = bandPlanEnabled;
|
||||
core::configManager.release(true);
|
||||
}
|
||||
|
@ -80,21 +80,21 @@ namespace displaymenu {
|
||||
if (ImGui::Checkbox("Show Waterfall##_sdrpp", &showWaterfall) || ImGui::IsKeyPressed(GLFW_KEY_HOME, false)) {
|
||||
if (ImGui::IsKeyPressed(GLFW_KEY_HOME, false)) { showWaterfall = !showWaterfall; }
|
||||
showWaterfall ? gui::waterfall.showWaterfall() : gui::waterfall.hideWaterfall();
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["showWaterfall"] = showWaterfall;
|
||||
core::configManager.release(true);
|
||||
}
|
||||
|
||||
if (ImGui::Checkbox("Fast FFT##_sdrpp", &fastFFT)) {
|
||||
gui::waterfall.setFastFFT(fastFFT);
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["fastFFT"] = fastFFT;
|
||||
core::configManager.release(true);
|
||||
}
|
||||
|
||||
if (ImGui::Checkbox("Full Waterfall Update##_sdrpp", &fullWaterfallUpdate)) {
|
||||
gui::waterfall.setFullWaterfallUpdate(fullWaterfallUpdate);
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["fullWaterfallUpdate"] = fullWaterfallUpdate;
|
||||
core::configManager.release(true);
|
||||
}
|
||||
@ -104,7 +104,7 @@ namespace displaymenu {
|
||||
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
|
||||
if (ImGui::Combo("##sdrpp_fft_size", &fftSizeId, FFTSizesStr)) {
|
||||
gui::mainWindow.setFFTSize(FFTSizes[fftSizeId]);
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["fftSize"] = FFTSizes[fftSizeId];
|
||||
core::configManager.release(true);
|
||||
}
|
||||
@ -114,7 +114,7 @@ namespace displaymenu {
|
||||
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
|
||||
if (ImGui::Combo("##sdrpp_fft_window", &selectedWindow, "Rectangular\0Blackman\0")) {
|
||||
gui::mainWindow.setFFTWindow(selectedWindow);
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["fftWindow"] = selectedWindow;
|
||||
core::configManager.release(true);
|
||||
}
|
||||
@ -126,7 +126,7 @@ namespace displaymenu {
|
||||
if (ImGui::Combo("##_sdrpp_color_map_sel", &colorMapId, colorMapNamesTxt.c_str())) {
|
||||
colormaps::Map map = colormaps::maps[colorMapNames[colorMapId]];
|
||||
gui::waterfall.updatePalletteFromArray(map.map, map.entryCount);
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["colorMap"] = colorMapNames[colorMapId];
|
||||
core::configManager.release(true);
|
||||
colorMapAuthor = map.author;
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
namespace sinkmenu {
|
||||
void init() {
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
sigpath::sinkManager.loadSinksFromConfig();
|
||||
core::configManager.release();
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ namespace sourecmenu {
|
||||
}
|
||||
|
||||
void init() {
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
std::string name = core::configManager.conf["source"];
|
||||
auto it = std::find(sigpath::sourceManager.sourceNames.begin(), sigpath::sourceManager.sourceNames.end(), name);
|
||||
if (it != sigpath::sourceManager.sourceNames.end()) {
|
||||
@ -71,11 +71,11 @@ namespace sourecmenu {
|
||||
float itemWidth = ImGui::GetContentRegionAvailWidth();
|
||||
|
||||
if (gui::mainWindow.sdrIsRunning()) { style::beginDisabled(); }
|
||||
|
||||
|
||||
ImGui::SetNextItemWidth(itemWidth);
|
||||
if (ImGui::Combo("##source", &sourceId, items.c_str())) {
|
||||
sigpath::sourceManager.selectSource(sigpath::sourceManager.sourceNames[sourceId]);
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["source"] = sigpath::sourceManager.sourceNames[sourceId];
|
||||
core::configManager.release(true);
|
||||
}
|
||||
@ -89,7 +89,7 @@ namespace sourecmenu {
|
||||
ImGui::SetNextItemWidth(itemWidth - ImGui::GetCursorPosX());
|
||||
if (ImGui::Combo("##_sdrpp_offset_mode", &offsetMode, offsetModesTxt)) {
|
||||
updateOffset();
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["offsetMode"] = offsetMode;
|
||||
core::configManager.release(true);
|
||||
}
|
||||
@ -100,7 +100,7 @@ namespace sourecmenu {
|
||||
if (offsetMode == OFFSET_MODE_CUSTOM) {
|
||||
if (ImGui::InputDouble("##freq_offset", &customOffset, 1.0, 100.0)) {
|
||||
updateOffset();
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["offset"] = customOffset;
|
||||
core::configManager.release(true);
|
||||
}
|
||||
@ -110,6 +110,6 @@ namespace sourecmenu {
|
||||
ImGui::InputDouble("##freq_offset", &effectiveOffset, 1.0, 100.0);
|
||||
style::endDisabled();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ namespace thememenu {
|
||||
void init(std::string resDir) {
|
||||
// TODO: Not hardcode theme directory
|
||||
gui::themeManager.loadThemesFromDir(resDir + "/themes/");
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
std::string selectedThemeName = core::configManager.conf["theme"];
|
||||
core::configManager.release();
|
||||
|
||||
@ -39,7 +39,7 @@ namespace thememenu {
|
||||
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
|
||||
if (ImGui::Combo("##theme_select_combo", &themeId, themeNamesTxt.c_str())) {
|
||||
gui::themeManager.applyTheme(themeNames[themeId]);
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["theme"] = themeNames[themeId];
|
||||
core::configManager.release(true);
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ namespace vfo_color_menu {
|
||||
void init() {
|
||||
// Load colors from config
|
||||
bool modified = false;
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
json conf = core::configManager.conf["vfoColors"];
|
||||
for (auto& [name, val] : conf.items()) {
|
||||
// If not a string, repair with default
|
||||
@ -90,7 +90,7 @@ namespace vfo_color_menu {
|
||||
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);
|
||||
hue += delta;
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
char buf[16];
|
||||
sprintf(buf, "#%02X%02X%02X", (int)roundf(r * 255), (int)roundf(g * 255), (int)roundf(b * 255));
|
||||
core::configManager.conf["vfoColors"][name] = buf;
|
||||
@ -103,7 +103,7 @@ namespace vfo_color_menu {
|
||||
for (auto& [name, vfo] : gui::waterfall.vfos) {
|
||||
vfoColors[name] = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
vfo->color = IM_COL32(255, 255, 255, 50);
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
char buf[16];
|
||||
core::configManager.conf["vfoColors"][name] = "#FFFFFF";
|
||||
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)) {
|
||||
vfoColors[name] = col;
|
||||
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];
|
||||
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;
|
||||
|
@ -30,7 +30,7 @@ namespace ImGui {
|
||||
}
|
||||
}
|
||||
|
||||
dsp::complex_t* ConstellationDiagram::aquireBuffer() {
|
||||
dsp::complex_t* ConstellationDiagram::acquireBuffer() {
|
||||
bufferMtx.lock();
|
||||
return buffer;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ namespace ImGui {
|
||||
|
||||
void draw(const ImVec2& size_arg = ImVec2(0, 0));
|
||||
|
||||
dsp::complex_t* aquireBuffer();
|
||||
dsp::complex_t* acquireBuffer();
|
||||
|
||||
void releaseBuffer();
|
||||
|
||||
|
@ -42,7 +42,7 @@ namespace ImGui {
|
||||
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();
|
||||
|
||||
int oldLineCount = _lineCount;
|
||||
|
@ -13,7 +13,7 @@ namespace ImGui {
|
||||
|
||||
void draw(const ImVec2& size_arg = ImVec2(0, 0));
|
||||
|
||||
uint8_t* aquireNextLine(int count = 1);
|
||||
uint8_t* acquireNextLine(int count = 1);
|
||||
|
||||
void releaseNextLine();
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace ImGui {
|
||||
}
|
||||
}
|
||||
|
||||
float* SymbolDiagram::aquireBuffer() {
|
||||
float* SymbolDiagram::acquireBuffer() {
|
||||
bufferMtx.lock();
|
||||
return buffer;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ namespace ImGui {
|
||||
|
||||
void draw(const ImVec2& size_arg = ImVec2(0, 0));
|
||||
|
||||
float* aquireBuffer();
|
||||
float* acquireBuffer();
|
||||
|
||||
void releaseBuffer();
|
||||
|
||||
|
@ -110,7 +110,7 @@ void SinkManager::registerStream(std::string name, SinkManager::Stream* stream)
|
||||
streamNames.push_back(name);
|
||||
|
||||
// Load config
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
bool available = core::configManager.conf["streams"].contains(name);
|
||||
core::configManager.release();
|
||||
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()));
|
||||
if (ImGui::ImageButton(icons::MUTED, ImVec2(height, height), ImVec2(0, 0), ImVec2(1, 1), btwBorder)) {
|
||||
stream->volumeAjust.setMuted(false);
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
saveStreamConfig(name);
|
||||
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()));
|
||||
if (ImGui::ImageButton(icons::UNMUTED, ImVec2(height, height), ImVec2(0, 0), ImVec2(1, 1), btwBorder)) {
|
||||
stream->volumeAjust.setMuted(true);
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
saveStreamConfig(name);
|
||||
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);
|
||||
if (ImGui::SliderFloat((prefix + name).c_str(), &stream->guiVolume, 0.0f, 1.0f, "")) {
|
||||
stream->setVolume(stream->guiVolume);
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
saveStreamConfig(name);
|
||||
core::configManager.release(true);
|
||||
}
|
||||
@ -267,7 +267,7 @@ void SinkManager::saveStreamConfig(std::string name) {
|
||||
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() {
|
||||
for (auto const& [name, stream] : streams) {
|
||||
if (!core::configManager.conf["streams"].contains(name)) { continue; }
|
||||
@ -301,7 +301,7 @@ void SinkManager::showMenu() {
|
||||
if (stream->running) {
|
||||
stream->sink->start();
|
||||
}
|
||||
core::configManager.aquire();
|
||||
core::configManager.acquire();
|
||||
saveStreamConfig(name);
|
||||
core::configManager.release(true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user