DemodulatorThread visual out queue /w IOThread::onBindOutput

This commit is contained in:
Charles J. Cliffe 2015-07-30 00:52:00 -04:00
parent 0a9dd7692a
commit 5bbcf7aa11
3 changed files with 10 additions and 10 deletions

View File

@ -23,16 +23,15 @@ DemodulatorInstance::DemodulatorInstance() :
threadQueuePostDemod = new DemodulatorThreadPostInputQueue; threadQueuePostDemod = new DemodulatorThreadPostInputQueue;
threadQueueCommand = new DemodulatorThreadCommandQueue; threadQueueCommand = new DemodulatorThreadCommandQueue;
threadQueueNotify = new DemodulatorThreadCommandQueue; threadQueueNotify = new DemodulatorThreadCommandQueue;
threadQueueControl = new DemodulatorThreadControlCommandQueue;
demodulatorPreThread = new DemodulatorPreThread(); demodulatorPreThread = new DemodulatorPreThread();
demodulatorPreThread->setInputQueue("IQDataInput",threadQueueDemod); demodulatorPreThread->setInputQueue("IQDataInput",threadQueueDemod);
demodulatorPreThread->setOutputQueue("IQDataOut",threadQueuePostDemod); demodulatorPreThread->setOutputQueue("IQDataOut",threadQueuePostDemod);
demodulatorPreThread->setInputQueue("ControlQueue",threadQueueControl);
demodulatorPreThread->setOutputQueue("NotifyQueue",threadQueueNotify); demodulatorPreThread->setOutputQueue("NotifyQueue",threadQueueNotify);
demodulatorPreThread->setInputQueue("CommandQueue",threadQueueCommand); demodulatorPreThread->setInputQueue("CommandQueue",threadQueueCommand);
audioInputQueue = new AudioThreadInputQueue; audioInputQueue = new AudioThreadInputQueue;
threadQueueControl = new DemodulatorThreadControlCommandQueue;
demodulatorThread = new DemodulatorThread(); demodulatorThread = new DemodulatorThread();
demodulatorThread->setInputQueue("IQDataInput",threadQueuePostDemod); demodulatorThread->setInputQueue("IQDataInput",threadQueuePostDemod);
@ -57,7 +56,7 @@ DemodulatorInstance::~DemodulatorInstance() {
} }
void DemodulatorInstance::setVisualOutputQueue(DemodulatorThreadOutputQueue *tQueue) { void DemodulatorInstance::setVisualOutputQueue(DemodulatorThreadOutputQueue *tQueue) {
demodulatorThread->setVisualOutputQueue(tQueue); demodulatorThread->setOutputQueue("AudioVisualOutput", tQueue);
} }
void DemodulatorInstance::run() { void DemodulatorInstance::run() {

View File

@ -28,6 +28,12 @@ DemodulatorThread::DemodulatorThread() : IOThread(), iqAutoGain(NULL), amOutputC
DemodulatorThread::~DemodulatorThread() { DemodulatorThread::~DemodulatorThread() {
} }
void DemodulatorThread::onBindOutput(std::string name, ThreadQueueBase *threadQueue) {
if (name == "AudioVisualOutput") {
audioVisOutputQueue = (DemodulatorThreadOutputQueue *)threadQueue;
}
}
void DemodulatorThread::run() { void DemodulatorThread::run() {
#ifdef __APPLE__ #ifdef __APPLE__
pthread_t tID = pthread_self(); // ID of this thread pthread_t tID = pthread_self(); // ID of this thread
@ -490,10 +496,6 @@ void DemodulatorThread::run() {
std::cout << "Demodulator thread done." << std::endl; std::cout << "Demodulator thread done." << std::endl;
} }
void DemodulatorThread::setVisualOutputQueue(DemodulatorThreadOutputQueue *tQueue) {
audioVisOutputQueue = tQueue;
}
void DemodulatorThread::terminate() { void DemodulatorThread::terminate() {
terminated = true; terminated = true;
DemodulatorThreadPostIQData *inp = new DemodulatorThreadPostIQData; // push dummy to nudge queue DemodulatorThreadPostIQData *inp = new DemodulatorThreadPostIQData; // push dummy to nudge queue

View File

@ -16,10 +16,9 @@ public:
DemodulatorThread(); DemodulatorThread();
~DemodulatorThread(); ~DemodulatorThread();
void onBindOutput(std::string name, ThreadQueueBase *threadQueue);
void run(); void run();
void setVisualOutputQueue(DemodulatorThreadOutputQueue *tQueue);
void terminate(); void terminate();
void setStereo(bool state); void setStereo(bool state);