CubicSDR/src/CubicSDR.h

83 lines
1.9 KiB
C
Raw Normal View History

#pragma once
//WX_GL_CORE_PROFILE 1
//WX_GL_MAJOR_VERSION 3
//WX_GL_MINOR_VERSION 2
#include <thread>
#include "GLExt.h"
#include "PrimaryGLContext.h"
#include "ThreadQueue.h"
#include "SDRThread.h"
#include "SDRPostThread.h"
#include "AudioThread.h"
#include "DemodulatorMgr.h"
#include "AppConfig.h"
2014-12-08 02:16:06 -05:00
#define NUM_DEMODULATORS 1
class CubicSDR: public wxApp {
public:
CubicSDR() :
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) {
}
PrimaryGLContext &GetContext(wxGLCanvas *canvas);
virtual bool OnInit();
virtual int OnExit();
void setFrequency(long long freq);
long long getFrequency();
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-12-10 21:22:13 -05:00
void bindDemodulator(DemodulatorInstance *demod);
void removeDemodulator(DemodulatorInstance *demod);
AppConfig *getConfig();
void setPPM(int ppm_in);
int getPPM();
private:
AppConfig config;
PrimaryGLContext *m_glContext;
2015-01-12 00:40:43 -05:00
std::vector<SDRDeviceInfo *> devs;
DemodulatorMgr demodMgr;
long long frequency;
long long offset;
int ppm;
2015-01-11 17:08:16 -05:00
long long sampleRate;
SDRThread *sdrThread;
SDRPostThread *sdrPostThread;
SDRThreadCommandQueue* threadCmdQueueSDR;
SDRThreadIQDataQueue* iqPostDataQueue;
2014-12-26 16:15:35 -05:00
DemodulatorThreadInputQueue* iqVisualQueue;
DemodulatorThreadOutputQueue* audioVisualQueue;
std::thread *t_SDR;
std::thread *t_PostSDR;
};
DECLARE_APP(CubicSDR)