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();
|
2016-02-11 00:08:56 -05:00
|
|
|
std::vector<DemodulatorInstance *> getOrderedDemodulators(bool actives = true);
|
2015-01-04 17:11:20 -05:00
|
|
|
std::vector<DemodulatorInstance *> *getDemodulatorsAt(long long freq, int bandwidth);
|
2016-02-11 00:08:56 -05:00
|
|
|
DemodulatorInstance *getPreviousDemodulator(DemodulatorInstance *demod, bool actives = true);
|
|
|
|
DemodulatorInstance *getNextDemodulator(DemodulatorInstance *demod, bool actives = true);
|
|
|
|
DemodulatorInstance *getLastDemodulator();
|
|
|
|
DemodulatorInstance *getFirstDemodulator();
|
2016-01-13 21:29:26 -05:00
|
|
|
bool anyDemodulatorsAt(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();
|
|
|
|
|
2015-02-02 20:10:55 -05:00
|
|
|
int getLastBandwidth() const;
|
|
|
|
void setLastBandwidth(int lastBandwidth);
|
|
|
|
|
2015-11-17 18:57:42 -05:00
|
|
|
std::string getLastDemodulatorType() const;
|
|
|
|
void setLastDemodulatorType(std::string lastDemodType);
|
2015-02-02 20:10:55 -05:00
|
|
|
|
|
|
|
float getLastGain() const;
|
|
|
|
void setLastGain(float lastGain);
|
|
|
|
|
|
|
|
float getLastSquelchLevel() const;
|
|
|
|
void setLastSquelchLevel(float lastSquelch);
|
|
|
|
|
|
|
|
bool isLastSquelchEnabled() const;
|
|
|
|
void setLastSquelchEnabled(bool lastSquelchEnabled);
|
2015-11-20 21:55:37 -05:00
|
|
|
|
2015-08-19 17:06:06 -04:00
|
|
|
bool isLastMuted() const;
|
|
|
|
void setLastMuted(bool lastMuted);
|
|
|
|
|
2015-11-26 01:54:54 -05:00
|
|
|
ModemSettings getLastModemSettings(std::string);
|
|
|
|
void setLastModemSettings(std::string, ModemSettings);
|
|
|
|
|
|
|
|
void updateLastState();
|
|
|
|
|
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
|
|
|
|
2015-02-02 20:10:55 -05:00
|
|
|
int lastBandwidth;
|
2015-11-17 18:57:42 -05:00
|
|
|
std::string lastDemodType;
|
2015-06-10 04:50:14 -04:00
|
|
|
bool lastDemodLock;
|
2015-02-02 20:10:55 -05:00
|
|
|
bool lastSquelchEnabled;
|
|
|
|
float lastSquelch;
|
|
|
|
float lastGain;
|
2015-11-20 21:55:37 -05:00
|
|
|
bool lastMuted;
|
2015-11-26 01:54:54 -05:00
|
|
|
|
|
|
|
std::map<std::string, ModemSettings> lastModemSettings;
|
2014-11-17 22:58:56 -05:00
|
|
|
};
|