2014-11-17 22:58:56 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <map>
|
2014-11-30 17:11:29 -05:00
|
|
|
#include <thread>
|
2014-11-17 22:58:56 -05:00
|
|
|
|
2014-12-11 23:35:06 -05:00
|
|
|
#include "DemodulatorInstance.h"
|
2014-11-17 22:58:56 -05:00
|
|
|
|
|
|
|
class DemodulatorMgr {
|
|
|
|
public:
|
2014-11-22 22:33:32 -05:00
|
|
|
DemodulatorMgr();
|
|
|
|
~DemodulatorMgr();
|
2014-11-17 22:58:56 -05:00
|
|
|
|
2014-11-22 22:33:32 -05:00
|
|
|
DemodulatorInstance *newThread();
|
2014-11-26 21:05:19 -05:00
|
|
|
std::vector<DemodulatorInstance *> &getDemodulators();
|
2015-01-04 17:11:20 -05:00
|
|
|
std::vector<DemodulatorInstance *> *getDemodulatorsAt(long long freq, int bandwidth);
|
2014-12-10 21:22:13 -05:00
|
|
|
void deleteThread(DemodulatorInstance *);
|
2014-11-17 22:58:56 -05:00
|
|
|
|
2014-11-23 19:39:27 -05:00
|
|
|
void terminateAll();
|
2014-12-10 00:34:27 -05:00
|
|
|
|
|
|
|
void setActiveDemodulator(DemodulatorInstance *demod, bool temporary = true);
|
|
|
|
DemodulatorInstance *getActiveDemodulator();
|
|
|
|
DemodulatorInstance *getLastActiveDemodulator();
|
|
|
|
|
2014-11-22 22:33:32 -05:00
|
|
|
private:
|
2014-12-11 19:07:21 -05:00
|
|
|
void garbageCollect();
|
|
|
|
|
2014-11-17 22:58:56 -05:00
|
|
|
std::vector<DemodulatorInstance *> demods;
|
2014-12-11 19:07:21 -05:00
|
|
|
std::vector<DemodulatorInstance *> demods_deleted;
|
2014-12-10 00:34:27 -05:00
|
|
|
DemodulatorInstance *activeDemodulator;
|
|
|
|
DemodulatorInstance *lastActiveDemodulator;
|
2014-12-10 21:22:13 -05:00
|
|
|
DemodulatorInstance *activeVisualDemodulator;
|
2014-12-11 19:07:21 -05:00
|
|
|
|
2014-11-17 22:58:56 -05:00
|
|
|
};
|