more stuff

This commit is contained in:
Ryzerth 2021-04-22 05:58:20 +02:00
parent a4c25280b3
commit 89e805b1a0
3 changed files with 23 additions and 20 deletions

View File

@ -75,11 +75,7 @@ private:
void updatePresence() {
double selectedFreq = gui::freqSelect.frequency;
std::string selectedName = gui::waterfall.selectedVFO;
if (selectedFreq != lastFreq) {
lastFreq = selectedFreq;
strcpy(mode, "Raw");
if (core::modComManager.interfaceExists(selectedName)) {
if (core::modComManager.getModuleName(selectedName) == "radio") {
int modeNum;
@ -94,6 +90,10 @@ private:
}
}
if (selectedFreq != lastFreq || mode != lastMode) {
lastFreq = selectedFreq;
lastMode = mode;
// Print out frequency to buffer
if (selectedFreq >= 1000000.0) {
sprintf(freq, "%.3lfMHz %s", selectedFreq / 1000000.0, mode);
@ -134,6 +134,7 @@ private:
double lastFreq;
char* freq = new char[1024];
char* mode = new char[1024];
std::string lastMode = "";
// Threading
int workerCounter = 0;

View File

@ -71,7 +71,8 @@ public:
}
void enable() {
vfo = sigpath::vfoManager.createVFO(name, ImGui::WaterfallVFO::REF_CENTER, 0, 150000, INPUT_SAMPLE_RATE, 150000, 150000, true);
double bw = gui::waterfall.getBandwidth();
vfo = sigpath::vfoManager.createVFO(name, ImGui::WaterfallVFO::REF_CENTER, std::clamp<double>(savedOffset, -bw/2.0, bw/2.0), 150000, INPUT_SAMPLE_RATE, 150000, 150000, true);
demod.setInput(vfo->output);
@ -91,6 +92,7 @@ public:
symSink.stop();
sink.stop();
savedOffset = vfo->getOffset();
sigpath::vfoManager.deleteVFO(vfo);
enabled = false;
}
@ -167,7 +169,7 @@ private:
std::string name;
bool enabled = true;
double savedOffset = 0;
// DSP Chain

View File

@ -194,7 +194,7 @@ private:
bool enabled = true;
int demodId = 0;
float audioSampRate = 48000;
double savedOffset;
double savedOffset = 0;
Demodulator* currentDemod = NULL;
VFOManager::VFO* vfo;