-
Notifications
You must be signed in to change notification settings - Fork 1
/
kmeter.h
34 lines (31 loc) · 855 Bytes
/
kmeter.h
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
#if !defined (_KMETER_H)
#define _KMETER_H (1)
#include "v4l2_wayland.h"
#include "vwdrawable.h"
class Meter : public vwDrawable {
public:
Meter();
~Meter() {}
void init(DingleDots *dd, int fsamp, int fsize, float hold, float fall,
float x, float y, float w, color c);
void process(float *p, int n);
void read(float *rms, float *dpk);
bool render(std::vector<cairo_t *> &contexts);
int in(double x_in, double y_in);
float mapk20(float v);
private:
float z1; // filter state
float z2; // filter state
float rms; // max rms value since last read()
float dpk; // current digital peak value
int cnt; // digital peak hold counter
int flag; // flag set by read(), resets _rms
int hold;
float fall;
float omega;
struct color c;
float x;
float y;
float w;
};
#endif