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

Method menuHandler

decoder_modules/radio/src/main.cpp:113–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111
112private:
113 static void menuHandler(void* ctx) {
114 RadioModule* _this = (RadioModule*)ctx;
115
116 if (!_this->enabled) { style::beginDisabled(); }
117
118 float menuWidth = ImGui::GetContentRegionAvailWidth();
119 ImGui::BeginGroup();
120
121 // TODO: Change VFO ref in signal path
122
123 ImGui::Columns(4, CONCAT("RadioModeColumns##_", _this->name), false);
124 if (ImGui::RadioButton(CONCAT("NFM##_", _this->name), _this->demodId == 0) && _this->demodId != 0) {
125 _this->selectDemodById(0);
126 }
127 if (ImGui::RadioButton(CONCAT("WFM##_", _this->name), _this->demodId == 1) && _this->demodId != 1) {
128 _this->selectDemodById(1);
129 }
130 ImGui::NextColumn();
131 if (ImGui::RadioButton(CONCAT("AM##_", _this->name), _this->demodId == 2) && _this->demodId != 2) {
132 _this->selectDemodById(2);
133 }
134 if (ImGui::RadioButton(CONCAT("DSB##_", _this->name), _this->demodId == 3) && _this->demodId != 3) {
135 _this->selectDemodById(3);
136 }
137 ImGui::NextColumn();
138 if (ImGui::RadioButton(CONCAT("USB##_", _this->name), _this->demodId == 4) && _this->demodId != 4) {
139 _this->selectDemodById(4);
140 }
141 if (ImGui::RadioButton(CONCAT("CW##_", _this->name), _this->demodId == 5) && _this->demodId != 5) {
142 _this->selectDemodById(5);
143 };
144 ImGui::NextColumn();
145 if (ImGui::RadioButton(CONCAT("LSB##_", _this->name), _this->demodId == 6) && _this->demodId != 6) {
146 _this->selectDemodById(6);
147 }
148 if (ImGui::RadioButton(CONCAT("RAW##_", _this->name), _this->demodId == 7) && _this->demodId != 7) {
149 _this->selectDemodById(7);
150 };
151 ImGui::Columns(1, CONCAT("EndRadioModeColumns##_", _this->name), false);
152
153 ImGui::EndGroup();
154
155 _this->currentDemod->showMenu();
156
157 if (!_this->enabled) { style::endDisabled(); }
158 }
159
160 static void sampleRateChangeHandler(float sampleRate, void* ctx) {
161 RadioModule* _this = (RadioModule*)ctx;

Callers

nothing calls this directly

Calls 5

beginDisabledFunction · 0.85
endDisabledFunction · 0.85
selectDemodByIdMethod · 0.80
showMenuMethod · 0.45

Tested by

no test coverage detected