2014-10-27 20:05:40 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
//WX_GL_CORE_PROFILE 1
|
|
|
|
//WX_GL_MAJOR_VERSION 3
|
|
|
|
//WX_GL_MINOR_VERSION 2
|
|
|
|
|
2014-11-23 19:39:27 -05:00
|
|
|
#include <thread>
|
|
|
|
|
2015-02-09 20:49:21 -05:00
|
|
|
#include "GLExt.h"
|
2014-10-27 21:22:29 -04:00
|
|
|
#include "PrimaryGLContext.h"
|
2014-10-27 20:05:40 -04:00
|
|
|
|
2014-11-23 19:39:27 -05:00
|
|
|
#include "ThreadQueue.h"
|
|
|
|
#include "SDRThread.h"
|
2014-11-29 13:58:20 -05:00
|
|
|
#include "SDRPostThread.h"
|
2014-11-23 19:39:27 -05:00
|
|
|
#include "AudioThread.h"
|
|
|
|
#include "DemodulatorMgr.h"
|
2015-04-13 19:58:34 -04:00
|
|
|
#include "AppConfig.h"
|
2014-11-23 19:39:27 -05:00
|
|
|
|
2014-12-08 02:16:06 -05:00
|
|
|
#define NUM_DEMODULATORS 1
|
2014-12-06 21:55:05 -05:00
|
|
|
|
2014-10-28 21:39:59 -04:00
|
|
|
class CubicSDR: public wxApp {
|
2014-10-27 20:05:40 -04:00
|
|
|
public:
|
2014-11-30 17:11:29 -05:00
|
|
|
CubicSDR() :
|
2015-01-20 19:13:49 -05:00
|
|
|
m_glContext(NULL), frequency(DEFAULT_FREQ), sdrThread(NULL), sdrPostThread(NULL), threadCmdQueueSDR(NULL), iqVisualQueue(NULL), iqPostDataQueue(NULL), audioVisualQueue(NULL), t_SDR(NULL), t_PostSDR(NULL), sampleRate(DEFAULT_SAMPLE_RATE), offset(0) {
|
2014-11-30 17:11:29 -05:00
|
|
|
|
2014-10-28 21:39:59 -04:00
|
|
|
}
|
2014-10-27 20:05:40 -04:00
|
|
|
|
2014-10-27 21:22:29 -04:00
|
|
|
PrimaryGLContext &GetContext(wxGLCanvas *canvas);
|
2014-10-27 20:05:40 -04:00
|
|
|
|
|
|
|
virtual bool OnInit();
|
|
|
|
virtual int OnExit();
|
|
|
|
|
2015-01-04 17:11:20 -05:00
|
|
|
void setFrequency(long long freq);
|
|
|
|
long long getFrequency();
|
2014-11-23 19:39:27 -05:00
|
|
|
|
2015-01-06 00:57:57 -05:00
|
|
|
void setOffset(long long ofs);
|
|
|
|
long long getOffset();
|
|
|
|
|
2015-01-11 17:08:16 -05:00
|
|
|
void setSampleRate(long long rate_in);
|
|
|
|
long long getSampleRate();
|
|
|
|
|
2015-01-12 00:40:43 -05:00
|
|
|
std::vector<SDRDeviceInfo *> *getDevices();
|
|
|
|
void setDevice(int deviceId);
|
2015-01-12 00:51:57 -05:00
|
|
|
int getDevice();
|
2015-01-12 00:40:43 -05:00
|
|
|
|
2014-12-10 21:22:13 -05:00
|
|
|
DemodulatorThreadOutputQueue* getAudioVisualQueue();
|
2014-12-26 16:15:35 -05:00
|
|
|
DemodulatorThreadInputQueue* getIQVisualQueue();
|
2014-12-10 21:22:13 -05:00
|
|
|
DemodulatorMgr &getDemodMgr();
|
2014-11-23 19:39:27 -05:00
|
|
|
|
2014-12-10 21:22:13 -05:00
|
|
|
void bindDemodulator(DemodulatorInstance *demod);
|
|
|
|
void removeDemodulator(DemodulatorInstance *demod);
|
2014-12-10 18:52:24 -05:00
|
|
|
|
2015-04-13 19:58:34 -04:00
|
|
|
AppConfig *getConfig();
|
2015-04-22 22:54:48 -04:00
|
|
|
void saveConfig();
|
2015-04-13 19:58:34 -04:00
|
|
|
|
2015-04-13 21:18:45 -04:00
|
|
|
void setPPM(int ppm_in);
|
|
|
|
int getPPM();
|
|
|
|
|
2014-10-27 20:05:40 -04:00
|
|
|
private:
|
2015-04-13 19:58:34 -04:00
|
|
|
AppConfig config;
|
2014-10-27 20:05:40 -04:00
|
|
|
PrimaryGLContext *m_glContext;
|
2015-01-12 00:40:43 -05:00
|
|
|
std::vector<SDRDeviceInfo *> devs;
|
2014-11-04 17:25:04 -05:00
|
|
|
|
2014-11-23 19:39:27 -05:00
|
|
|
DemodulatorMgr demodMgr;
|
|
|
|
|
2015-01-04 17:11:20 -05:00
|
|
|
long long frequency;
|
2015-01-06 00:57:57 -05:00
|
|
|
long long offset;
|
2015-04-13 21:18:45 -04:00
|
|
|
int ppm;
|
2015-01-11 17:08:16 -05:00
|
|
|
long long sampleRate;
|
2014-11-23 19:39:27 -05:00
|
|
|
|
|
|
|
SDRThread *sdrThread;
|
2014-11-29 13:58:20 -05:00
|
|
|
SDRPostThread *sdrPostThread;
|
2014-11-30 17:11:29 -05:00
|
|
|
|
2014-11-23 19:39:27 -05:00
|
|
|
SDRThreadCommandQueue* threadCmdQueueSDR;
|
2014-11-29 13:58:20 -05:00
|
|
|
SDRThreadIQDataQueue* iqPostDataQueue;
|
2014-12-26 16:15:35 -05:00
|
|
|
DemodulatorThreadInputQueue* iqVisualQueue;
|
2014-11-23 19:39:27 -05:00
|
|
|
DemodulatorThreadOutputQueue* audioVisualQueue;
|
|
|
|
|
2014-11-30 17:11:29 -05:00
|
|
|
std::thread *t_SDR;
|
|
|
|
std::thread *t_PostSDR;
|
2014-10-27 20:05:40 -04:00
|
|
|
};
|
|
|
|
|
2014-10-27 21:22:29 -04:00
|
|
|
DECLARE_APP(CubicSDR)
|