2014-12-11 23:35:06 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <map>
|
|
|
|
#include <thread>
|
|
|
|
|
|
|
|
#include "DemodulatorThread.h"
|
2014-12-16 18:27:02 -05:00
|
|
|
#include "DemodulatorPreThread.h"
|
2014-12-11 23:35:06 -05:00
|
|
|
|
|
|
|
class DemodulatorInstance {
|
|
|
|
public:
|
|
|
|
|
|
|
|
DemodulatorThreadInputQueue* threadQueueDemod;
|
2014-12-16 18:27:02 -05:00
|
|
|
DemodulatorThreadPostInputQueue* threadQueuePostDemod;
|
2014-12-11 23:35:06 -05:00
|
|
|
DemodulatorThreadCommandQueue* threadQueueCommand;
|
|
|
|
DemodulatorThreadCommandQueue* threadQueueNotify;
|
2014-12-16 18:27:02 -05:00
|
|
|
DemodulatorPreThread *demodulatorPreThread;
|
2014-12-11 23:35:06 -05:00
|
|
|
DemodulatorThread *demodulatorThread;
|
2014-12-21 16:08:32 -05:00
|
|
|
DemodulatorThreadControlCommandQueue *threadQueueControl;
|
|
|
|
|
2014-12-11 23:35:06 -05:00
|
|
|
#ifdef __APPLE__
|
2014-12-16 18:27:02 -05:00
|
|
|
pthread_t t_PreDemod;
|
2014-12-11 23:35:06 -05:00
|
|
|
pthread_t t_Demod;
|
|
|
|
#else
|
2014-12-16 18:27:02 -05:00
|
|
|
std::thread *t_PreDemod;
|
2014-12-11 23:35:06 -05:00
|
|
|
std::thread *t_Demod;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
AudioThreadInputQueue *audioInputQueue;
|
|
|
|
AudioThread *audioThread;
|
|
|
|
std::thread *t_Audio;
|
|
|
|
|
|
|
|
DemodulatorInstance();
|
|
|
|
~DemodulatorInstance();
|
|
|
|
|
|
|
|
void setVisualOutputQueue(DemodulatorThreadOutputQueue *tQueue);
|
|
|
|
|
|
|
|
DemodulatorThreadCommandQueue *getCommandQueue();
|
|
|
|
DemodulatorThreadParameters &getParams();
|
|
|
|
|
|
|
|
void run();
|
|
|
|
void terminate();
|
|
|
|
std::string getLabel();
|
|
|
|
void setLabel(std::string labelStr);
|
|
|
|
|
|
|
|
bool isTerminated();
|
|
|
|
void updateLabel(int freq);
|
|
|
|
|
2014-12-18 20:11:25 -05:00
|
|
|
bool isActive();
|
|
|
|
void setActive(bool state);
|
|
|
|
|
2014-12-21 16:08:32 -05:00
|
|
|
void squelchAuto();
|
|
|
|
bool isSquelchEnabled();
|
|
|
|
void setSquelchEnabled(bool state);
|
|
|
|
|
2014-12-11 23:35:06 -05:00
|
|
|
private:
|
2014-12-18 20:11:25 -05:00
|
|
|
std::atomic<std::string *> label;
|
|
|
|
bool terminated;
|
|
|
|
bool demodTerminated;
|
|
|
|
bool audioTerminated;
|
|
|
|
bool preDemodTerminated;
|
|
|
|
std::atomic<bool> active;
|
2014-12-21 16:08:32 -05:00
|
|
|
std::atomic<bool> squelch;
|
2014-12-11 23:35:06 -05:00
|
|
|
};
|
|
|
|
|