2014-04-03 15:29:13 -04:00
|
|
|
// -*- Mode: C++ -*-
|
2013-08-10 11:29:55 -04:00
|
|
|
#ifndef METERWIDGET_H
|
|
|
|
#define METERWIDGET_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QQueue>
|
|
|
|
|
|
|
|
class MeterWidget : public QWidget
|
|
|
|
{
|
2015-06-25 18:41:13 -04:00
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY (int value READ value WRITE setValue)
|
2013-08-10 11:29:55 -04:00
|
|
|
|
2015-06-25 18:41:13 -04:00
|
|
|
public:
|
|
|
|
explicit MeterWidget (QWidget *parent = 0);
|
2013-08-10 11:29:55 -04:00
|
|
|
|
2015-06-25 18:41:13 -04:00
|
|
|
// value property
|
|
|
|
int value () const {return m_signal;}
|
|
|
|
Q_SLOT void setValue (int value);
|
2013-08-10 11:29:55 -04:00
|
|
|
|
2015-06-25 18:41:13 -04:00
|
|
|
// QWidget implementation
|
|
|
|
QSize sizeHint () const override;
|
2017-03-06 09:34:25 -05:00
|
|
|
void set_sigPeak(int value);
|
2013-08-10 11:29:55 -04:00
|
|
|
protected:
|
2015-06-25 18:41:13 -04:00
|
|
|
void paintEvent( QPaintEvent * ) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QQueue<int> signalQueue;
|
|
|
|
int m_signal;
|
2017-03-06 09:34:25 -05:00
|
|
|
int m_noisePeak;
|
|
|
|
int m_sigPeak; // peak value for color coding
|
2013-08-10 11:29:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // METERWIDGET_H
|