diff --git a/src/demod/DemodulatorThread.cpp b/src/demod/DemodulatorThread.cpp index 37e8dca..df44786 100644 --- a/src/demod/DemodulatorThread.cpp +++ b/src/demod/DemodulatorThread.cpp @@ -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::iterator data_i; ati->peak = 0; diff --git a/src/demod/DemodulatorThread.h b/src/demod/DemodulatorThread.h index 06a81ea..b95f7ac 100644 --- a/src/demod/DemodulatorThread.h +++ b/src/demod/DemodulatorThread.h @@ -33,6 +33,7 @@ public: void setSquelchLevel(float signal_level_in); float getSquelchLevel(); + bool getSquelchBreak(); protected: @@ -46,7 +47,7 @@ protected: std::atomic squelchLevel; std::atomic signalLevel; - bool squelchEnabled; + bool squelchEnabled, squelchBreak; Modem *cModem; ModemKit *cModemKit;