-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparamview.h
More file actions
57 lines (41 loc) · 1 KB
/
paramview.h
File metadata and controls
57 lines (41 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef PARAMVIEW_H
#define PARAMVIEW_H
#include <QWidget>
#include <QString>
#include <QQueue>
#include <QColor>
#include "parameter.h"
class QPaintEvent;
class QResizeEvent;
class QMouseEvent;
class QPixmap;
class ParamView : public QWidget
{
Q_OBJECT
public:
explicit ParamView(QWidget *parent = 0);
~ParamView();
void viewParam(const QString& name, Parameter* p);
Parameter* parameter();
void setColor(const QColor& c);
signals:
public slots:
void updated();
protected:
void paintEvent(QPaintEvent*);
void resizeEvent(QResizeEvent* event);
void mouseMoveEvent(QMouseEvent *event);
private:
QString param_name;
Parameter* param;
QPixmap* main_pixmap;
QQueue<float>* buffer;
float buffer_max;
float buffer_min;
QColor param_color;
void updatePixmap();
void scaleFont(QFont &scale_font, int needed_height, int min_size, int max_size);
float getNearestMax(float value);
float getNearestMin(float value);
};
#endif // PARAMVIEW_H