Add solo squelch break

This commit is contained in:
Charles J. Cliffe 2016-02-11 01:32:39 -05:00
parent 16ba35a892
commit 008a7bf77d
2 changed files with 14 additions and 1 deletions

View File

@ -17,6 +17,7 @@ DemodulatorThread::DemodulatorThread(DemodulatorInstance *parent) : IOThread(),
demodInstance = parent;
muted.store(false);
squelchBreak = false;
}
DemodulatorThread::~DemodulatorThread() {
@ -147,6 +148,17 @@ void DemodulatorThread::run() {
bool squelched = (squelchEnabled && (signalLevel < squelchLevel));
if (squelchEnabled) {
if (!squelched && !squelchBreak) {
if (wxGetApp().getSoloMode()) {
wxGetApp().getDemodMgr().setActiveDemodulator(demodInstance, false);
}
squelchBreak = true;
} else if (squelched && squelchBreak) {
squelchBreak = false;
}
}
if (audioOutputQueue != NULL && ati && !squelched) {
std::vector<float>::iterator data_i;
ati->peak = 0;

View File

@ -33,6 +33,7 @@ public:
void setSquelchLevel(float signal_level_in);
float getSquelchLevel();
bool getSquelchBreak();
protected:
@ -46,7 +47,7 @@ protected:
std::atomic<float> squelchLevel;
std::atomic<float> signalLevel;
bool squelchEnabled;
bool squelchEnabled, squelchBreak;
Modem *cModem;
ModemKit *cModemKit;