Switched to a custom logging lib instead of that spdlog junk

This commit is contained in:
AlexandreRouma
2023-02-25 18:12:34 +01:00
parent 7e80bbd02c
commit 7723d15e8f
154 changed files with 723 additions and 19918 deletions

View File

@ -4,7 +4,7 @@
#include <signal_path/signal_path.h>
#include <signal_path/sink.h>
#include <dsp/buffer/packer.h>
#include <spdlog/spdlog.h>
#include <utils/flog.h>
#include <config.h>
#include <utils/optionlist.h>
#include <aaudio/AAudio.h>

View File

@ -5,7 +5,7 @@
#include <signal_path/sink.h>
#include <dsp/buffer/packer.h>
#include <dsp/convert/stereo_to_mono.h>
#include <spdlog/spdlog.h>
#include <utils/flog.h>
#include <RtAudio.h>
#include <config.h>
#include <core.h>
@ -169,11 +169,11 @@ private:
stereoPacker.start();
}
catch (RtAudioError& e) {
spdlog::error("Could not open audio device");
flog::error("Could not open audio device");
return false;
}
spdlog::info("RtAudio stream open");
flog::info("RtAudio stream open");
return true;
}
@ -195,11 +195,11 @@ private:
if (count < 0) { return 0; }
// For debug purposes only...
// if (nBufferFrames != count) { spdlog::warn("Buffer size mismatch, wanted {0}, was asked for {1}", count, nBufferFrames); }
// if (nBufferFrames != count) { flog::warn("Buffer size mismatch, wanted {0}, was asked for {1}", count, nBufferFrames); }
// for (int i = 0; i < count; i++) {
// if (_this->stereoPacker.out.readBuf[i].l == NAN || _this->stereoPacker.out.readBuf[i].r == NAN) { spdlog::error("NAN in audio data"); }
// if (_this->stereoPacker.out.readBuf[i].l == INFINITY || _this->stereoPacker.out.readBuf[i].r == INFINITY) { spdlog::error("INFINITY in audio data"); }
// if (_this->stereoPacker.out.readBuf[i].l == -INFINITY || _this->stereoPacker.out.readBuf[i].r == -INFINITY) { spdlog::error("-INFINITY in audio data"); }
// if (_this->stereoPacker.out.readBuf[i].l == NAN || _this->stereoPacker.out.readBuf[i].r == NAN) { flog::error("NAN in audio data"); }
// if (_this->stereoPacker.out.readBuf[i].l == INFINITY || _this->stereoPacker.out.readBuf[i].r == INFINITY) { flog::error("INFINITY in audio data"); }
// if (_this->stereoPacker.out.readBuf[i].l == -INFINITY || _this->stereoPacker.out.readBuf[i].r == -INFINITY) { flog::error("-INFINITY in audio data"); }
// }
memcpy(outputBuffer, _this->stereoPacker.out.readBuf, nBufferFrames * sizeof(dsp::stereo_t));

View File

@ -7,7 +7,7 @@
#include <dsp/buffer/packer.h>
#include <dsp/convert/stereo_to_mono.h>
#include <dsp/sink/handler_sink.h>
#include <spdlog/spdlog.h>
#include <utils/flog.h>
#include <config.h>
#include <gui/style.h>
#include <core.h>
@ -203,7 +203,7 @@ private:
stereoSink.start();
}
else {
spdlog::warn("Starting");
flog::warn("Starting");
s2m.start();
monoSink.start();
}

View File

@ -6,7 +6,7 @@
#include <portaudio.h>
#include <dsp/buffer/packer.h>
#include <dsp/convert/stereo_to_mono.h>
#include <spdlog/spdlog.h>
#include <utils/flog.h>
#include <config.h>
#include <algorithm>
#include <core.h>
@ -104,11 +104,11 @@ public:
// In case of error, abort
if (err) {
spdlog::error("PortAudio error {0}: {1}", err, Pa_GetErrorText(err));
flog::error("PortAudio error {0}: {1}", err, Pa_GetErrorText(err));
return;
}
spdlog::info("Starting PortAudio stream at {0} S/s", sampleRate);
flog::info("Starting PortAudio stream at {0} S/s", sampleRate);
// Start stream
Pa_StartStream(devStream);

View File

@ -6,7 +6,7 @@
#include <portaudio.h>
#include <dsp/convert/stereo_to_mono.h>
#include <dsp/sink/ring_buffer.h>
#include <spdlog/spdlog.h>
#include <utils/flog.h>
#include <core.h>
#define CONCAT(a, b) ((std::string(a) + b).c_str())
@ -176,16 +176,16 @@ private:
}
if (err != 0) {
spdlog::error("Error while opening audio stream: ({0}) => {1}", err, Pa_GetErrorText(err));
flog::error("Error while opening audio stream: ({0}) => {1}", err, Pa_GetErrorText(err));
return;
}
err = Pa_StartStream(stream);
if (err != 0) {
spdlog::error("Error while starting audio stream: ({0}) => {1}", err, Pa_GetErrorText(err));
flog::error("Error while starting audio stream: ({0}) => {1}", err, Pa_GetErrorText(err));
return;
}
spdlog::info("Audio device open.");
flog::info("Audio device open.");
running = true;
}
@ -241,7 +241,7 @@ private:
// static int _stereo_cb(const void *input, void *output, unsigned long frameCount,
// const PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags statusFlags, void *userData) {
// AudioSink* _this = (AudioSink*)userData;
// if (_this->stereoPacker.out.read() < 0) { spdlog::warn("CB killed"); return 0; }
// if (_this->stereoPacker.out.read() < 0) { flog::warn("CB killed"); return 0; }
// memcpy((dsp::stereo_t*)output, _this->stereoPacker.out.readBuf, frameCount * sizeof(dsp::stereo_t));
// _this->stereoPacker.out.flush();
// return 0;