Ardour  9.0-pre0-582-g084a23a80d
vumeterdsp.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Fons Adriaensen <fons@linuxaudio.org>
3  * Copyright (C) 2013-2014 Paul Davis <paul@linuxaudiosystems.com>
4  * Copyright (C) 2013-2019 Robin Gareus <robin@gareus.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #ifndef __VUMETERDSP_H
22 #define __VUMETERDSP_H
23 
25 
27 {
28 public:
29 
30  Vumeterdsp (void);
31  ~Vumeterdsp (void);
32 
33  void process (float const *p, int n);
34  float read (void);
35  void reset ();
36 
37  static void init (float fsamp);
38 
39 private:
40 
41  float _z1; // filter state
42  float _z2; // filter state
43  float _m; // max value since last read()
44  bool _res; // flag to reset m
45 
46  static float _w; // lowpass filter coefficient
47  static float _g; // gain factor
48 };
49 
50 #endif
~Vumeterdsp(void)
float _z1
Definition: vumeterdsp.h:41
float _z2
Definition: vumeterdsp.h:42
float read(void)
static float _g
Definition: vumeterdsp.h:47
float _m
Definition: vumeterdsp.h:43
static void init(float fsamp)
bool _res
Definition: vumeterdsp.h:44
void process(float const *p, int n)
void reset()
static float _w
Definition: vumeterdsp.h:46
Vumeterdsp(void)
#define LIBARDOUR_API