CubicSDR/src/demod/DemodulatorMgr.h

50 lines
1.1 KiB
C
Raw Normal View History

#pragma once
#include <vector>
#include <map>
#include <thread>
#include "DemodulatorThread.h"
class DemodulatorInstance {
public:
DemodulatorThreadInputQueue* threadQueueDemod;
DemodulatorThreadCommandQueue* threadQueueCommand;
DemodulatorThread *demodulatorThread;
#ifdef __APPLE__
pthread_t t_Demod;
#else
std::thread *t_Demod;
#endif
AudioThreadInputQueue *audioInputQueue;
AudioThread *audioThread;
std::thread *t_Audio;
2014-11-22 22:33:32 -05:00
DemodulatorInstance();
~DemodulatorInstance();
2014-11-22 22:33:32 -05:00
void setVisualOutputQueue(DemodulatorThreadOutputQueue *tQueue);
DemodulatorThreadCommandQueue *getCommandQueue();
DemodulatorThreadParameters &getParams();
void run();
void terminate();
};
class DemodulatorMgr {
public:
2014-11-22 22:33:32 -05:00
DemodulatorMgr();
~DemodulatorMgr();
2014-11-22 22:33:32 -05:00
DemodulatorInstance *newThread();
std::vector<DemodulatorInstance *> &getDemodulators();
std::vector<DemodulatorInstance *> *getDemodulatorsAt(int freq, int bandwidth);
void terminateAll();
2014-11-22 22:33:32 -05:00
private:
std::vector<DemodulatorInstance *> demods;
};