LMMS
Loading...
Searching...
No Matches
plugins
LadspaEffect
caps
Compress.h
Go to the documentation of this file.
1
/*
2
Compress.h
3
4
Copyright 2004-5 Tim Goetze <tim@quitte.de>, Steve Harris
5
6
http://quitte.de/dsp/
7
8
mono compressor.
9
10
*/
11
/*
12
This program is free software; you can redistribute it and/or
13
modify it under the terms of the GNU General Public License
14
as published by the Free Software Foundation; either version 2
15
of the License, or (at your option) any later version.
16
17
This program is distributed in the hope that it will be useful,
18
but WITHOUT ANY WARRANTY; without even the implied warranty of
19
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
GNU General Public License for more details.
21
22
You should have received a copy of the GNU General Public License
23
along with this program; if not, write to the Free Software
24
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25
02111-1307, USA or point your web browser to http://www.gnu.org.
26
*/
27
28
#ifndef _COMPRESS_H_
29
#define _COMPRESS_H_
30
31
#include "
dsp/RMS.h
"
32
#include "
dsp/util.h
"
33
34
class
Compress
35
:
public
Plugin
36
{
37
public
:
38
double
fs
;
39
sample_t
f
;
40
41
DSP::RMS
rms
;
42
sample_t
sum
,
amp
,
env
,
gain
,
gain_t
;
43
44
int
count
;
45
46
template
<sample_func_t F>
47
void
one_cycle
(
int
frames);
48
49
public
:
50
static
PortInfo
port_info
[];
51
52
void
init
() {}
53
void
activate
()
54
{
55
rms
.reset();
56
57
sum
= 0;
58
count
= 0;
59
60
amp
= 0;
61
env
= 0;
62
63
gain
= 0;
64
gain_t
= 0;
65
}
66
67
void
run
(
int
n
)
68
{
69
one_cycle<store_func>
(
n
);
70
}
71
72
void
run_adding
(
int
n
)
73
{
74
one_cycle<adding_func>
(
n
);
75
}
76
};
77
78
#endif
/* _COMPRESS_H_ */
util.h
sample_t
LADSPA_Data sample_t
Definition
basics.h:100
RMS.h
Compress
Definition
Compress.h:36
Compress::rms
DSP::RMS rms
Definition
Compress.h:41
Compress::run_adding
void run_adding(int n)
Definition
Compress.h:72
Compress::gain_t
sample_t gain_t
Definition
Compress.h:42
Compress::env
sample_t env
Definition
Compress.h:42
Compress::amp
sample_t amp
Definition
Compress.h:42
Compress::gain
sample_t gain
Definition
Compress.h:42
Compress::fs
double fs
Definition
Compress.h:38
Compress::run
void run(int n)
Definition
Compress.h:67
Compress::port_info
static PortInfo port_info[]
Definition
Compress.h:50
Compress::f
sample_t f
Definition
Compress.h:39
Compress::activate
void activate()
Definition
Compress.h:53
Compress::count
int count
Definition
Compress.h:44
Compress::one_cycle
void one_cycle(int frames)
Compress::sum
sample_t sum
Definition
Compress.h:42
Compress::init
void init()
Definition
Compress.h:52
DSP::RMS
Definition
RMS.h:34
Plugin
Definition
basics.h:174
PortInfo
Definition
basics.h:94
n
int n
Definition
crypt.c:458
Generated on
for LMMS by
1.16.1