Fix missing includes

This commit is contained in:
Mathieu Rene
2015-08-16 14:47:05 -04:00
parent 37a49e80a5
commit d8d529e284
4 changed files with 9 additions and 1 deletions

View File

@@ -7,6 +7,9 @@
#include <QPaintEvent>
#include <QRect>
#include <cstdlib>
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);