mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-30 06:17:49 +02:00
@ -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;
|
||||
|
Reference in New Issue
Block a user