diff --git a/src/demod/DemodulatorInstance.cpp b/src/demod/DemodulatorInstance.cpp index a60c232..a8dc922 100644 --- a/src/demod/DemodulatorInstance.cpp +++ b/src/demod/DemodulatorInstance.cpp @@ -23,16 +23,15 @@ DemodulatorInstance::DemodulatorInstance() : threadQueuePostDemod = new DemodulatorThreadPostInputQueue; threadQueueCommand = new DemodulatorThreadCommandQueue; threadQueueNotify = new DemodulatorThreadCommandQueue; - threadQueueControl = new DemodulatorThreadControlCommandQueue; demodulatorPreThread = new DemodulatorPreThread(); demodulatorPreThread->setInputQueue("IQDataInput",threadQueueDemod); demodulatorPreThread->setOutputQueue("IQDataOut",threadQueuePostDemod); - demodulatorPreThread->setInputQueue("ControlQueue",threadQueueControl); demodulatorPreThread->setOutputQueue("NotifyQueue",threadQueueNotify); demodulatorPreThread->setInputQueue("CommandQueue",threadQueueCommand); audioInputQueue = new AudioThreadInputQueue; + threadQueueControl = new DemodulatorThreadControlCommandQueue; demodulatorThread = new DemodulatorThread(); demodulatorThread->setInputQueue("IQDataInput",threadQueuePostDemod); @@ -57,7 +56,7 @@ DemodulatorInstance::~DemodulatorInstance() { } void DemodulatorInstance::setVisualOutputQueue(DemodulatorThreadOutputQueue *tQueue) { - demodulatorThread->setVisualOutputQueue(tQueue); + demodulatorThread->setOutputQueue("AudioVisualOutput", tQueue); } void DemodulatorInstance::run() { diff --git a/src/demod/DemodulatorThread.cpp b/src/demod/DemodulatorThread.cpp index 52e7424..d3acb35 100644 --- a/src/demod/DemodulatorThread.cpp +++ b/src/demod/DemodulatorThread.cpp @@ -28,6 +28,12 @@ DemodulatorThread::DemodulatorThread() : IOThread(), iqAutoGain(NULL), amOutputC DemodulatorThread::~DemodulatorThread() { } +void DemodulatorThread::onBindOutput(std::string name, ThreadQueueBase *threadQueue) { + if (name == "AudioVisualOutput") { + audioVisOutputQueue = (DemodulatorThreadOutputQueue *)threadQueue; + } +} + void DemodulatorThread::run() { #ifdef __APPLE__ pthread_t tID = pthread_self(); // ID of this thread @@ -490,10 +496,6 @@ void DemodulatorThread::run() { std::cout << "Demodulator thread done." << std::endl; } -void DemodulatorThread::setVisualOutputQueue(DemodulatorThreadOutputQueue *tQueue) { - audioVisOutputQueue = tQueue; -} - void DemodulatorThread::terminate() { terminated = true; DemodulatorThreadPostIQData *inp = new DemodulatorThreadPostIQData; // push dummy to nudge queue diff --git a/src/demod/DemodulatorThread.h b/src/demod/DemodulatorThread.h index d6b14c0..eb179c5 100644 --- a/src/demod/DemodulatorThread.h +++ b/src/demod/DemodulatorThread.h @@ -16,10 +16,9 @@ public: DemodulatorThread(); ~DemodulatorThread(); + void onBindOutput(std::string name, ThreadQueueBase *threadQueue); + void run(); - - void setVisualOutputQueue(DemodulatorThreadOutputQueue *tQueue); - void terminate(); void setStereo(bool state);