| 32 | class RadioModule : public ModuleManager::Instance { |
| 33 | public: |
| 34 | RadioModule(std::string name) { |
| 35 | this->name = name; |
| 36 | |
| 37 | vfo = sigpath::vfoManager.createVFO(name, ImGui::WaterfallVFO::REF_CENTER, 0, 200000, 200000, 50000, 200000, false); |
| 38 | |
| 39 | ns.init(vfo->output); |
| 40 | |
| 41 | config.acquire(); |
| 42 | if (!config.conf.contains(name)) { |
| 43 | config.conf[name]["selectedDemodId"] = 1; |
| 44 | } |
| 45 | demodId = config.conf[name]["selectedDemodId"]; |
| 46 | config.release(true); |
| 47 | |
| 48 | wfmDemod.init(name, vfo, audioSampRate, 200000, &config); |
| 49 | fmDemod.init(name, vfo, audioSampRate, 12500, &config); |
| 50 | amDemod.init(name, vfo, audioSampRate, 12500, &config); |
| 51 | usbDemod.init(name, vfo, audioSampRate, 3000, &config); |
| 52 | lsbDemod.init(name, vfo, audioSampRate, 3000, &config); |
| 53 | dsbDemod.init(name, vfo, audioSampRate, 6000, &config); |
| 54 | rawDemod.init(name, vfo, audioSampRate, audioSampRate, &config); |
| 55 | cwDemod.init(name, vfo, audioSampRate, 200, &config); |
| 56 | |
| 57 | srChangeHandler.ctx = this; |
| 58 | srChangeHandler.handler = sampleRateChangeHandler; |
| 59 | stream.init(wfmDemod.getOutput(), &srChangeHandler, audioSampRate); |
| 60 | sigpath::sinkManager.registerStream(name, &stream); |
| 61 | |
| 62 | selectDemodById(demodId); |
| 63 | |
| 64 | stream.start(); |
| 65 | |
| 66 | gui::menu.registerEntry(name, menuHandler, this, this); |
| 67 | |
| 68 | core::modComManager.registerInterface("radio", name, moduleInterfaceHandler, this); |
| 69 | } |
| 70 | |
| 71 | ~RadioModule() { |
| 72 | core::modComManager.unregisterInterface(name); |
nothing calls this directly
no test coverage detected