MCPcopy Create free account
hub / github.com/AlexandreRouma/SDRPlusPlus / sdrpp_main

Function sdrpp_main

core/src/core.cpp:102–522  ·  view source on GitHub ↗

main

Source from the content-addressed store, hash-verified

100
101// main
102int sdrpp_main(int argc, char *argv[]) {
103 spdlog::info("SDR++ v" VERSION_STR);
104
105 // Load default options and parse command line
106 options::loadDefaults();
107 if (!options::parse(argc, argv)) { return -1; }
108
109#ifdef _WIN32
110 if (!options::opts.showConsole) { FreeConsole(); }
111#endif
112
113 // Check root directory
114 if (!std::filesystem::exists(options::opts.root)) {
115 spdlog::warn("Root directory {0} does not exist, creating it", options::opts.root);
116 if (!std::filesystem::create_directory(options::opts.root)) {
117 spdlog::error("Could not create root directory {0}", options::opts.root);
118 return -1;
119 }
120 }
121
122 if (!std::filesystem::is_directory(options::opts.root)) {
123 spdlog::error("{0} is not a directory", options::opts.root);
124 return -1;
125 }
126
127 // ======== DEFAULT CONFIG ========
128 json defConfig;
129 defConfig["bandColors"]["amateur"] = "#FF0000FF";
130 defConfig["bandColors"]["aviation"] = "#00FF00FF";
131 defConfig["bandColors"]["broadcast"] = "#0000FFFF";
132 defConfig["bandColors"]["marine"] = "#00FFFFFF";
133 defConfig["bandColors"]["military"] = "#FFFF00FF";
134 defConfig["bandPlan"] = "General";
135 defConfig["bandPlanEnabled"] = true;
136 defConfig["bandPlanPos"] = 0;
137 defConfig["centerTuning"] = false;
138 defConfig["colorMap"] = "Classic";
139 defConfig["fastFFT"] = false;
140 defConfig["fftHeight"] = 300;
141 defConfig["fftRate"] = 20;
142 defConfig["fftSize"] = 65536;
143 defConfig["fftWindow"] = 1;
144 defConfig["frequency"] = 100000000.0;
145 defConfig["fullWaterfallUpdate"] = false;
146 defConfig["max"] = 0.0;
147 defConfig["maximized"] = false;
148
149 // Menu
150 defConfig["menuElements"] = json::array();
151
152 defConfig["menuElements"][0]["name"] = "Source";
153 defConfig["menuElements"][0]["open"] = true;
154
155 defConfig["menuElements"][1]["name"] = "Radio";
156 defConfig["menuElements"][1]["open"] = true;
157
158 defConfig["menuElements"][2]["name"] = "Recorder";
159 defConfig["menuElements"][2]["open"] = true;

Callers 1

mainFunction · 0.85

Calls 15

loadDefaultsFunction · 0.85
arrayClass · 0.85
server_mainFunction · 0.85
stbi_loadFunction · 0.85
stbir_resize_uint8Function · 0.85
stbi_image_freeFunction · 0.85
ImGui_ImplOpenGL3_InitFunction · 0.85
loadFontsFunction · 0.85
setWindowFunction · 0.85
loadFunction · 0.85
loadFromDirFunction · 0.85

Tested by

no test coverage detected