mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-07-09 10:35:21 +02:00
Formatted the entire codebase and added a CI check for formatting
This commit is contained in:
@ -2,10 +2,9 @@
|
||||
#include <core.h>
|
||||
|
||||
SignalPath::SignalPath() {
|
||||
|
||||
}
|
||||
|
||||
void SignalPath::init(uint64_t sampleRate, int fftRate, int fftSize, dsp::stream<dsp::complex_t>* input, dsp::complex_t* fftBuffer, void fftHandler(dsp::complex_t*,int,void*), void* fftHandlerCtx) {
|
||||
void SignalPath::init(uint64_t sampleRate, int fftRate, int fftSize, dsp::stream<dsp::complex_t>* input, dsp::complex_t* fftBuffer, void fftHandler(dsp::complex_t*, int, void*), void* fftHandlerCtx) {
|
||||
this->sampleRate = sampleRate;
|
||||
this->sourceSampleRate = sampleRate;
|
||||
this->fftRate = fftRate;
|
||||
@ -179,12 +178,12 @@ void SignalPath::setDecimation(int dec) {
|
||||
else {
|
||||
split.setInput(&inputBuffer.out);
|
||||
}
|
||||
|
||||
|
||||
if (running) { split.start(); }
|
||||
core::setInputSampleRate(sourceSampleRate);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Create new decimators
|
||||
for (int i = 0; i < dec; i++) {
|
||||
dsp::HalfDecimator<dsp::complex_t>* decimator;
|
||||
@ -195,13 +194,13 @@ void SignalPath::setDecimation(int dec) {
|
||||
decimator = new dsp::HalfDecimator<dsp::complex_t>(&inputBuffer.out, &halfBandWindow);
|
||||
}
|
||||
else {
|
||||
decimator = new dsp::HalfDecimator<dsp::complex_t>(&decimators[i-1]->out, &halfBandWindow);
|
||||
decimator = new dsp::HalfDecimator<dsp::complex_t>(&decimators[i - 1]->out, &halfBandWindow);
|
||||
}
|
||||
|
||||
|
||||
if (running) { decimator->start(); }
|
||||
decimators.push_back(decimator);
|
||||
}
|
||||
split.setInput(&decimators[decimators.size()-1]->out);
|
||||
split.setInput(&decimators[decimators.size() - 1]->out);
|
||||
if (running) { split.start(); }
|
||||
|
||||
// Update the DSP sample rate
|
||||
@ -247,12 +246,12 @@ void SignalPath::setFFTWindow(int win) {
|
||||
void SignalPath::generateFFTWindow(int win, float* taps, int size) {
|
||||
if (win == FFT_WINDOW_RECTANGULAR) {
|
||||
for (int i = 0; i < size; i++) {
|
||||
taps[i] = (i%2) ? 1 : -1;
|
||||
taps[i] = (i % 2) ? 1 : -1;
|
||||
}
|
||||
}
|
||||
else if (win == FFT_WINDOW_BLACKMAN) {
|
||||
for (int i = 0; i < size; i++) {
|
||||
taps[i] = ((i%2) ? dsp::window_function::blackman(i, size) : -dsp::window_function::blackman(i, size))*2;
|
||||
taps[i] = ((i % 2) ? dsp::window_function::blackman(i, size) : -dsp::window_function::blackman(i, size)) * 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ enum {
|
||||
class SignalPath {
|
||||
public:
|
||||
SignalPath();
|
||||
void init(uint64_t sampleRate, int fftRate, int fftSize, dsp::stream<dsp::complex_t>* input, dsp::complex_t* fftBuffer, void fftHandler(dsp::complex_t*,int,void*), void* fftHandlerCtx);
|
||||
void init(uint64_t sampleRate, int fftRate, int fftSize, dsp::stream<dsp::complex_t>* input, dsp::complex_t* fftBuffer, void fftHandler(dsp::complex_t*, int, void*), void* fftHandlerCtx);
|
||||
void start();
|
||||
void stop();
|
||||
void setSampleRate(double sampleRate);
|
||||
|
@ -32,7 +32,7 @@ void SinkManager::Stream::start() {
|
||||
if (running) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
splitter.start();
|
||||
volumeAjust.start();
|
||||
sink->start();
|
||||
@ -113,7 +113,7 @@ void SinkManager::unregisterSinkProvider(std::string name) {
|
||||
}
|
||||
|
||||
onSinkProviderUnregister.emit(name);
|
||||
|
||||
|
||||
// Switch all sinks using it to a null sink
|
||||
for (auto& [streamName, stream] : streams) {
|
||||
if (providerNames[stream->providerId] != name) { continue; }
|
||||
@ -344,7 +344,7 @@ void SinkManager::showMenu() {
|
||||
float menuWidth = ImGui::GetContentRegionAvailWidth();
|
||||
int count = 0;
|
||||
int maxCount = streams.size();
|
||||
|
||||
|
||||
std::string provStr = "";
|
||||
for (auto const& name : providerNames) {
|
||||
provStr += name;
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
|
||||
dsp::stream<dsp::stereo_t>* sinkOut;
|
||||
|
||||
Event<float> srChange;
|
||||
Event<float> srChange;
|
||||
|
||||
private:
|
||||
dsp::stream<dsp::stereo_t>* _in;
|
||||
@ -86,7 +86,6 @@ public:
|
||||
|
||||
private:
|
||||
dsp::NullSink<dsp::stereo_t> ns;
|
||||
|
||||
};
|
||||
|
||||
void registerSinkProvider(std::string name, SinkProvider provider);
|
||||
@ -130,5 +129,4 @@ private:
|
||||
std::vector<std::string> providerNames;
|
||||
std::string providerNamesTxt;
|
||||
std::vector<std::string> streamNames;
|
||||
|
||||
};
|
@ -3,7 +3,6 @@
|
||||
#include <signal_path/signal_path.h>
|
||||
|
||||
SourceManager::SourceManager() {
|
||||
|
||||
}
|
||||
|
||||
void SourceManager::registerSource(std::string name, SourceHandler* handler) {
|
||||
@ -34,11 +33,11 @@ void SourceManager::unregisterSource(std::string name) {
|
||||
|
||||
std::vector<std::string> SourceManager::getSourceNames() {
|
||||
std::vector<std::string> names;
|
||||
for (auto const& [name, src] : sources) { names.push_back(name); }
|
||||
for (auto const& [name, src] : sources) { names.push_back(name); }
|
||||
return names;
|
||||
}
|
||||
|
||||
void SourceManager::selectSource(std::string name) {
|
||||
void SourceManager::selectSource(std::string name) {
|
||||
if (sources.find(name) == sources.end()) {
|
||||
spdlog::error("Tried to select non existent source: {0}", name);
|
||||
return;
|
||||
|
@ -23,7 +23,7 @@ public:
|
||||
|
||||
void registerSource(std::string name, SourceHandler* handler);
|
||||
void unregisterSource(std::string name);
|
||||
void selectSource(std::string name);
|
||||
void selectSource(std::string name);
|
||||
void showSelectedMenu();
|
||||
void start();
|
||||
void stop();
|
||||
@ -43,5 +43,4 @@ private:
|
||||
double tuneOffset;
|
||||
double currentFreq;
|
||||
dsp::stream<dsp::complex_t> nullSource;
|
||||
|
||||
};
|
@ -87,7 +87,6 @@ std::string VFOManager::VFO::getName() {
|
||||
}
|
||||
|
||||
VFOManager::VFOManager() {
|
||||
|
||||
}
|
||||
|
||||
VFOManager::VFO* VFOManager::createVFO(std::string name, int reference, double offset, double bandwidth, double sampleRate, double minBandwidth, double maxBandwidth, bool bandwidthLocked) {
|
||||
@ -187,7 +186,7 @@ int VFOManager::getReference(std::string name) {
|
||||
return vfos[name]->getReference();
|
||||
}
|
||||
|
||||
void VFOManager::setColor(std::string name, ImU32 color) {
|
||||
void VFOManager::setColor(std::string name, ImU32 color) {
|
||||
if (vfos.find(name) == vfos.end()) {
|
||||
return;
|
||||
}
|
||||
|
@ -35,7 +35,6 @@ public:
|
||||
|
||||
private:
|
||||
std::string name;
|
||||
|
||||
};
|
||||
|
||||
VFOManager::VFO* createVFO(std::string name, int reference, double offset, double bandwidth, double sampleRate, double minBandwidth, double maxBandwidth, bool bandwidthLocked);
|
||||
|
Reference in New Issue
Block a user