mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-10 06:18:57 -05:00
Modem factory init
This commit is contained in:
parent
a1a6a467e8
commit
e33b8952d4
@ -164,6 +164,14 @@ bool CubicSDR::OnInit() {
|
||||
|
||||
wxApp::SetAppName("CubicSDR");
|
||||
|
||||
Modem::addModemFactory("FM", new ModemFM);
|
||||
Modem::addModemFactory("WBFM", new ModemFMStereo);
|
||||
Modem::addModemFactory("AM", new ModemAM);
|
||||
Modem::addModemFactory("LSB", new ModemLSB);
|
||||
Modem::addModemFactory("USB", new ModemUSB);
|
||||
Modem::addModemFactory("DSB", new ModemDSB);
|
||||
Modem::addModemFactory("I/Q", new ModemIQ);
|
||||
|
||||
frequency = wxGetApp().getConfig()->getCenterFreq();
|
||||
offset = 0;
|
||||
ppm = 0;
|
||||
|
@ -27,6 +27,14 @@
|
||||
#include "SpectrumVisualProcessor.h"
|
||||
#include "SpectrumVisualDataThread.h"
|
||||
#include "SDRDevices.h"
|
||||
#include "Modem.h"
|
||||
#include "ModemFM.h"
|
||||
#include "ModemFMStereo.h"
|
||||
#include "ModemAM.h"
|
||||
#include "ModemUSB.h"
|
||||
#include "ModemLSB.h"
|
||||
#include "ModemDSB.h"
|
||||
#include "ModemIQ.h"
|
||||
|
||||
#include <wx/cmdline.h>
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
ModemFactoryList Modem::modemFactories;
|
||||
|
||||
void Modem::addModemFactory(std::string modemName, ModemFactoryFunc *factoryFunc) {
|
||||
modemFactories[modemName] = factoryFunc;
|
||||
void Modem::addModemFactory(std::string modemName, Modem *factorySingle) {
|
||||
modemFactories[modemName] = factorySingle;
|
||||
}
|
||||
|
||||
ModemFactoryList Modem::getFactories() {
|
||||
|
@ -30,12 +30,11 @@ public:
|
||||
};
|
||||
|
||||
class Modem;
|
||||
typedef Modem *(Modem::*ModemFactoryFunc)();
|
||||
typedef std::map<std::string,ModemFactoryFunc *> ModemFactoryList;
|
||||
typedef std::map<std::string,Modem *> ModemFactoryList;
|
||||
|
||||
class Modem {
|
||||
public:
|
||||
static void addModemFactory(std::string modemName, ModemFactoryFunc *factoryFunc);
|
||||
static void addModemFactory(std::string modemName, Modem *factorySingle);
|
||||
static ModemFactoryList getFactories();
|
||||
|
||||
virtual Modem *factory();
|
||||
|
Loading…
Reference in New Issue
Block a user