Formatted the entire codebase and added a CI check for formatting

This commit is contained in:
AlexandreRouma
2021-12-19 22:11:44 +01:00
parent 8644957881
commit ea587db0cb
161 changed files with 3302 additions and 3393 deletions

View File

@ -13,7 +13,7 @@
#define CONCAT(a, b) ((std::string(a) + b).c_str())
SDRPP_MOD_INFO {
SDRPP_MOD_INFO{
/* Name: */ "file_source",
/* Description: */ "Wav file source module for SDR++",
/* Author: */ "Ryzerth",
@ -23,9 +23,9 @@ SDRPP_MOD_INFO {
ConfigManager config;
class FileSourceModule : public ModuleManager::Instance {
class FileSourceModule : public ModuleManager::Instance {
public:
FileSourceModule(std::string name) : fileSelect("", {"Wav IQ Files (*.wav)", "*.wav", "All Files", "*"}) {
FileSourceModule(std::string name) : fileSelect("", { "Wav IQ Files (*.wav)", "*.wav", "All Files", "*" }) {
this->name = name;
config.acquire();
@ -82,7 +82,7 @@ private:
gui::waterfall.centerFrequencyLocked = false;
spdlog::info("FileSourceModule '{0}': Menu Deselect!", _this->name);
}
static void start(void* ctx) {
FileSourceModule* _this = (FileSourceModule*)ctx;
if (_this->running) { return; }
@ -91,7 +91,7 @@ private:
_this->workerThread = _this->float32Mode ? std::thread(floatWorker, _this) : std::thread(worker, _this);
spdlog::info("FileSourceModule '{0}': Start!", _this->name);
}
static void stop(void* ctx) {
FileSourceModule* _this = (FileSourceModule*)ctx;
if (!_this->running) { return; }
@ -103,12 +103,12 @@ private:
_this->reader->rewind();
spdlog::info("FileSourceModule '{0}': Stop!", _this->name);
}
static void tune(double freq, void* ctx) {
FileSourceModule* _this = (FileSourceModule*)ctx;
spdlog::info("FileSourceModule '{0}': Tune: {1}!", _this->name, freq);
}
static void menuHandler(void* ctx) {
FileSourceModule* _this = (FileSourceModule*)ctx;

View File

@ -53,25 +53,25 @@ public:
void rewind() {
file.seekg(sizeof(WavHeader_t));
}
void close() {
file.close();
}
private:
struct WavHeader_t {
char signature[4]; // "RIFF"
uint32_t fileSize; // data bytes + sizeof(WavHeader_t) - 8
char fileType[4]; // "WAVE"
char formatMarker[4]; // "fmt "
uint32_t formatHeaderLength; // Always 16
uint16_t sampleType; // PCM (1)
char signature[4]; // "RIFF"
uint32_t fileSize; // data bytes + sizeof(WavHeader_t) - 8
char fileType[4]; // "WAVE"
char formatMarker[4]; // "fmt "
uint32_t formatHeaderLength; // Always 16
uint16_t sampleType; // PCM (1)
uint16_t channelCount;
uint32_t sampleRate;
uint32_t bytesPerSecond;
uint16_t bytesPerSample;
uint16_t bitDepth;
char dataMarker[4]; // "data"
char dataMarker[4]; // "data"
uint32_t dataSize;
};