| 111 | |
| 112 | private: |
| 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; |
nothing calls this directly
no test coverage detected