mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-02 14:04:47 -04:00
Add NBFM mode, add mode selector button height font reduction when scaled down
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#include "ModemNBFM.h"
|
||||
|
||||
ModemNBFM::ModemNBFM() : ModemAnalog() {
|
||||
demodFM = freqdem_create(0.5);
|
||||
}
|
||||
|
||||
ModemNBFM::~ModemNBFM() {
|
||||
freqdem_destroy(demodFM);
|
||||
}
|
||||
|
||||
Modem *ModemNBFM::factory() {
|
||||
return new ModemNBFM;
|
||||
}
|
||||
|
||||
std::string ModemNBFM::getName() {
|
||||
return "NBFM";
|
||||
}
|
||||
|
||||
int ModemNBFM::getDefaultSampleRate() {
|
||||
return 12500;
|
||||
}
|
||||
|
||||
void ModemNBFM::demodulate(ModemKit *kit, ModemIQData *input, AudioThreadInput *audioOut) {
|
||||
ModemKitAnalog *fmkit = (ModemKitAnalog *)kit;
|
||||
|
||||
initOutputBuffers(fmkit, input);
|
||||
|
||||
if (!bufSize) {
|
||||
input->decRefCount();
|
||||
return;
|
||||
}
|
||||
|
||||
freqdem_demodulate_block(demodFM, &input->data[0], bufSize, &demodOutputData[0]);
|
||||
|
||||
buildAudioOutput(fmkit, audioOut, false);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include "Modem.h"
|
||||
#include "ModemAnalog.h"
|
||||
|
||||
class ModemNBFM : public ModemAnalog {
|
||||
public:
|
||||
ModemNBFM();
|
||||
~ModemNBFM();
|
||||
|
||||
std::string getName();
|
||||
|
||||
Modem *factory();
|
||||
|
||||
int getDefaultSampleRate();
|
||||
|
||||
void demodulate(ModemKit *kit, ModemIQData *input, AudioThreadInput *audioOut);
|
||||
|
||||
private:
|
||||
freqdem demodFM;
|
||||
};
|
||||
Reference in New Issue
Block a user