CubicSDR/src/sdr/SDRPostThread.h

55 lines
1.3 KiB
C
Raw Normal View History

#pragma once
#if USE_RTL_SDR
#include "SDRThread.h"
#else
#include "SoapySDRThread.h"
#endif
2014-12-10 21:22:13 -05:00
#include <algorithm>
2015-07-29 20:57:02 -04:00
class SDRPostThread : public IOThread {
public:
SDRPostThread();
~SDRPostThread();
2014-12-11 19:07:21 -05:00
void bindDemodulator(DemodulatorInstance *demod);
void removeDemodulator(DemodulatorInstance *demod);
2014-12-10 21:22:13 -05:00
2015-05-31 22:13:14 -04:00
void setSwapIQ(bool swapIQ);
bool getSwapIQ();
2015-07-29 20:57:02 -04:00
void run();
void terminate();
2014-12-11 19:07:21 -05:00
protected:
SDRThreadIQDataQueue *iqDataInQueue;
DemodulatorThreadInputQueue *iqDataOutQueue;
DemodulatorThreadInputQueue *iqVisualQueue;
std::mutex busy_demod;
std::vector<DemodulatorInstance *> demodulators;
2015-07-19 23:19:10 -04:00
std::atomic_bool swapIQ;
private:
void initPFBChannelizer();
void updateActiveDemodulators();
void updateChannels();
ReBuffer<DemodulatorThreadIQData> buffers;
std::vector<liquid_float_complex> fpData;
std::vector<liquid_float_complex> dataOut;
std::vector<long long> chanCenters;
long long chanBw;
int nRunDemods;
std::vector<DemodulatorInstance *> runDemods;
std::vector<int> demodChannel;
std::vector<int> demodChannelActive;
ReBuffer<DemodulatorThreadIQData> visualDataBuffers;
atomic_bool doRefresh;
int numChannels, sampleRate;
long long frequency;
firpfbch2_crcf channelizer;
};