diff --git a/inputsource.cpp b/inputsource.cpp index 7a26e64..d92b332 100644 --- a/inputsource.cpp +++ b/inputsource.cpp @@ -6,6 +6,8 @@ #include #include +#include + InputSource::InputSource(const char *filename) { m_file = fopen(filename, "rb"); if (m_file == nullptr) diff --git a/spectrogram.cpp b/spectrogram.cpp index 36cec75..5356110 100644 --- a/spectrogram.cpp +++ b/spectrogram.cpp @@ -7,6 +7,9 @@ #include #include +#include + + Spectrogram::Spectrogram() { sampleRate = 8000000; @@ -118,7 +121,7 @@ void Spectrogram::paintEvent(QPaintEvent *event) for (int y = 0; y < height; y++) { getLine(line, rect.y() + y); for (int x = 0; x < fftSize; x++) { - float powerRange = std::abs(powerMin - powerMax); + float powerRange = std::abs(int(powerMin - powerMax)); // Cast to remove overload ambiguity float normPower = (line[x] - powerMax) * -1.0f / powerRange; normPower = clamp(normPower, 0.0f, 1.0f); diff --git a/spectrogram.h b/spectrogram.h index ee30405..256fe94 100644 --- a/spectrogram.h +++ b/spectrogram.h @@ -4,6 +4,8 @@ #include "fft.h" #include "inputsource.h" +#include + static const double Tau = M_PI * 2.0; class Spectrogram : public QWidget { diff --git a/spectrogramcontrols.cpp b/spectrogramcontrols.cpp index e6cc513..c57d4bc 100644 --- a/spectrogramcontrols.cpp +++ b/spectrogramcontrols.cpp @@ -1,6 +1,7 @@ #include "spectrogramcontrols.h" #include #include +#include SpectrogramControls::SpectrogramControls(const QString & title, QWidget * parent) : QDockWidget::QDockWidget(title, parent)