mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-26 13:48:38 -05:00
Add solo squelch break
This commit is contained in:
parent
16ba35a892
commit
008a7bf77d
@ -17,6 +17,7 @@ DemodulatorThread::DemodulatorThread(DemodulatorInstance *parent) : IOThread(),
|
|||||||
|
|
||||||
demodInstance = parent;
|
demodInstance = parent;
|
||||||
muted.store(false);
|
muted.store(false);
|
||||||
|
squelchBreak = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DemodulatorThread::~DemodulatorThread() {
|
DemodulatorThread::~DemodulatorThread() {
|
||||||
@ -147,6 +148,17 @@ void DemodulatorThread::run() {
|
|||||||
|
|
||||||
bool squelched = (squelchEnabled && (signalLevel < squelchLevel));
|
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) {
|
if (audioOutputQueue != NULL && ati && !squelched) {
|
||||||
std::vector<float>::iterator data_i;
|
std::vector<float>::iterator data_i;
|
||||||
ati->peak = 0;
|
ati->peak = 0;
|
||||||
|
@ -33,6 +33,7 @@ public:
|
|||||||
void setSquelchLevel(float signal_level_in);
|
void setSquelchLevel(float signal_level_in);
|
||||||
float getSquelchLevel();
|
float getSquelchLevel();
|
||||||
|
|
||||||
|
bool getSquelchBreak();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -46,7 +47,7 @@ protected:
|
|||||||
|
|
||||||
std::atomic<float> squelchLevel;
|
std::atomic<float> squelchLevel;
|
||||||
std::atomic<float> signalLevel;
|
std::atomic<float> signalLevel;
|
||||||
bool squelchEnabled;
|
bool squelchEnabled, squelchBreak;
|
||||||
|
|
||||||
Modem *cModem;
|
Modem *cModem;
|
||||||
ModemKit *cModemKit;
|
ModemKit *cModemKit;
|
||||||
|
Loading…
Reference in New Issue
Block a user