MCPcopy Create free account
hub / github.com/cjcliffe/CubicSDR / OnChange

Method OnChange

src/ModemProperties.cpp:227–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227void ModemProperties::OnChange(wxPropertyGridEvent &event) {
228 if (!demodContext || !demodContext->isActive()) {
229 return;
230 }
231
232 std::map<std::string, wxPGProperty *>::const_iterator prop_i;
233
234 if (event.m_property == defaultProps["._audio_output"]) {
235 int sel = event.m_property->GetChoiceSelection();
236
237 outputArg.value = outputArg.options[sel];
238
239 if (demodContext) {
240 try {
241 demodContext->setOutputDevice(std::stoi(outputArg.value));
242 } catch (const exception &) {
243 // .. this should never happen ;)
244 }
245
246 wxGetApp().getAppFrame()->setScopeDeviceName(outputArg.optionNames[sel]);
247 }
248
249 return;
250 }
251
252 for (prop_i = props.begin(); prop_i != props.end(); prop_i++) {
253 if (prop_i->second == event.m_property) {
254 std::string key = prop_i->first;
255 std::string value = readProperty(prop_i->first);
256 demodContext->writeModemSetting(key, value);
257 return;
258 }
259 }
260}
261
262void ModemProperties::OnCollapse(wxPropertyGridEvent & /* event */) {
263 collapsed = true;

Callers

nothing calls this directly

Calls 5

setOutputDeviceMethod · 0.80
setScopeDeviceNameMethod · 0.80
getAppFrameMethod · 0.80
isActiveMethod · 0.45
writeModemSettingMethod · 0.45

Tested by

no test coverage detected