CubicSDR/src/demod/DemodulatorMgr.h

73 lines
2.2 KiB
C
Raw Normal View History

#pragma once
#include <vector>
#include <map>
#include <thread>
#include "DemodulatorInstance.h"
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();
2016-02-11 00:08:56 -05:00
std::vector<DemodulatorInstance *> getOrderedDemodulators(bool actives = true);
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();
bool anyDemodulatorsAt(long long freq, int bandwidth);
2014-12-10 21:22:13 -05:00
void deleteThread(DemodulatorInstance *);
void terminateAll();
void setActiveDemodulator(DemodulatorInstance *demod, bool temporary = true);
DemodulatorInstance *getActiveDemodulator();
DemodulatorInstance *getLastActiveDemodulator();
int getLastBandwidth() const;
void setLastBandwidth(int lastBandwidth);
std::string getLastDemodulatorType() const;
void setLastDemodulatorType(std::string lastDemodType);
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
bool isLastMuted() const;
void setLastMuted(bool lastMuted);
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();
std::vector<DemodulatorInstance *> demods;
2014-12-11 19:07:21 -05:00
std::vector<DemodulatorInstance *> demods_deleted;
DemodulatorInstance *activeDemodulator;
DemodulatorInstance *lastActiveDemodulator;
2014-12-10 21:22:13 -05:00
DemodulatorInstance *activeVisualDemodulator;
2014-12-11 19:07:21 -05:00
int lastBandwidth;
std::string lastDemodType;
bool lastDemodLock;
bool lastSquelchEnabled;
float lastSquelch;
float lastGain;
2015-11-20 21:55:37 -05:00
bool lastMuted;
std::map<std::string, ModemSettings> lastModemSettings;
};