50 lines
1.0 KiB
C
50 lines
1.0 KiB
C
|
#pragma once
|
||
|
|
||
|
#include <vector>
|
||
|
#include <map>
|
||
|
#include <thread>
|
||
|
|
||
|
#include "DemodulatorThread.h"
|
||
|
|
||
|
class DemodulatorInstance {
|
||
|
public:
|
||
|
|
||
|
DemodulatorThreadInputQueue* threadQueueDemod;
|
||
|
DemodulatorThreadCommandQueue* threadQueueCommand;
|
||
|
DemodulatorThreadCommandQueue* threadQueueNotify;
|
||
|
DemodulatorThread *demodulatorThread;
|
||
|
#ifdef __APPLE__
|
||
|
pthread_t t_Demod;
|
||
|
#else
|
||
|
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);
|
||
|
|
||
|
private:
|
||
|
std::atomic<std::string *> label;
|
||
|
bool terminated;
|
||
|
bool demodTerminated;
|
||
|
bool audioTerminated;
|
||
|
};
|
||
|
|
||
|
|