bugfix, new squelch system, dragon labs source

This commit is contained in:
AlexandreRouma
2026-03-21 23:00:10 -04:00
parent 65a0e11d3d
commit 2bf3faebae
21 changed files with 1103 additions and 104 deletions

View File

@@ -40,6 +40,12 @@ namespace demod {
void showMenu() {
float menuWidth = ImGui::GetContentRegionAvail().x;
if (ImGui::Checkbox(("Carrier AGC##_radio_am_carrier_agc_" + name).c_str(), &carrierAgc)) {
demod.setAGCMode(carrierAgc ? dsp::demod::AM<dsp::stereo_t>::AGCMode::CARRIER : dsp::demod::AM<dsp::stereo_t>::AGCMode::AUDIO);
_config->acquire();
_config->conf[name][getName()]["carrierAgc"] = carrierAgc;
_config->release(true);
}
ImGui::LeftLabel("AGC Attack");
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_am_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 200.0f)) {
@@ -56,12 +62,6 @@ namespace demod {
_config->conf[name][getName()]["agcDecay"] = agcDecay;
_config->release(true);
}
if (ImGui::Checkbox(("Carrier AGC##_radio_am_carrier_agc_" + name).c_str(), &carrierAgc)) {
demod.setAGCMode(carrierAgc ? dsp::demod::AM<dsp::stereo_t>::AGCMode::CARRIER : dsp::demod::AM<dsp::stereo_t>::AGCMode::AUDIO);
_config->acquire();
_config->conf[name][getName()]["carrierAgc"] = carrierAgc;
_config->release(true);
}
}
void setBandwidth(double bandwidth) { demod.setBandwidth(bandwidth); }
@@ -86,6 +86,8 @@ namespace demod {
int getDefaultDeemphasisMode() { return DEEMP_MODE_NONE; }
bool getFMIFNRAllowed() { return false; }
bool getNBAllowed() { return false; }
bool getHighPassAllowed() { return true; }
bool getSquelchAllowed() { return true; }
dsp::stream<dsp::stereo_t>* getOutput() { return &demod.out; }
private:

View File

@@ -92,6 +92,8 @@ namespace demod {
int getDefaultDeemphasisMode() { return DEEMP_MODE_NONE; }
bool getFMIFNRAllowed() { return false; }
bool getNBAllowed() { return false; }
bool getHighPassAllowed() { return false; }
bool getSquelchAllowed() { return false; }
dsp::stream<dsp::stereo_t>* getOutput() { return &demod.out; }
private:

View File

@@ -79,6 +79,8 @@ namespace demod {
int getDefaultDeemphasisMode() { return DEEMP_MODE_NONE; }
bool getFMIFNRAllowed() { return false; }
bool getNBAllowed() { return true; }
bool getHighPassAllowed() { return true; }
bool getSquelchAllowed() { return true; }
dsp::stream<dsp::stereo_t>* getOutput() { return &demod.out; }
private:

View File

@@ -79,6 +79,8 @@ namespace demod {
int getDefaultDeemphasisMode() { return DEEMP_MODE_NONE; }
bool getFMIFNRAllowed() { return false; }
bool getNBAllowed() { return true; }
bool getHighPassAllowed() { return true; }
bool getSquelchAllowed() { return true; }
dsp::stream<dsp::stereo_t>* getOutput() { return &demod.out; }
private:

View File

@@ -22,14 +22,11 @@ namespace demod {
if (config->conf[name][getName()].contains("lowPass")) {
_lowPass = config->conf[name][getName()]["lowPass"];
}
if (config->conf[name][getName()].contains("highPass")) {
_highPass = config->conf[name][getName()]["highPass"];
}
_config->release();
// Define structure
demod.init(input, getIFSampleRate(), bandwidth, _lowPass, _highPass);
demod.init(input, getIFSampleRate(), bandwidth, _lowPass);
}
void start() { demod.start(); }
@@ -43,12 +40,6 @@ namespace demod {
_config->conf[name][getName()]["lowPass"] = _lowPass;
_config->release(true);
}
if (ImGui::Checkbox(("High Pass##_radio_wfm_highpass_" + name).c_str(), &_highPass)) {
demod.setHighPass(_highPass);
_config->acquire();
_config->conf[name][getName()]["highPass"] = _highPass;
_config->release(true);
}
}
void setBandwidth(double bandwidth) {
@@ -75,6 +66,8 @@ namespace demod {
int getDefaultDeemphasisMode() { return DEEMP_MODE_NONE; }
bool getFMIFNRAllowed() { return true; }
bool getNBAllowed() { return false; }
bool getHighPassAllowed() { return true; }
bool getSquelchAllowed() { return true; }
dsp::stream<dsp::stereo_t>* getOutput() { return &demod.out; }
private:
@@ -83,7 +76,6 @@ namespace demod {
ConfigManager* _config = NULL;
bool _lowPass = true;
bool _highPass = false;
std::string name;
};

View File

@@ -59,6 +59,8 @@ namespace demod {
int getDefaultDeemphasisMode() { return DEEMP_MODE_NONE; }
bool getFMIFNRAllowed() { return false; }
bool getNBAllowed() { return true; }
bool getHighPassAllowed() { return false; }
bool getSquelchAllowed() { return false; }
dsp::stream<dsp::stereo_t>* getOutput() { return &c2s.out; }
private:

View File

@@ -80,6 +80,8 @@ namespace demod {
int getDefaultDeemphasisMode() { return DEEMP_MODE_NONE; }
bool getFMIFNRAllowed() { return false; }
bool getNBAllowed() { return true; }
bool getHighPassAllowed() { return true; }
bool getSquelchAllowed() { return true; }
dsp::stream<dsp::stereo_t>* getOutput() { return &demod.out; }
private:

View File

@@ -100,18 +100,18 @@ namespace demod {
}
void showMenu() {
if (ImGui::Checkbox(("Stereo##_radio_wfm_stereo_" + name).c_str(), &_stereo)) {
setStereo(_stereo);
_config->acquire();
_config->conf[name][getName()]["stereo"] = _stereo;
_config->release(true);
}
if (ImGui::Checkbox(("Low Pass##_radio_wfm_lowpass_" + name).c_str(), &_lowPass)) {
demod.setLowPass(_lowPass);
_config->acquire();
_config->conf[name][getName()]["lowPass"] = _lowPass;
_config->release(true);
}
if (ImGui::Checkbox(("Stereo##_radio_wfm_stereo_" + name).c_str(), &_stereo)) {
setStereo(_stereo);
_config->acquire();
_config->conf[name][getName()]["stereo"] = _stereo;
_config->release(true);
}
if (ImGui::Checkbox(("Decode RDS##_radio_wfm_rds_" + name).c_str(), &_rds)) {
demod.setRDSOut(_rds);
_config->acquire();
@@ -270,6 +270,8 @@ namespace demod {
int getDefaultDeemphasisMode() { return DEEMP_MODE_50US; }
bool getFMIFNRAllowed() { return true; }
bool getNBAllowed() { return false; }
bool getHighPassAllowed() { return true; }
bool getSquelchAllowed() { return true; }
dsp::stream<dsp::stereo_t>* getOutput() { return &demod.out; }
// ============= DEDICATED FUNCTIONS =============