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

Method menuHandler

misc_modules/recorder/src/main.cpp:187–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185 }
186
187 static void menuHandler(void* ctx) {
188 RecorderModule* _this = (RecorderModule*)ctx;
189 float menuColumnWidth = ImGui::GetContentRegionAvailWidth();
190
191 // Recording mode
192 if (_this->recording) { style::beginDisabled(); }
193 ImGui::BeginGroup();
194 ImGui::Columns(2, CONCAT("AirspyGainModeColumns##_", _this->name), false);
195 if (ImGui::RadioButton(CONCAT("Baseband##_recmode_", _this->name), _this->recMode == RECORDER_MODE_BASEBAND)) {
196 _this->recMode = RECORDER_MODE_BASEBAND;
197 config.acquire();
198 config.conf[_this->name]["mode"] = _this->recMode;
199 config.release(true);
200 }
201 ImGui::NextColumn();
202 if (ImGui::RadioButton(CONCAT("Audio##_recmode_", _this->name), _this->recMode == RECORDER_MODE_AUDIO)) {
203 _this->recMode = RECORDER_MODE_AUDIO;
204 config.acquire();
205 config.conf[_this->name]["mode"] = _this->recMode;
206 config.release(true);
207 }
208 ImGui::Columns(1, CONCAT("EndAirspyGainModeColumns##_", _this->name), false);
209 ImGui::EndGroup();
210 if (_this->recording) { style::endDisabled(); }
211
212 // Recording path
213 if (_this->folderSelect.render("##_recorder_fold_" + _this->name)) {
214 if (_this->folderSelect.pathIsValid()) {
215 config.acquire();
216 config.conf[_this->name]["recPath"] = _this->folderSelect.path;
217 config.release(true);
218 }
219 }
220
221 // Mode specific menu
222 if (_this->recMode == RECORDER_MODE_AUDIO) {
223 _this->audioMenu(menuColumnWidth);
224 }
225 else {
226 _this->basebandMenu(menuColumnWidth);
227 }
228 }
229
230 void basebandMenu(float menuColumnWidth) {
231 if (!folderSelect.pathIsValid()) { style::beginDisabled(); }

Callers

nothing calls this directly

Calls 9

beginDisabledFunction · 0.85
endDisabledFunction · 0.85
audioMenuMethod · 0.80
basebandMenuMethod · 0.80
acquireMethod · 0.45
releaseMethod · 0.45
renderMethod · 0.45
pathIsValidMethod · 0.45

Tested by

no test coverage detected