Commit a94846c4 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

unbreak audio spectrum

parent fcc17c06
......@@ -140,7 +140,7 @@ AudioGraphWidget::AudioGraphWidget(QWidget *parent)
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
}
void AudioGraphWidget::showAudio(const QVector<double> &bands)
void AudioGraphWidget::showAudio(const QVector<float> &bands)
{
m_levels = bands;
update();
......@@ -373,5 +373,5 @@ void AudioGraphSpectrum::processSpectrum(const SharedFrame &frame)
}
// Update the audio signal widget
QMetaObject::invokeMethod(m_graphWidget, "showAudio", Qt::QueuedConnection, Q_ARG(const QVector<double> &, bands));
QMetaObject::invokeMethod(m_graphWidget, "showAudio", Qt::QueuedConnection, Q_ARG(const QVector<float> &, bands));
}
......@@ -55,7 +55,7 @@ public:
void drawBackground();
public slots:
void showAudio(const QVector<double> &bands);
void showAudio(const QVector<float> &bands);
protected:
void paintEvent(QPaintEvent *pe);
......
......@@ -144,7 +144,7 @@ AudioGraphWidget::AudioGraphWidget(QWidget *parent)
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
}
void AudioGraphWidget::showAudio(const QVector<double> &bands)
void AudioGraphWidget::showAudio(const QVector<float> &bands)
{
m_levels = bands;
update();
......@@ -262,7 +262,7 @@ void AudioGraphWidget::paintEvent(QPaintEvent *pe)
p.setOpacity(0.6);
QRectF rect(m_rect.left(), 0, barWidth, height);
for (int i = 0; i < chanCount; i++) {
double level = (0.5 + m_levels.at(i)) / 1.5 * height;
float level = (0.5 + m_levels.at(i)) / 1.5 * height;
if (level < 0) {
continue;
}
......
......@@ -57,14 +57,14 @@ public:
void drawBackground();
public slots:
void showAudio(const QVector<double> &bands);
void showAudio(const QVector<float> &bands);
protected:
void paintEvent(QPaintEvent *pe) override;
void resizeEvent(QResizeEvent *event) override;
private:
QVector<double> m_levels;
QVector<float> m_levels;
QVector<int> m_dbLabels;
QStringList m_freqLabels;
QPixmap m_pixmap;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment