mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-13 11:18:45 -04:00
digital modem wrap-up and re-connect
- Compiles but untested
This commit is contained in:
@@ -45,7 +45,6 @@ DemodulatorInstance::DemodulatorInstance() :
|
||||
audioThread->setOutputQueue("NotifyQueue", pipeDemodNotify);
|
||||
|
||||
currentDemodType = demodulatorPreThread->getParams().demodType;
|
||||
currentDemodCons = demodulatorThread->getDemodulatorCons();
|
||||
}
|
||||
|
||||
DemodulatorInstance::~DemodulatorInstance() {
|
||||
@@ -75,7 +74,6 @@ void DemodulatorInstance::run() {
|
||||
|
||||
currentFrequency = demodulatorPreThread->getParams().frequency;
|
||||
currentDemodType = demodulatorPreThread->getParams().demodType;
|
||||
currentDemodCons = demodulatorThread->getDemodulatorCons();
|
||||
currentAudioSampleRate = AudioThread::deviceSampleRate[getOutputDevice()];
|
||||
demodulatorPreThread->getParams().audioSampleRate = currentAudioSampleRate;
|
||||
|
||||
@@ -300,19 +298,35 @@ std::string DemodulatorInstance::getDemodulatorType() {
|
||||
}
|
||||
|
||||
void DemodulatorInstance::setDemodulatorLock(bool demod_lock_in) {
|
||||
demodulatorThread->setDemodulatorLock(demod_lock_in);
|
||||
Modem *cModem = demodulatorPreThread->getModem();
|
||||
if (cModem && cModem->getType() == "digital") {
|
||||
((ModemDigital *)cModem)->setDemodulatorLock(demod_lock_in);
|
||||
}
|
||||
}
|
||||
|
||||
int DemodulatorInstance::getDemodulatorLock() {
|
||||
return demodulatorThread->getDemodulatorLock();
|
||||
Modem *cModem = demodulatorPreThread->getModem();
|
||||
|
||||
if (cModem && cModem->getType() == "digital") {
|
||||
return ((ModemDigital *)cModem)->getDemodulatorLock();
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void DemodulatorInstance::setDemodulatorCons(int demod_cons_in) {
|
||||
demodulatorThread->setDemodulatorCons(demod_cons_in);
|
||||
Modem *cModem = demodulatorPreThread->getModem();
|
||||
if (cModem && cModem->getType() == "digital") {
|
||||
((ModemDigital *)cModem)->setDemodulatorCons(demod_cons_in);
|
||||
}
|
||||
}
|
||||
|
||||
int DemodulatorInstance::getDemodulatorCons() {
|
||||
return demodulatorThread->getDemodulatorCons();
|
||||
Modem *cModem = demodulatorPreThread->getModem();
|
||||
if (cModem && cModem->getType() == "digital") {
|
||||
return ((ModemDigital *)cModem)->getDemodulatorCons();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void DemodulatorInstance::setBandwidth(int bw) {
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
#include "DemodulatorThread.h"
|
||||
#include "DemodulatorPreThread.h"
|
||||
|
||||
#include "ModemDigital.h"
|
||||
#include "ModemAnalog.h"
|
||||
|
||||
class DemodulatorInstance {
|
||||
public:
|
||||
|
||||
@@ -112,7 +115,6 @@ private:
|
||||
std::atomic_llong currentFrequency;
|
||||
std::atomic_int currentBandwidth;
|
||||
std::string currentDemodType;
|
||||
std::atomic_int currentDemodCons;
|
||||
std::atomic_int currentOutputDevice;
|
||||
std::atomic_int currentAudioSampleRate;
|
||||
std::atomic<float> currentAudioGain;
|
||||
|
||||
@@ -284,3 +284,12 @@ void DemodulatorPreThread::terminate() {
|
||||
delete workerResults;
|
||||
delete workerQueue;
|
||||
}
|
||||
|
||||
|
||||
Modem *DemodulatorPreThread::getModem() {
|
||||
return cModem;
|
||||
}
|
||||
|
||||
ModemKit *DemodulatorPreThread::getModemKit() {
|
||||
return cModemKit;
|
||||
}
|
||||
|
||||
@@ -24,12 +24,9 @@ public:
|
||||
void initialize();
|
||||
void terminate();
|
||||
|
||||
#ifdef __APPLE__
|
||||
static void *pthread_helper(void *context) {
|
||||
return ((DemodulatorPreThread *) context)->threadMain();
|
||||
}
|
||||
#endif
|
||||
|
||||
Modem *getModem();
|
||||
ModemKit *getModemKit();
|
||||
|
||||
protected:
|
||||
msresamp_crcf iqResampler;
|
||||
double iqResampleRatio;
|
||||
|
||||
Reference in New Issue
Block a user