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
58
59
60
61
62
|
#ifndef VUMETER_H
#define VUMETER_H
#include "qtrec.h"
#include <qpainter.h>
#include <qpixmap.h>
#include <qpushbutton.h>
typedef struct {
bool onOff;
int hold,update,leds,reso;
float resoFactor;
} VUParameters;
class VUMeter: public QWidget
{
Q_OBJECT
public:
VUMeter(QWidget *parent=0, const char *name=0, const int tracks=2);
~VUMeter();
VUParameters para;
QTimer *vuTimer;
void startTimer();
void stopTimer();
public slots:
void setTracks(int trk) {tracks=trk;};
void setPeak(int a[]);
void setPeak(float a[]);
void timeSlot();
void slotOn();
void slotOff();
void update();
void slotProps();
void resize();
void readConf();
void writeConf();
signals:
void statusChanged(const char *);
protected:
virtual void paintEvent(QPaintEvent*);
virtual void resizeEvent(QResizeEvent*);
virtual void mousePressEvent(QMouseEvent*);
void paint();
private:
int tracks, colorScheme;
float resoFactor;
int x,y,sx,sy,dx,dy,ox,oy;
float peak[4], hold[4];
int i_peak[4], i_hold[4];
int holdTime[4];
QPixmap *buffer, *warning;
QPopupMenu *vuProp;
QColor color[37];
};
#endif
|