diff --git a/src/demod/DemodDefs.h b/src/demod/DemodDefs.h index ded4606..ec40035 100644 --- a/src/demod/DemodDefs.h +++ b/src/demod/DemodDefs.h @@ -7,24 +7,6 @@ #include #include -//#define DEMOD_TYPE_NULL 0 -//#define DEMOD_TYPE_FM 1 -//#define DEMOD_TYPE_AM 2 -//#define DEMOD_TYPE_LSB 3 -//#define DEMOD_TYPE_USB 4 -//#define DEMOD_TYPE_DSB 5 -//#define DEMOD_TYPE_ASK 6 -//#define DEMOD_TYPE_APSK 7 -//#define DEMOD_TYPE_BPSK 8 -//#define DEMOD_TYPE_DPSK 9 -//#define DEMOD_TYPE_PSK 10 -//#define DEMOD_TYPE_OOK 11 -//#define DEMOD_TYPE_ST 12 -//#define DEMOD_TYPE_SQAM 13 -//#define DEMOD_TYPE_QAM 14 -//#define DEMOD_TYPE_QPSK 15 -//#define DEMOD_TYPE_RAW 16 - #include "IOThread.h" class DemodulatorThread; @@ -93,14 +75,18 @@ public: } }; +class Modem; +class ModemKit; class DemodulatorThreadPostIQData: public ReferenceCounter { public: std::vector data; long long sampleRate; + Modem *modem; + ModemKit *modemKit; DemodulatorThreadPostIQData() : - sampleRate(0) { + sampleRate(0), modem(nullptr), modemKit(nullptr) { } diff --git a/src/demod/DemodulatorInstance.h b/src/demod/DemodulatorInstance.h index 60cd25c..158b800 100644 --- a/src/demod/DemodulatorInstance.h +++ b/src/demod/DemodulatorInstance.h @@ -98,9 +98,6 @@ protected: private: void checkBandwidth(); - - Modem *currentModem; - ModemKit *currentModemKit; std::atomic label; // std::atomic_bool terminated; // diff --git a/src/demod/DemodulatorPreThread.cpp b/src/demod/DemodulatorPreThread.cpp index 35f69d4..e88cce8 100644 --- a/src/demod/DemodulatorPreThread.cpp +++ b/src/demod/DemodulatorPreThread.cpp @@ -8,7 +8,7 @@ #include "DemodulatorPreThread.h" #include "CubicSDR.h" -DemodulatorPreThread::DemodulatorPreThread() : IOThread(), iqResampler(NULL), iqResampleRatio(1), iqInputQueue(NULL), iqOutputQueue(NULL), threadQueueNotify(NULL), commandQueue(NULL) +DemodulatorPreThread::DemodulatorPreThread() : IOThread(), iqResampler(NULL), iqResampleRatio(1), iqInputQueue(NULL), iqOutputQueue(NULL), threadQueueNotify(NULL), commandQueue(NULL), cModem(nullptr), cModemKit(nullptr) { initialized.store(false); @@ -251,6 +251,8 @@ void DemodulatorPreThread::run() { // resamp->firStereoLeft = firStereoLeft; // resamp->firStereoRight = firStereoRight; // resamp->iirStereoPilot = iirStereoPilot; + resamp->modem = cModem; + resamp->modemKit = cModemKit; resamp->sampleRate = params.bandwidth; iqOutputQueue->push(resamp); @@ -294,6 +296,14 @@ void DemodulatorPreThread::run() { // params.audioSampleRate = result.audioSampleRate; // } + if (result.modem != nullptr) { + cModem = result.modem; + } + + if (result.modemKit != nullptr) { + cModemKit = result.modemKit; + } + if (result.bandwidth) { params.bandwidth = result.bandwidth; } diff --git a/src/demod/DemodulatorPreThread.h b/src/demod/DemodulatorPreThread.h index 3875858..0fc7154 100644 --- a/src/demod/DemodulatorPreThread.h +++ b/src/demod/DemodulatorPreThread.h @@ -37,6 +37,9 @@ protected: double iqResampleRatio; std::vector resampledData; + Modem *cModem; + ModemKit *cModemKit; + // msresamp_rrrf audioResampler; // msresamp_rrrf stereoResampler; // double audioResampleRatio; diff --git a/src/demod/DemodulatorThread.h b/src/demod/DemodulatorThread.h index 7e92ba7..4d90c0c 100644 --- a/src/demod/DemodulatorThread.h +++ b/src/demod/DemodulatorThread.h @@ -5,6 +5,7 @@ #include "DemodDefs.h" #include "AudioThread.h" +#include "Modem.h" typedef ThreadQueue DemodulatorThreadOutputQueue; @@ -154,6 +155,9 @@ protected: void updateDemodulatorCons(int Cons); void updateDemodulatorLock(modem demod, float sensitivity); + Modem *cModem; + ModemKit *cModemKit; + DemodulatorThreadPostInputQueue* iqInputQueue; AudioThreadInputQueue *audioOutputQueue; DemodulatorThreadOutputQueue* audioVisOutputQueue; diff --git a/src/demod/DemodulatorWorkerThread.h b/src/demod/DemodulatorWorkerThread.h index 633ef5f..38fb77a 100644 --- a/src/demod/DemodulatorWorkerThread.h +++ b/src/demod/DemodulatorWorkerThread.h @@ -34,6 +34,7 @@ public: long long sampleRate; unsigned int bandwidth; + Modem *modem; ModemKit *modemKit; };